diff --git a/pkgs/development/libraries/glibc/2.19/builder.sh b/pkgs/development/libraries/glibc/2.19/builder.sh index 3b077cbb3fd..7db93dc3bcf 100644 --- a/pkgs/development/libraries/glibc/2.19/builder.sh +++ b/pkgs/development/libraries/glibc/2.19/builder.sh @@ -12,6 +12,9 @@ postConfigure() { export NIX_DONT_SET_RPATH=1 unset CFLAGS + + # Apparently --bindir is not respected. + makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin") } @@ -27,7 +30,7 @@ postInstall() { if test -z "$hurdHeaders"; then # Include the Linux kernel headers in Glibc, except the `scsi' # subdirectory, which Glibc provides itself. - (cd $out/include && \ + (cd $dev/include && \ ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .) fi @@ -52,6 +55,17 @@ postInstall() { # Get rid of more unnecessary stuff. rm -rf $out/var $out/sbin/sln + + # Put libraries for static linking in a separate output. Note + # that libc_nonshared.a and libpthread_nonshared.a are required + # for dynamically-linked applications. + mkdir -p $static/lib + mv $out/lib/*.a $static/lib + mv $static/lib/lib*_nonshared.a $out/lib + + # Work around a Nix bug: hard links across outputs cause a build failure. + cp $bin/bin/getconf $bin/bin/getconf_ + mv $bin/bin/getconf_ $bin/bin/getconf } genericBuild diff --git a/pkgs/development/libraries/glibc/2.19/locales.nix b/pkgs/development/libraries/glibc/2.19/locales.nix index 9f9fb86a396..08c791b4131 100644 --- a/pkgs/development/libraries/glibc/2.19/locales.nix +++ b/pkgs/development/libraries/glibc/2.19/locales.nix @@ -25,7 +25,7 @@ build null { # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. buildPhase = '' - mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" + mkdir -p $TMPDIR/"${stdenv.gcc.libc}/lib/locale" # Hack to allow building of the locales (needed since glibc-2.12) sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \