diff --git a/pkgs/aterm/aterm-build.sh b/pkgs/aterm/aterm-build.sh index f92097b1d554..9ca15e18b1c5 100755 --- a/pkgs/aterm/aterm-build.sh +++ b/pkgs/aterm/aterm-build.sh @@ -1,9 +1,10 @@ #! /bin/sh -export PATH=/bin:/usr/bin +. $stdenv/setup || exit 1 tar xvfz $src || exit 1 cd aterm-* || exit 1 -LDFLAGS=-s ./configure --prefix=$out --with-gcc || exit 1 +./configure --prefix=$out || exit 1 make || exit 1 make install || exit 1 +(cd $out/lib && ln -s libATerm.a libATerm-gcc.a) || exit 1 diff --git a/pkgs/aterm/aterm.fix b/pkgs/aterm/aterm.fix index 7bb76b33ca65..a10e7579f428 100644 --- a/pkgs/aterm/aterm.fix +++ b/pkgs/aterm/aterm.fix @@ -1,9 +1,12 @@ Package( [ ("name", "aterm-2.0") , ("build", Relative("aterm/aterm-build.sh")) + , ("src", App(IncludeFix("fetchurl/fetchurl.fix"), [ ("url", "http://www.cwi.nl/projects/MetaEnv/aterm/aterm-2.0.tar.gz") , ("md5", "853474e4bcf4a85f7d38a0676b36bded") ])) + + , ("stdenv", IncludeFix("stdenv/stdenv.fix")) ] ) diff --git a/pkgs/glibc/glibc-build.sh b/pkgs/glibc/glibc-build.sh new file mode 100755 index 000000000000..79863998d249 --- /dev/null +++ b/pkgs/glibc/glibc-build.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +export PATH=/bin:/usr/bin + +tar xvfj $glibcSrc || exit 1 +(cd glibc-* && tar xvfj $linuxthreadsSrc) || exit 1 + +mkdir build || exit 1 +cd build || exit 1 +../glibc-*/configure --prefix=$out --enable-add-ons || exit 1 + +make || exit 1 +make install || exit 1 diff --git a/pkgs/glibc/glibc.fix b/pkgs/glibc/glibc.fix new file mode 100644 index 000000000000..7d26b9d3442a --- /dev/null +++ b/pkgs/glibc/glibc.fix @@ -0,0 +1,16 @@ +Package( + [ ("name", "glibc-2.3.2") + + , ("build", Relative("glibc/glibc-build.sh")) + + , ("glibcSrc", App(IncludeFix("fetchurl/fetchurl.fix"), + [ ("url", "ftp://ftp.nl.net/pub/gnu/glibc/glibc-2.3.2.tar.bz2") + , ("md5", "ede969aad568f48083e413384f20753c") + ])) + + , ("linuxthreadsSrc", App(IncludeFix("fetchurl/fetchurl.fix"), + [ ("url", "ftp://ftp.nl.net/pub/gnu/glibc/glibc-linuxthreads-2.3.2.tar.bz2") + , ("md5", "894b8969cfbdf787c73e139782167607") + ])) + ] +) diff --git a/pkgs/stdenv/gcc-wrapper.sh b/pkgs/stdenv/gcc-wrapper.sh new file mode 100644 index 000000000000..fdeefe8493cf --- /dev/null +++ b/pkgs/stdenv/gcc-wrapper.sh @@ -0,0 +1,18 @@ +#! /bin/sh + +realgcc=@GCC@ +libc=@LIBC@ + +justcompile=0 +for i in $*; do + if test "$i" == "-c"; then + justcompile=1 + fi +done + +extra="-isystem $libc/include" +if test "$justcompile" != "1"; then + extra="$extra -L $libc/lib -Wl,-dynamic-linker,$libc/lib/ld-linux.so.2,-rpath,$libc/lib" +fi + +exec $realgcc $* $extra diff --git a/pkgs/stdenv/stdenv-build.sh b/pkgs/stdenv/stdenv-build.sh new file mode 100755 index 000000000000..a266e1ff445d --- /dev/null +++ b/pkgs/stdenv/stdenv-build.sh @@ -0,0 +1,22 @@ +#! /bin/sh + +export PATH=/bin:/usr/bin + +mkdir $out || exit 1 +mkdir $out/bin || exit 1 + +echo "export PATH=$out/bin:/bin:/usr/bin" >> $out/setup || exit 1 + +gcc=/usr/bin/gcc + +sed \ + -e s^@GCC\@^$gcc^g \ + -e s^@LIBC\@^$glibc^g \ + < $gccwrapper > $out/bin/gcc || exit 1 +chmod +x $out/bin/gcc || exit 1 + +sed \ + -e s^@GCC\@^$g++^g \ + -e s^@LIBC\@^$glibc^g \ + < $gccwrapper > $out/bin/g++ || exit 1 +chmod +x $out/bin/g++ || exit 1 diff --git a/pkgs/stdenv/stdenv.fix b/pkgs/stdenv/stdenv.fix new file mode 100644 index 000000000000..375b7a01d84d --- /dev/null +++ b/pkgs/stdenv/stdenv.fix @@ -0,0 +1,9 @@ +Package( + [ ("name", "stdenv-linux") + , ("build", Relative("stdenv/stdenv-build.sh")) + + , ("gccwrapper", Relative("stdenv/gcc-wrapper.sh")) + + , ("glibc", IncludeFix("glibc/glibc.fix")) + ] +)