I’m trying to make one of my maintained packages ready for static compilation. It’s a project built with meson, and I’m getting this weird error message:
> /nix/store/z3f96scg3kd3l3pk38d51wsw0axryn6x-x86_64-unknown-linux-musl-binutils-2.41/bin/x86_64-unknown-linux-musl-ld: cannot find -l/nix/store/d328kn0fnksm9bwd3wzjw0gw2471r0ca-zlib-static-x86_64-unknown-linux-musl-1.3.1/lib/libz.a: No such file or directory
So it seems it’s trying to link a file called -l/bla/libz.a
, instead of libz.a
. Of course, -lbla
doesn’t exist, it’s obviously the wrong path. I’m a little lost on how to get to the bottom of this, however. My default.nix for the package is fairly simple I would say. I put zlib
in the buildInputs
, and specify no special flags to meson
otherwise.
CrystFEL simply uses dependency('zlib')
to find zlib
(see its meson.build) and then uses it later as an argument to dependencies: [...]
(see here).
Where does this path mixup come from, if there’s nothing special about the handling of zlib here? Are there ways to find out how zlib is being searched for and integrated into the linker command line?
If you want to try this out, simple clone my nixpkgs repo at the crystfel-static branch and type nix-build -A pkgsStatic.crystfel-headless