Description
I am trying to build https://travis-ci.org/entropia/tip-toi-reveng/ statically using these instructions, and I made good progress by pinning nixpkgs
to version NixOS/nixpkgs@2c07921 (which is the one mentioned in the README
) and then buliding pkgs.pkgsMusl.haskell.packages.ghc843.tttool
.
And indeed, as long as I stub out uses of TemplateHaskell
in my program (it it expected that this is needed?), it builds… almost: It fails linking
Linking dist/build/tttool/tttool ...
/nix/store/3a74d03pq6d0cg3crkfw965k5s58hbn4-binutils-2.30/bin/ld: cannot find -ltinfo
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
builder for '/nix/store/4z8hp5bslaxlgasq69k4njxl2z1hnwz2-tttool-1.8.1.drv' failed with exit code 1
error: build of '/nix/store/4z8hp5bslaxlgasq69k4njxl2z1hnwz2-tttool-1.8.1.drv' failed
Blindly cargo-culting the example scotty app, I tried adding the following to my project.nix
configureFlags = pkgs.lib.optional static [
"--ghc-option=-optl=-static"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
"--extra-lib-dirs=${pkgs.zlib.static}/lib"
"--extra-lib-dirs=${pkgs.ncurses5.override { enableStatic = true; }}/lib"
];
but it did not make a difference (and there was already a --extra-lib-dirs=/nix/store/1xwbnc903gymfi99zpvj8mdp5601yqz6-ncurses-6.1/lib
commde line argument passed automatically somehow).
Is it maybe dubious that https://github.com/NixOS/nixpkgs/blob/2c07921cff84dfb0b9e0f6c2d10ee2bfee6a85ac/pkgs/development/libraries/ncurses/default.nix starts with
, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt