12 getSharedObjectFromDebian = sharedObjectName: src: stdenv.mkDerivation {
13 name = "${sharedObjectName}-fetcher";
22 echo shared objects found are:
24 cp usr/lib/*/${sharedObjectName} $out
28 makeSharedObjectTest = sharedObject: targetPkgs: let
29 lddFHSEnv = buildFHSEnv {
30 name = "ldd-with-ncurses-FHS-env";
34 ldd-in-FHS = "${lddFHSEnv}/bin/${lddFHSEnv.name}";
35 ldd = "${lib.getBin glibc}/bin/ldd";
36 find_libFHSEnv = buildFHSEnv {
37 name = "ls-with-ncurses-FHS-env";
41 runScript = "find /lib/ -executable";
43 find_lib-in-FHS = "${find_libFHSEnv}/bin/${find_libFHSEnv.name}";
44 in runCommand "FHS-lib-test" {} ''
45 echo original ldd output is:
46 ${ldd} ${sharedObject}
47 lddOutput="$(${ldd-in-FHS} ${sharedObject})"
48 echo ldd output inside FHS is:
50 if echo $lddOutput | grep -q "not found"; then
51 echo "shared object could not find all dependencies in the FHS!"
52 echo The libraries below where found in the FHS:
56 echo $lddOutput > $out
61 # This test proves an issue with buildFHSEnv - don't expect it to succeed,
62 # this is discussed in https://github.com/NixOS/nixpkgs/pull/279844 .
63 libtinfo = makeSharedObjectTest (getSharedObjectFromDebian "libedit.so.2.0.70" (fetchurl {
64 url = "mirror://debian/pool/main/libe/libedit/libedit2_3.1-20221030-2_amd64.deb";
65 hash = "sha256-HPFKvycW0yedsS0GV6VzfPcAdKHnHTvfcyBmJePInOY=";
67 ncurses' = p.ncurses.overrideAttrs (old: {
68 configureFlags = old.configureFlags ++ [ "--with-termlib" ];
72 (ncurses'.override { unicodeSupport = false; })
76 liblzma = makeSharedObjectTest (getSharedObjectFromDebian "libxml2.so.2.9.14" (fetchurl {
77 url = "mirror://debian/pool/main/libx/libxml2/libxml2_2.9.14+dfsg-1.3~deb12u1_amd64.deb";
78 hash = "sha256-NbdstwOPwclAIEpPBfM/+3nQJzU85Gk5fZrc+Pmz4ac=";