[Nix-dev] stdenv updates for non-nixos

jack-nix at mudshark.org jack-nix at mudshark.org
Mon Apr 9 23:18:42 CEST 2012


Here's an updated version of my glibc rpath patch that solves a few more cases
with libnss_* and friends. 

I wanted a better solution, but this seems to have covered off the problematic
cases of nix applications picking up system libraries. 

--Jack 

--
Jack (John) Cummings                           http://mudshark.org/
PGP fingerprint: A927 992E 197B 0A86 27BC  964D A1DA CBAC CC48 B110
-------------- next part --------------
diff -r 3ace36f976bc pkgs/development/libraries/glibc/2.13/builder.sh
--- a/pkgs/development/libraries/glibc/2.13/builder.sh	Sun Apr 08 14:32:00 2012 +0000
+++ b/pkgs/development/libraries/glibc/2.13/builder.sh	Mon Apr 09 14:10:53 2012 -0700
@@ -51,5 +51,35 @@
     rm -f $out/lib/libgcc_s.so.1
 }
 
+postFixup() {
+    # we need the glibc binaries to link against the glibc they were compiled
+    # against (and compiled with)
+
+    patchelf --set-rpath $out/lib $out/bin/gencat
+    patchelf --set-rpath $out/lib $out/bin/getconf
+    patchelf --set-rpath $out/lib $out/bin/getent
+    patchelf --set-rpath $out/lib $out/bin/iconv
+    patchelf --set-rpath $out/lib $out/bin/locale
+    patchelf --set-rpath $out/lib $out/bin/localedef
+    patchelf --set-rpath $out/lib $out/bin/pcprofiledump
+    patchelf --set-rpath $out/lib $out/bin/rpcgen
+    patchelf --set-rpath $out/lib $out/bin/sprof
+    patchelf --set-rpath $out/lib $out/sbin/iconvconfig
+    patchelf --set-rpath $out/lib $out/sbin/nscd
+    patchelf --set-rpath $out/lib $out/sbin/zdump
+    patchelf --set-rpath $out/lib $out/sbin/zic
+    #patchelf --set-rpath $out/lib $out/libexec/getconf/* # MEH?
+
+    # we need to path the libs, otherwise they pick up system libs as
+    # dependencies. 
+
+    patchelf --set-rpath $out/lib $out/lib/librt-*.so
+    patchelf --set-rpath $out/lib $out/lib/libnss_compat-*.so
+    patchelf --set-rpath $out/lib $out/lib/libnss_dns-*.so
+    patchelf --set-rpath $out/lib $out/lib/libnss_files-*.so
+    patchelf --set-rpath $out/lib $out/lib/libnss_hesiod-*.so
+    patchelf --set-rpath $out/lib $out/lib/libnss_nis-*.so
+    patchelf --set-rpath $out/lib $out/lib/libnss_nisplus-*.so
+}
 
 genericBuild
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20120409/c0679e6b/attachment.bin 


More information about the nix-dev mailing list