build: add Fyne/GLFW native deps to dev shell
Add libGL, mesa, wayland, libxkbcommon and the X client libraries the Fyne cgo toolchain links against, plus LIBRARY_PATH so Go's linker finds them (it does not read NIX_LDFLAGS).
This commit is contained in:
@@ -30,12 +30,39 @@
|
||||
libjpeg_turbo
|
||||
pipewire
|
||||
xdg-desktop-portal
|
||||
# Fyne / GLFW (cgo) native dependencies.
|
||||
libGL
|
||||
mesa
|
||||
wayland
|
||||
libxkbcommon
|
||||
libX11
|
||||
libXrandr
|
||||
libXi
|
||||
libXcursor
|
||||
libXinerama
|
||||
libXxf86vm
|
||||
];
|
||||
|
||||
# Make turbojpeg resolve via pkg-config for cgo builds.
|
||||
PKG_CONFIG_PATH = "${pkgs.libjpeg_turbo.dev}/lib/pkgconfig";
|
||||
LD_LIBRARY_PATH = "${pkgs.libjpeg_turbo.out}/lib";
|
||||
|
||||
# Fyne/GLFW link against X11, Wayland, GL and misc libs. Go's cgo
|
||||
# linker does not read NIX_LDFLAGS, so expose the runtime lib dirs
|
||||
# via LIBRARY_PATH for the link step.
|
||||
LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
|
||||
libGL
|
||||
mesa
|
||||
wayland
|
||||
libxkbcommon
|
||||
libX11
|
||||
libXrandr
|
||||
libXi
|
||||
libXcursor
|
||||
libXinerama
|
||||
libXxf86vm
|
||||
];
|
||||
|
||||
# Nix's libspa-0.2.pc emits -fno-strict-aliasing/-fno-strict-overflow
|
||||
# which Go's cgo rejects unless explicitly allowed.
|
||||
CGO_CFLAGS_ALLOW = "-fno-strict-overflow|-fno-strict-aliasing";
|
||||
|
||||
Reference in New Issue
Block a user