remove the dependency on /bin/pwd, use the pwd we have in $PATH instead

svn path=/nixpkgs/branches/nixos-pkgs/; revision=2052
This commit is contained in:
Armijn Hemel 2005-01-18 13:04:28 +00:00
parent 0e6b2045ea
commit 81e13c1572
5 changed files with 123 additions and 66 deletions

View File

@ -1,8 +1,17 @@
# glibc cannot have itself in its rpath.
export NIX_NO_SELF_RPATH=1
export NIX_DEBUG=1
export NIX_DONT_SET_RPATH=1
. $stdenv/setup
glibc=`cat $NIX_GCC/nix-support/orig-glibc`
echo $glibc
export LD_LIBRARY_PATH=$glibc/lib
ourpwd=/nix/store/570ce2f39dcb7a75ac0793a1a73fd0b2-coreutils/bin/pwd
export PWD_P=$ourpwd
postUnpack() {
cd $sourceRoot
@ -11,10 +20,12 @@ postUnpack() {
cd ..
}
postUnpack=postUnpack
#postUnpack=postUnpack
preConfigure() {
. $subst
echo "PATH:" $PATH
mkdir ../build
cd ../build
configureScript=../$sourceRoot/configure
@ -23,13 +34,24 @@ preConfigure() {
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=317. Be sure
# to read Drepper's comment for another classic example of glibc's
# release management strategy.
configureFlags="--enable-add-ons --disable-profile \
--with-headers=$kernelHeaders/include \
--with-tls --without-__thread"
#configureFlags="--enable-add-ons --disable-profile \
# --with-headers=$kernelHeaders/include \
# --with-tls --without-__thread"
#configureFlags="--enable-add-ons --disable-profile \
# --with-tls --with-headers=$kernelHeaders/include"
configureFlags="--enable-add-ons \
--with-headers=$kernelHeaders/include"
}
preConfigure=preConfigure
configurePhase() {
preConfigure
$SHELL $configureScript $configureFlags --prefix=$out
}
configurePhase=configurePhase
postInstall() {
if test -n "$installLocales"; then
@ -38,7 +60,7 @@ postInstall() {
rm $out/etc/ld.so.cache
(cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
# `glibcbug' causes a retained dependency on the C compiler.
rm $out/bin/glibcbug
#rm $out/bin/glibcbug
}
postInstall=postInstall

View File

@ -3,17 +3,23 @@
stdenv.mkDerivation {
name = "glibc-2.3.3";
builder = ./builder.sh;
subst = ./subst.sh;
src = fetchurl {
url = http://ftp.gnu.org/pub/gnu/glibc/glibc-2.3.3.tar.bz2;
md5 = "e825807b98042f807799ccc9dd96d31b";
};
linuxthreadsSrc = fetchurl {
url = http://ftp.gnu.org/pub/gnu/glibc/glibc-linuxthreads-2.3.3.tar.bz2;
md5 = "8149ea62922e75bd692bc3b92e5e766b";
url = ftp://sources.redhat.com/pub/glibc/snapshots/glibc-20050110.tar.bz2;
md5 = "1171587e4802f43fdda315910adc1854";
};
#src = fetchurl {
# url = ftp://ftp.nluug.nl/pub/gnu/glibc/glibc-2.3.3.tar.bz2;
# md5 = "e825807b98042f807799ccc9dd96d31b";
#};
#linuxthreadsSrc = fetchurl {
# url = http://ftp.gnu.org/pub/gnu/glibc/glibc-linuxthreads-2.3.3.tar.bz2;
# md5 = "8149ea62922e75bd692bc3b92e5e766b";
#};
patches = [
patches = [ ./glibc-pwd.patch ];
#patches = [
# This patch fixes the bug
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=312. Note
# that this bug was marked as `WORKSFORME' with the comment to
@ -22,17 +28,17 @@ stdenv.mkDerivation {
# constitutes an AXIS OF EVIL wrt release management. Patch
# obtained from
# http://www.pengutronix.de/software/ptxdist/patches-cvs/glibc-2.3.2/generic/fixup.patch.
./fixup.patch
#./fixup.patch
# Likewise, this fixes the bug reported in
# http://sources.redhat.com/ml/libc-alpha/2003-07/msg00117.html.
# Die, glibc, die.
./no-unit-at-a-time.patch
#./no-unit-at-a-time.patch
# This is a patch to make glibc compile under GCC 3.3. Presumably
# later releases of glibc won't need this.
# ./glibc-2.3.2-sscanf-1.patch
];
# # ./glibc-2.3.2-sscanf-1.patch
#];
inherit kernelHeaders installLocales;
}

View File

@ -0,0 +1,74 @@
diff -ruN glibc-20050110/configure glibc-20050110.patched/configure
--- glibc-20050110/configure 2005-01-05 10:39:53.000000000 +0100
+++ glibc-20050110.patched/configure 2005-01-18 13:33:01.000000000 +0100
@@ -1393,7 +1393,7 @@
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
+if test "`cd $srcdir; @PWD@`" = "`@PWD@`"; then
{ { echo "$as_me:$LINENO: error: you must configure in a separate build directory" >&5
echo "$as_me: error: you must configure in a separate build directory" >&2;}
{ (exit 1); exit 1; }; }
diff -ruN glibc-20050110/io/ftwtest-sh glibc-20050110.patched/io/ftwtest-sh
--- glibc-20050110/io/ftwtest-sh 2004-02-09 21:12:23.000000000 +0100
+++ glibc-20050110.patched/io/ftwtest-sh 2005-01-18 13:33:15.000000000 +0100
@@ -120,7 +120,7 @@
sort > $testout
# perhaps $tmp involves some symlinks...
-tmpreal=`cd $tmp; /bin/pwd 2>/dev/null || /usr/bin/pwd`
+tmpreal=`cd $tmp; @PWD@ 2>/dev/null || /usr/bin/pwd`
cat <<EOF | cmp $testout - || exit 1
base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
@@ -138,7 +138,7 @@
EOF
rm $testout
-curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
sort > $testout
@@ -160,7 +160,7 @@
EOF
rm $testout
-curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
sort > $testout
@@ -182,7 +182,7 @@
EOF
rm $testout
-curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
cd "$tmp"
LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
sort > $testout
diff -ruN glibc-20050110/scripts/rellns-sh glibc-20050110.patched/scripts/rellns-sh
--- glibc-20050110/scripts/rellns-sh 1999-12-19 00:40:25.000000000 +0100
+++ glibc-20050110.patched/scripts/rellns-sh 2005-01-18 13:35:53.245937423 +0100
@@ -22,13 +22,13 @@
exit 1
fi
-if test -x /bin/pwd; then
- pwd=/bin/pwd
-elif test -x /usr/bin/pwd; then
- pwd=/usr/bin/pwd
-else
+#if test -x /bin/pwd; then
+# pwd=/bin/pwd
+#elif test -x /usr/bin/pwd; then
+# pwd=/usr/bin/pwd
+#else
pwd='pwd'
-fi
+#fi
# Make both paths absolute.
if test -d $1; then

View File

@ -17,53 +17,3 @@ diff -rc glibc-orig/csu/Makefile glibc-2.3.3/csu/Makefile
! CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions -fno-unit-at-a-time
vpath initfini.c $(full_config_sysdirs)
diff -rc glibc-orig/linuxthreads/Makefile glibc-2.3.3/linuxthreads/Makefile
*** glibc-orig/linuxthreads/Makefile 2003-10-02 20:48:48.000000000 +0200
--- glibc-2.3.3/linuxthreads/Makefile 2004-09-17 13:06:20.000000000 +0200
***************
*** 68,74 ****
vpath %.c Examples
tst-cancel-ARGS = "$(objpfx)"
! CFLAGS-tst-cancel.c = -fno-inline -fno-inline-functions
include ../Makeconfig
--- 68,74 ----
vpath %.c Examples
tst-cancel-ARGS = "$(objpfx)"
! CFLAGS-tst-cancel.c = -fno-inline -fno-inline-functions -fno-unit-at-a-time
include ../Makeconfig
***************
*** 101,107 ****
extra-objs += $(crti-objs) $(crtn-objs)
omit-deps += crti crtn
! CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions
endif
librt-tests = ex10 ex11
--- 101,107 ----
extra-objs += $(crti-objs) $(crtn-objs)
omit-deps += crti crtn
! CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-unit-at-a-time
endif
librt-tests = ex10 ex11
diff -rc glibc-orig/linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile glibc-2.3.3/linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile
*** glibc-orig/linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile 2003-04-12 01:34:02.000000000 +0200
--- glibc-2.3.3/linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile 2004-09-17 13:05:43.000000000 +0200
***************
*** 1,3 ****
ifeq ($(subdir),linuxthreads)
! CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables
endif
--- 1,3 ----
ifeq ($(subdir),linuxthreads)
! CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables -fno-unit-at-a-time
endif

View File

@ -0,0 +1,5 @@
FILES="configure io/ftwtest-sh"
for i in $FILES ; do
sed -e "s^@PWD@^pwd^g" < $i > $i.new
mv $i.new $i
done