diff --git a/pkgs-ng/archivers/gnutar/builder.sh b/pkgs-ng/archivers/gnutar/builder.sh new file mode 100755 index 000000000000..f79d158b86a5 --- /dev/null +++ b/pkgs-ng/archivers/gnutar/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfz $src || exit 1 +cd tar-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/archivers/gnutar/default.fix b/pkgs-ng/archivers/gnutar/default.fix new file mode 100644 index 000000000000..81aeda1cd9fd --- /dev/null +++ b/pkgs-ng/archivers/gnutar/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "gnutar-1.13.25" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://alpha.gnu.org/gnu/tar/tar-1.13.25.tar.gz + , md5 = "6ef8c906e81eee441f8335652670ac4a" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/compression/bzip2/builder.sh b/pkgs-ng/compression/bzip2/builder.sh new file mode 100755 index 000000000000..2fa113aa17a6 --- /dev/null +++ b/pkgs-ng/compression/bzip2/builder.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfz $src || exit 1 +cd bzip2-* || exit 1 +make || exit 1 +make install PREFIX=$out || exit 1 diff --git a/pkgs-ng/compression/bzip2/default.fix b/pkgs-ng/compression/bzip2/default.fix new file mode 100644 index 000000000000..f49e057f7074 --- /dev/null +++ b/pkgs-ng/compression/bzip2/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "bzip2-1.0.2" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://sources.redhat.com/pub/bzip2/v102/bzip2-1.0.2.tar.gz + , md5 = "ee76864958d568677f03db8afad92beb" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/compression/gzip/builder.sh b/pkgs-ng/compression/gzip/builder.sh new file mode 100755 index 000000000000..0254e252958a --- /dev/null +++ b/pkgs-ng/compression/gzip/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfz $src || exit 1 +cd gzip-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/compression/gzip/default.fix b/pkgs-ng/compression/gzip/default.fix new file mode 100644 index 000000000000..c0b267f55d4c --- /dev/null +++ b/pkgs-ng/compression/gzip/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "gzip-1.3.3" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = http://www.gzip.org/gzip-1.3.3.tar.gz + , md5 = "52eaf713673507d21f7abefee98ba662" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/devel/compilers/gcc/builder.sh b/pkgs-ng/devel/compilers/gcc/builder.sh new file mode 100755 index 000000000000..15746b264399 --- /dev/null +++ b/pkgs-ng/devel/compilers/gcc/builder.sh @@ -0,0 +1,56 @@ +#! /bin/sh + +buildinputs="$binutils" +. $stdenv/setup || exit 1 + +tar xvfj $src || exit 1 + +if test "$noSysDirs" == "1"; then + # Disable the standard include directories. + cd gcc-* || exit 1 + cat >> ./gcc/cppdefault.h < $mf.tmp || exit 1 + mv $mf.tmp $mf + + mf=gcc/Makefile + sed \ + -e "s^X_CFLAGS =\(.*\)^X_CFLAGS = \1 $extraflags^" \ + < $mf > $mf.tmp || exit 1 + mv $mf.tmp $mf + + # Patch gcc/Makefile to prevent fixinc.sh from "fixing" system header files + # from /usr/include. + mf=gcc/Makefile + sed \ + -e "s^NATIVE_SYSTEM_HEADER_DIR =\(.*\)^NATIVE_SYSTEM_HEADER_DIR = /fixinc-disabled^" \ + < $mf > $mf.tmp || exit 1 + mv $mf.tmp $mf +fi + +# Build and install. +make bootstrap || exit 1 +make install || exit 1 + +find $out -name "*.a" -exec strip -S {} \; || exit 1 diff --git a/pkgs-ng/devel/compilers/gcc/default.fix b/pkgs-ng/devel/compilers/gcc/default.fix new file mode 100644 index 000000000000..dfc503e15dbf --- /dev/null +++ b/pkgs-ng/devel/compilers/gcc/default.fix @@ -0,0 +1,12 @@ +{stdenv, fetchurl, binutils}: derivation + { name = "gcc-3.3.2" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-3.3.2/gcc-3.3.2.tar.bz2 + , md5 = "65999f654102f5438ac8562d13a6eced" + } + , stdenv = stdenv + , binutils = binutils + , noSysDirs = stdenv.noSysDirs + } diff --git a/pkgs-ng/devel/libs/pcre/builder.sh b/pkgs-ng/devel/libs/pcre/builder.sh new file mode 100755 index 000000000000..dea883667fcc --- /dev/null +++ b/pkgs-ng/devel/libs/pcre/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfj $src || exit 1 +cd pcre-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/devel/libs/pcre/default.fix b/pkgs-ng/devel/libs/pcre/default.fix new file mode 100644 index 000000000000..76a06fe7f2c5 --- /dev/null +++ b/pkgs-ng/devel/libs/pcre/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "pcre-4.3" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-4.3.tar.bz2 + , md5 = "7bc7d5b590a41e6f9ede30f272002a02" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/devel/tools/binutils/builder.sh b/pkgs-ng/devel/tools/binutils/builder.sh new file mode 100755 index 000000000000..7782ea089889 --- /dev/null +++ b/pkgs-ng/devel/tools/binutils/builder.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfj $src || exit 1 +cd binutils-* || exit 1 + +# Clear the default library search path. +if test "$noSysDirs" == "1"; then + echo 'NATIVE_LIB_DIRS=' >> ld/configure.tgt || exit 1 +fi + +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 + +strip -S $out/lib/*.a || exit 1 diff --git a/pkgs-ng/devel/tools/binutils/default.fix b/pkgs-ng/devel/tools/binutils/default.fix new file mode 100644 index 000000000000..8a4bc4a47bac --- /dev/null +++ b/pkgs-ng/devel/tools/binutils/default.fix @@ -0,0 +1,11 @@ +{stdenv, fetchurl}: derivation + { name = "binutils-2.14" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.nluug.nl/pub/gnu/binutils/binutils-2.14.tar.bz2 + , md5 = "2da8def15d28af3ec6af0982709ae90a" + } + , stdenv = stdenv + , noSysDirs = stdenv.noSysDirs + } diff --git a/pkgs-ng/devel/tools/gnumake/builder.sh b/pkgs-ng/devel/tools/gnumake/builder.sh new file mode 100755 index 000000000000..362de7cd9a88 --- /dev/null +++ b/pkgs-ng/devel/tools/gnumake/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfj $src || exit 1 +cd make-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/devel/tools/gnumake/default.fix b/pkgs-ng/devel/tools/gnumake/default.fix new file mode 100644 index 000000000000..00624e761498 --- /dev/null +++ b/pkgs-ng/devel/tools/gnumake/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "gnumake-3.80" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.nluug.nl/pub/gnu/make/make-3.80.tar.bz2 + , md5 = "0bbd1df101bc0294d440471e50feca71" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/fetchurl/builder.sh b/pkgs-ng/fetchurl/builder.sh new file mode 100644 index 000000000000..4560017220f9 --- /dev/null +++ b/pkgs-ng/fetchurl/builder.sh @@ -0,0 +1,21 @@ +#! /bin/sh + +. $stdenv/setup + +echo "downloading $url into $out..." + +#prefetch=@prefix@/store/nix-prefetch-url-$md5 +prefetch=/nix/store/nix-prefetch-url-$md5 +if test -f "$prefetch"; then + echo "using prefetched $prefetch"; + mv $prefetch $out || exit 1 +else + wget --passive-ftp "$url" -O "$out" || exit 1 +fi + +#actual=$(@bindir@/nix-hash --flat $out) +actual=$(/nix/bin/nix-hash --flat $out) +if test "$actual" != "$md5"; then + echo "hash is $actual, expected $md5" + exit 1 +fi diff --git a/pkgs-ng/fetchurl/default.fix b/pkgs-ng/fetchurl/default.fix index 5354ece885d7..ee5564057f3d 100644 --- a/pkgs-ng/fetchurl/default.fix +++ b/pkgs-ng/fetchurl/default.fix @@ -1,8 +1,9 @@ {stdenv}: {url, md5}: derivation - { name = "fetchurl" + { name = baseNameOf (toString url) , system = stdenv.system , builder = ./builder.sh , stdenv = stdenv , url = url , md5 = md5 + , id = md5 } diff --git a/pkgs-ng/shells/bash/builder.sh b/pkgs-ng/shells/bash/builder.sh new file mode 100755 index 000000000000..7b0d093c5760 --- /dev/null +++ b/pkgs-ng/shells/bash/builder.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfz $src || exit 1 +cd bash-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 +(cd $out/bin; ln -s bash sh) || exit 1 diff --git a/pkgs-ng/shells/bash/default.fix b/pkgs-ng/shells/bash/default.fix new file mode 100644 index 000000000000..0d2c5d55e6d8 --- /dev/null +++ b/pkgs-ng/shells/bash/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "bash-2.05b" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.nluug.nl/pub/gnu/bash/bash-2.05b.tar.gz + , md5 = "5238251b4926d778dfe162f6ce729733" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/stdenv/builder.sh b/pkgs-ng/stdenv/builder.sh deleted file mode 100755 index 363067568b62..000000000000 --- a/pkgs-ng/stdenv/builder.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh - -echo BAR -exit 1 \ No newline at end of file diff --git a/pkgs-ng/stdenv/default.fix b/pkgs-ng/stdenv/default.fix deleted file mode 100644 index b46eeee80291..000000000000 --- a/pkgs-ng/stdenv/default.fix +++ /dev/null @@ -1,5 +0,0 @@ -{system}: derivation - { name = "stdenv" - , system = system - , builder = ./builder.sh - } diff --git a/pkgs-ng/stdenv/generic/builder.sh b/pkgs-ng/stdenv/generic/builder.sh new file mode 100755 index 000000000000..ad788118492c --- /dev/null +++ b/pkgs-ng/stdenv/generic/builder.sh @@ -0,0 +1,41 @@ +#! /bin/sh + +# Set up the initial path. +for i in $initialPath; do + PATH=$PATH:$i/bin +done + +# Make output directories. +mkdir $out || exit 1 +mkdir $out/bin || exit 1 + +# Create the setup script. +sed \ + -e "s^@OUT@^$out^g" \ + -e "s^@PREHOOK@^$prehook^g" \ + -e "s^@POSTHOOK@^$posthook^g" \ + -e "s^@INITIALPATH@^$initialPath^g" \ + -e "s^@PARAM1@^$param1^g" \ + -e "s^@PARAM2@^$param2^g" \ + -e "s^@PARAM3@^$param3^g" \ + -e "s^@PARAM4@^$param4^g" \ + -e "s^@PARAM5@^$param5^g" \ + < $setup > $out/setup || exit 1 + +# Create the gcc wrapper. +sed \ + -e 's^@GCC\@^$NIX_CC^g' \ + < $gccwrapper > $out/bin/gcc || exit 1 +chmod +x $out/bin/gcc || exit 1 +ln -s gcc $out/bin/cc || exit 1 + +# Create the g++ wrapper. +sed \ + -e 's^@GCC\@^$NIX_CXX^g' \ + < $gccwrapper > $out/bin/g++ || exit 1 +chmod +x $out/bin/g++ || exit 1 +ln -s g++ $out/bin/c++ || exit 1 + +# Create the ld wrapper. +cp $ldwrapper $out/bin/ld || exit 1 +chmod +x $out/bin/ld || exit 1 diff --git a/pkgs-ng/stdenv/generic/default.fix b/pkgs-ng/stdenv/generic/default.fix new file mode 100644 index 000000000000..e3e917ea02df --- /dev/null +++ b/pkgs-ng/stdenv/generic/default.fix @@ -0,0 +1,22 @@ +{system, name, noSysDirs, prehook, posthook, initialPath, + param1, param2, param3, param4, param5}: derivation + { name = name + , system = system + , builder = ./builder.sh + , noSysDirs = noSysDirs + + , setup = ./setup.sh + , gccwrapper = ./gcc-wrapper.sh + , ldwrapper = ./ld-wrapper.sh + + , prehook = prehook + , posthook = posthook + + , initialPath = initialPath + # TODO: make this more elegant. + , param1 = param1 + , param2 = param2 + , param3 = param3 + , param4 = param4 + , param5 = param5 + } diff --git a/pkgs-ng/stdenv/generic/gcc-wrapper.sh b/pkgs-ng/stdenv/generic/gcc-wrapper.sh new file mode 100644 index 000000000000..f743c96ec2f0 --- /dev/null +++ b/pkgs-ng/stdenv/generic/gcc-wrapper.sh @@ -0,0 +1,42 @@ +#! /bin/sh + +IFS= + +justcompile=0 +for i in $@; do + if test "$i" == "-c"; then + justcompile=1 + elif test "$i" == "-S"; then + justcompile=1 + elif test "$i" == "-E"; then + justcompile=1 + elif test "$i" == "-E"; then + justcompile=1 + elif test "$i" == "-M"; then + justcompile=1 + elif test "$i" == "-MM"; then + justcompile=1 + fi +done + +IFS=" " +extra=($NIX_CFLAGS_COMPILE) +if test "$justcompile" != "1"; then + extra=(${extra[@]} $NIX_CFLAGS_LINK) + for i in $NIX_LDFLAGS; do + extra=(${extra[@]} "-Wl,$i") + done + if test "$NIX_STRIP_DEBUG" == "1"; then + extra=(${extra[@]} -g0 -Wl,-s) + fi +fi + +if test "$NIX_DEBUG" == "1"; then + echo "extra flags to @GCC@:" >&2 + for i in ${extra[@]}; do + echo " $i" >&2 + done +fi + +IFS= +exec @GCC@ $@ ${extra[@]} diff --git a/pkgs-ng/stdenv/generic/ld-wrapper.sh b/pkgs-ng/stdenv/generic/ld-wrapper.sh new file mode 100644 index 000000000000..e6a2fe74c5e8 --- /dev/null +++ b/pkgs-ng/stdenv/generic/ld-wrapper.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +IFS=" " +extra=($NIX_CFLAGS_LINK $NIX_LDFLAGS) +if test "$NIX_STRIP_DEBUG" == "1"; then + extra=(${extra[@]} -s) +fi + +if test "$NIX_DEBUG" == "1"; then + echo "extra flags to @LD@:" >&2 + for i in ${extra[@]}; do + echo " $i" >&2 + done +fi + +IFS= +exec $NIX_LD $@ ${extra[@]} diff --git a/pkgs-ng/stdenv/generic/setup.sh b/pkgs-ng/stdenv/generic/setup.sh new file mode 100644 index 000000000000..a3dc8aea11d5 --- /dev/null +++ b/pkgs-ng/stdenv/generic/setup.sh @@ -0,0 +1,65 @@ +# Set up the initial path. +for i in @INITIALPATH@; do + PATH=$PATH:$i/bin +done +echo $PATH + +# Execute the pre-hook. +param1=@PARAM1@ +param2=@PARAM2@ +param3=@PARAM3@ +param4=@PARAM4@ +param5=@PARAM5@ +. @PREHOOK@ + +# Add the directory containing the GCC wrappers to the PATH. +export PATH=@OUT@/bin:$PATH + +# Recursively add all buildinputs to the relevant environment variables. +addtoenv() +{ + pkgs="$buildinputs $1" + + if test -d $1/bin; then + export PATH=$1/bin:$PATH + fi + + if test -d $1/lib; then + export NIX_CFLAGS_LINK="-L$1/lib $NIX_CFLAGS_LINK" + export NIX_LDFLAGS="-rpath $1/lib $NIX_LDFLAGS" + fi + + if test -d $1/lib/pkgconfig; then + export PKG_CONFIG_PATH=$1/lib/pkgconfig:$PKG_CONFIG_PATH + fi + + if test -d $1/include; then + export NIX_CFLAGS_COMPILE="-I$1/include $NIX_CFLAGS_COMPILE" + fi + + if test -f $1/propagated-build-inputs; then + for i in $(cat $1/propagated-build-inputs); do + addtoenv $i + done + fi +} + +oldbuildinputs=$buildinputs +buildinputs= + +for i in $oldbuildinputs; do + addtoenv $i +done + +# Add the output as an rpath. +export NIX_LDFLAGS="-rpath $out/lib $NIX_LDFLAGS" + +# Strip debug information by default. +export NIX_STRIP_DEBUG=1 + +# Execute the post-hook. +. @POSTHOOK@ + +if test "$NIX_DEBUG" == "1"; then + echo "Setup: PATH=$PATH" +fi diff --git a/pkgs-ng/stdenv/native/default.fix b/pkgs-ng/stdenv/native/default.fix new file mode 100644 index 000000000000..b2492296e4ba --- /dev/null +++ b/pkgs-ng/stdenv/native/default.fix @@ -0,0 +1,13 @@ +{system}: (import ../generic) + { name = "stdenv-native" + , system = system + , prehook = ./prehook.sh + , posthook = ./posthook.sh + , initialPath = "/usr/local /usr /" + , param1 = "" + , param2 = "" + , param3 = "" + , param4 = "" + , param5 = "" + , noSysDirs = false + } diff --git a/pkgs-ng/stdenv/native/posthook.sh b/pkgs-ng/stdenv/native/posthook.sh new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs-ng/stdenv/native/prehook.sh b/pkgs-ng/stdenv/native/prehook.sh new file mode 100644 index 000000000000..72e9c1748702 --- /dev/null +++ b/pkgs-ng/stdenv/native/prehook.sh @@ -0,0 +1,5 @@ +export SHELL=/bin/sh + +export NIX_CC=/usr/bin/gcc +export NIX_CXX=/usr/bin/g++ +export NIX_LD=/usr/bin/ld diff --git a/pkgs-ng/stdenv/nix/default.fix b/pkgs-ng/stdenv/nix/default.fix new file mode 100644 index 000000000000..cb7768f2407e --- /dev/null +++ b/pkgs-ng/stdenv/nix/default.fix @@ -0,0 +1,23 @@ +{bootStdenv, pkgs}: (import ../generic) + { name = "stdenv-nix" + , system = bootStdenv.system + , prehook = ./prehook.sh + , posthook = ./posthook.sh + , initialPath = + [ pkgs.coreutils + , pkgs.findutils + , pkgs.gnused + , pkgs.gnugrep + , pkgs.gnutar + , pkgs.gzip + , pkgs.binutils + , pkgs.gnumake + , pkgs.gcc + ] + , param1 = pkgs.bash + , param2 = pkgs.gcc + , param3 = pkgs.binutils + , param4 = "" + , param5 = "" + , noSysDirs = false + } diff --git a/pkgs-ng/stdenv/nix/posthook.sh b/pkgs-ng/stdenv/nix/posthook.sh new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs-ng/stdenv/nix/prehook.sh b/pkgs-ng/stdenv/nix/prehook.sh new file mode 100644 index 000000000000..e6052113f168 --- /dev/null +++ b/pkgs-ng/stdenv/nix/prehook.sh @@ -0,0 +1,7 @@ +export SHELL=$param1 + +echo "SHELL = $SHELL" + +export NIX_CC=$param2/bin/gcc +export NIX_CXX=$param2/bin/g++ +export NIX_LD=$param3/bin/ld diff --git a/pkgs-ng/sys-utils/coreutils/builder.sh b/pkgs-ng/sys-utils/coreutils/builder.sh new file mode 100755 index 000000000000..753086391082 --- /dev/null +++ b/pkgs-ng/sys-utils/coreutils/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfj $src || exit 1 +cd coreutils-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/sys-utils/coreutils/default.fix b/pkgs-ng/sys-utils/coreutils/default.fix new file mode 100644 index 000000000000..c89ffa251cf5 --- /dev/null +++ b/pkgs-ng/sys-utils/coreutils/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "coreutils-5.0" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.nluug.nl/pub/gnu/coreutils/coreutils-5.0.tar.bz2 + , md5 = "94e5558ee2a65723d4840bfde2d323f0" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/sys-utils/findutils/builder.sh b/pkgs-ng/sys-utils/findutils/builder.sh new file mode 100755 index 000000000000..f61ec740c1b8 --- /dev/null +++ b/pkgs-ng/sys-utils/findutils/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfz $src || exit 1 +cd findutils-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/sys-utils/findutils/default.fix b/pkgs-ng/sys-utils/findutils/default.fix new file mode 100644 index 000000000000..f8995bb14584 --- /dev/null +++ b/pkgs-ng/sys-utils/findutils/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "findutils-4.1.20" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://alpha.gnu.org/pub/gnu/findutils/findutils-4.1.20.tar.gz + , md5 = "e90ce7222daadeb8616b8db461e17cbc" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/sys-utils/gnugrep/builder.sh b/pkgs-ng/sys-utils/gnugrep/builder.sh new file mode 100755 index 000000000000..3453b5b0cb87 --- /dev/null +++ b/pkgs-ng/sys-utils/gnugrep/builder.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +buildinputs="$pcre" +. $stdenv/setup || exit 1 + +tar xvfj $src || exit 1 +cd grep-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/sys-utils/gnugrep/default.fix b/pkgs-ng/sys-utils/gnugrep/default.fix new file mode 100644 index 000000000000..3b018601227c --- /dev/null +++ b/pkgs-ng/sys-utils/gnugrep/default.fix @@ -0,0 +1,11 @@ +{stdenv, fetchurl, pcre}: derivation + { name = "gnugrep-2.5.1" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.nluug.nl/pub/gnu/grep/grep-2.5.1.tar.bz2 + , md5 = "ddd99e2d5d4f4611357e31e97f080cf2" + } + , stdenv = stdenv + , pcre = pcre + } diff --git a/pkgs-ng/sys-utils/gnused/builder.sh b/pkgs-ng/sys-utils/gnused/builder.sh new file mode 100755 index 000000000000..126635327925 --- /dev/null +++ b/pkgs-ng/sys-utils/gnused/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. $stdenv/setup || exit 1 + +tar xvfz $src || exit 1 +cd sed-* || exit 1 +./configure --prefix=$out || exit 1 +make || exit 1 +make install || exit 1 diff --git a/pkgs-ng/sys-utils/gnused/default.fix b/pkgs-ng/sys-utils/gnused/default.fix new file mode 100644 index 000000000000..b2ccc3401297 --- /dev/null +++ b/pkgs-ng/sys-utils/gnused/default.fix @@ -0,0 +1,10 @@ +{stdenv, fetchurl}: derivation + { name = "gnused-4.0.7" + , system = stdenv.system + , builder = ./builder.sh + , src = fetchurl + { url = ftp://ftp.nluug.nl/pub/gnu/sed/sed-4.0.7.tar.gz + , md5 = "005738e7f97bd77d95b6907156c8202a" + } + , stdenv = stdenv + } diff --git a/pkgs-ng/system/all-packages-generic.fix b/pkgs-ng/system/all-packages-generic.fix new file mode 100644 index 000000000000..7b013c6c684c --- /dev/null +++ b/pkgs-ng/system/all-packages-generic.fix @@ -0,0 +1,82 @@ +# This file evaluates to a function that, when supplied with a system +# identifier and a standard build environment, returns the set of all +# packages provided by the Nix Package Collection. + +{system, stdenv}: rec + { fetchurl = (import ../fetchurl) + { stdenv = stdenv + } + + # sys-utils/coreutils + , coreutils = (import ../sys-utils/coreutils) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # sys-utils/findutils + , findutils = (import ../sys-utils/findutils) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # sys-utils/gnused + , gnused = (import ../sys-utils/gnused) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # sys-utils/gnugrep + , gnugrep = (import ../sys-utils/gnugrep) + { fetchurl = fetchurl + , stdenv = stdenv + , pcre = pcre + } + + # archivers/gnutar + , gnutar = (import ../archivers/gnutar) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # compression/gzip + , gzip = (import ../compression/gzip) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # shells/bash + , bash = (import ../shells/bash) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # devel/tools/binutils + , binutils = (import ../devel/tools/binutils) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # devel/tools/gnumake + , gnumake = (import ../devel/tools/gnumake) + { fetchurl = fetchurl + , stdenv = stdenv + } + + # devel/compilers/gcc + , gcc = (import ../devel/compilers/gcc) + { fetchurl = fetchurl + , stdenv = stdenv + , binutils = binutils + } + + # devel/libs/pcre + , pcre = (import ../devel/libs/pcre) + { fetchurl = fetchurl + , stdenv = stdenv + } + + , aterm = (import ../aterm) + { fetchurl = fetchurl + , stdenv = stdenv + } + } diff --git a/pkgs-ng/system/all-packages.fix b/pkgs-ng/system/all-packages.fix index ec27319bb6fe..e38549bb01f0 100644 --- a/pkgs-ng/system/all-packages.fix +++ b/pkgs-ng/system/all-packages.fix @@ -1,14 +1,41 @@ -{system}: rec - { stdenv = (import ../stdenv) - { system = system +# This file evaluates to a function that, when supplied with a system +# identifier, returns the set of all packages provided by the Nix +# Package Collection. It does this by supplying +# `all-packages-generic.fix' with a standard build environment. +# +# On Linux systems, the standard build environment consists of +# Nix-built instances glibc and the `standard' Unix tools, i.e., the +# Posix utilities, the GNU C compiler, and so on. On other systems, +# we use the native C library. + +{system}: let + { allPackages = import ./all-packages-generic.fix + + # The native (i.e., impure) build environment. This one uses the + # tools installed on the system outside of the Nix environment, + # i.e., the stuff in /bin, /usr/bin, etc. This environment should + # be used with care, since many Nix packages will not build properly + # with it (e.g., because they require GNU Make). + , stdenvNative = (import ../stdenv/native) {system = system} + + # The Nix build environment. + , stdenvNixPkgs = allPackages {system = system, stdenv = stdenvNative} + , stdenvNix = (import ../stdenv/nix) + { bootStdenv = stdenvNative + , pkgs = stdenvNixPkgs } - , fetchurl = (import ../fetchurl) - { stdenv = stdenv - } + # The Linux build environment consists of the Nix build environment + # built against the GNU C Library. + , stdenvLinux = (import ../stdenv/nix-linux) {baseStdenv = stdenvNix} - , aterm = (import ../aterm) - { fetchurl = fetchurl - , stdenv = stdenv - } - } \ No newline at end of file + # Select the right one. + , stdenv = + if system == "i686-suse-linux" + then stdenvNix + else stdenvNix + + # Instantiate. + , body = allPackages {system = system, stdenv = stdenv} + + } diff --git a/pkgs-ng/system/user-environment.fix b/pkgs-ng/system/user-environment.fix index 6bc6ef25bcee..5a46ed6f111a 100644 --- a/pkgs-ng/system/user-environment.fix +++ b/pkgs-ng/system/user-environment.fix @@ -5,4 +5,4 @@ , pkgs = [ ((import ./all-packages.fix) {system = system}).aterm ] - } \ No newline at end of file + }