Closed filipg7777 closed 5 years ago
Hey, I managed to build your project statically:
https://gitlab.com/filipg/geval/merge_requests/3
Please let me know if it's working for you, then I'll merge #48.
For my records, I had first tried to do it via pkg-config
, like so:
export NIX_LDFLAGS="$(pkg-config --static --libs-only-l cairo) $NIX_LDFLAGS"
This required making them available via PKG_CONFIG_PATH
, for which I used this:
final.haskell.lib.addPkgconfigDepends drv [ final.cairo final.pcre final.libxcb final.xorg.libpthreadstubs final.xorg.libXdmcp ];
But while that did add all the flags I needed, it also added some more that weren't available (and apparently unnecessary, given that I could link it with fewer -l
flags as in the working approach above):
Linking dist/build/geval/geval ...
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lGL
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lgobject-2.0
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lglib-2.0
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lEGL
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lGL
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lXrender
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lXext
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lX11
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lXau
/nix/store/bprb8jwawnsfnrmjwvazl3r84869f0g3-binutils-2.31.1/bin/ld: cannot find -lXdmcp
Danke schön, works perfectly!
Please let me know if it's working for you, then I'll merge #48.
I'm trying to build my program (https://gitlab.com/filipg/geval) statically using the approach with Stack (https://github.com/nh2/static-haskell-nix#building-stack-projects), see the
default.nix
file: https://gitlab.com/filipg/geval/blob/master/default.nixUnfortunately, I got the following error:
Is there a simple way to overcome this problem?