From 287edecf424304ef7536ca444d9d3118bd5fd880 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 5 Mar 2004 10:13:23 +0000 Subject: [PATCH] * Added gperf, texinfo, ncurses. * Started moving the gcc wrapper stuff out of stdenv. * Added octavefront and rna. svn path=/nixpkgs/trunk/; revision=814 --- pkgs/development/compilers/gcc-new/builder.sh | 64 ++++++++++++++++++ .../development/compilers/gcc-new/default.nix | 19 ++++++ .../compilers/gcc-wrapper/builder.sh | 65 +++++++++++++++++++ .../compilers/gcc-wrapper/default.nix | 17 +++++ pkgs/development/libraries/ncurses/builder.sh | 11 ++++ .../development/libraries/ncurses/default.nix | 12 ++++ pkgs/development/libraries/rna/builder.sh | 13 ++++ pkgs/development/libraries/rna/default.nix | 14 ++++ pkgs/development/tools/misc/gperf/builder.sh | 9 +++ pkgs/development/tools/misc/gperf/default.nix | 12 ++++ .../tools/misc/octavefront/builder.sh | 15 +++++ .../tools/misc/octavefront/default.nix | 19 ++++++ .../development/tools/misc/texinfo/builder.sh | 10 +++ .../tools/misc/texinfo/default.nix | 14 ++++ pkgs/system/all-packages-generic.nix | 30 +++++++++ 15 files changed, 324 insertions(+) create mode 100755 pkgs/development/compilers/gcc-new/builder.sh create mode 100644 pkgs/development/compilers/gcc-new/default.nix create mode 100755 pkgs/development/compilers/gcc-wrapper/builder.sh create mode 100644 pkgs/development/compilers/gcc-wrapper/default.nix create mode 100755 pkgs/development/libraries/ncurses/builder.sh create mode 100644 pkgs/development/libraries/ncurses/default.nix create mode 100755 pkgs/development/libraries/rna/builder.sh create mode 100644 pkgs/development/libraries/rna/default.nix create mode 100755 pkgs/development/tools/misc/gperf/builder.sh create mode 100644 pkgs/development/tools/misc/gperf/default.nix create mode 100755 pkgs/development/tools/misc/octavefront/builder.sh create mode 100644 pkgs/development/tools/misc/octavefront/default.nix create mode 100755 pkgs/development/tools/misc/texinfo/builder.sh create mode 100644 pkgs/development/tools/misc/texinfo/default.nix diff --git a/pkgs/development/compilers/gcc-new/builder.sh b/pkgs/development/compilers/gcc-new/builder.sh new file mode 100755 index 00000000000..de1b7e1b0a7 --- /dev/null +++ b/pkgs/development/compilers/gcc-new/builder.sh @@ -0,0 +1,64 @@ +#! /bin/sh -e + +buildinputs="$binutils" +. $stdenv/setup + +tar xvfj $src + +if test "$noSysDirs" == "1"; then + # Disable the standard include directories. + cd gcc-* + cat >> ./gcc/cppdefault.h < $mf.tmp + mv $mf.tmp $mf + + mf=gcc/Makefile + sed \ + -e "s^X_CFLAGS =\(.*\)^X_CFLAGS = \1 $extraflags^" \ + < $mf > $mf.tmp + 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 + mv $mf.tmp $mf +fi + +# Build and install. +make bootstrap +make install + +find $out -name "*.a" -exec strip -S {} \; diff --git a/pkgs/development/compilers/gcc-new/default.nix b/pkgs/development/compilers/gcc-new/default.nix new file mode 100644 index 00000000000..0d44cbe74b0 --- /dev/null +++ b/pkgs/development/compilers/gcc-new/default.nix @@ -0,0 +1,19 @@ +{ stdenv, fetchurl +, langC ? true, langCC ? true, langF77 ? false +}: + +assert langC; + +derivation { + name = "gcc-3.3.2"; + system = stdenv.system; + builder = ./builder.sh; + src = fetchurl { +# url = ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-3.3.3/gcc-3.3.3.tar.bz2; +# md5 = "3c6cfd9fcd180481063b4058cf6faff2"; + url = ftp://ftp.nluug.nl/pub/gnu/gcc/gcc-3.3.2/gcc-3.3.2.tar.bz2; + md5 = "65999f654102f5438ac8562d13a6eced"; + }; + noSysDirs = stdenv.noSysDirs; + inherit stdenv langC langCC langF77; +} diff --git a/pkgs/development/compilers/gcc-wrapper/builder.sh b/pkgs/development/compilers/gcc-wrapper/builder.sh new file mode 100755 index 00000000000..fda971e9462 --- /dev/null +++ b/pkgs/development/compilers/gcc-wrapper/builder.sh @@ -0,0 +1,65 @@ +#! /bin/sh -e + +. $stdenv/setup + +mkdir $out +mkdir $out/bin +for i in $(cd $gcc/bin && ls); do + cat > $out/bin/$i <&2 + for i in \${extra[@]}; do + echo " \$i" >&2 + done +fi + +IFS= + +exec $gcc/bin/$i \$@ \${extra[@]} +EOF + chmod +x $out/bin/$i +done + +echo $gcc > $out/orig-gcc +echo $glibc > $out/orig-glibc diff --git a/pkgs/development/compilers/gcc-wrapper/default.nix b/pkgs/development/compilers/gcc-wrapper/default.nix new file mode 100644 index 00000000000..33c82a6c2f7 --- /dev/null +++ b/pkgs/development/compilers/gcc-wrapper/default.nix @@ -0,0 +1,17 @@ +# The Nix `gcc' derivation is not directly usable, since it doesn't +# know where the C library and standard header files are. Therefore +# the compiler produced by that package cannot be installed directly +# in a user environment and used from the command line. This +# derivation provides a wrapper that sets up the right environment +# variables so that the compiler and the linker just "work". + +{stdenv, gcc}: + +derivation { + name = gcc.name; # maybe a bad idea + system = stdenv.system; + builder = ./builder.sh; + glibc = stdenv.param4; # !!! hack + inherit stdenv gcc; + inherit (gcc) langC langCC langF77; +} diff --git a/pkgs/development/libraries/ncurses/builder.sh b/pkgs/development/libraries/ncurses/builder.sh new file mode 100755 index 00000000000..3738256e5d0 --- /dev/null +++ b/pkgs/development/libraries/ncurses/builder.sh @@ -0,0 +1,11 @@ +#! /bin/sh -e + +buildinputs="" +. $stdenv/setup + +tar xvfz $src +cd ncurses-* +./configure --prefix=$out --with-shared +make +make install +strip -S $out/lib/*.a diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix new file mode 100644 index 00000000000..41eac6d2dd0 --- /dev/null +++ b/pkgs/development/libraries/ncurses/default.nix @@ -0,0 +1,12 @@ +{stdenv, fetchurl}: + +derivation { + name = "ncurses-5.4"; + system = stdenv.system; + builder = ./builder.sh; + src = fetchurl { + url = http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.4.tar.gz; + md5 = "069c8880072060373290a4fefff43520"; + }; + inherit stdenv; +} diff --git a/pkgs/development/libraries/rna/builder.sh b/pkgs/development/libraries/rna/builder.sh new file mode 100755 index 00000000000..34d34328666 --- /dev/null +++ b/pkgs/development/libraries/rna/builder.sh @@ -0,0 +1,13 @@ +#! /bin/sh -e + +buildinputs="$zlib" +. $stdenv/setup + +tar xvfz $src +cd rna-* +./configure --prefix=$out +make +make install +strip -S $out/lib/*.a + +echo "$zlib" > $out/propagated-build-inputs \ No newline at end of file diff --git a/pkgs/development/libraries/rna/default.nix b/pkgs/development/libraries/rna/default.nix new file mode 100644 index 00000000000..81319bcaff2 --- /dev/null +++ b/pkgs/development/libraries/rna/default.nix @@ -0,0 +1,14 @@ +{stdenv, fetchurl, zlib}: + +assert zlib != null; + +derivation { + name = "rna-0.14c"; + system = stdenv.system; + builder = ./builder.sh; + src = fetchurl { + url = ftp://ftp.radionetworkprocessor.com/pub/radionetworkprocessor/rna-0.14c.tar.gz; + md5 = "1e2947caf8a680e93cac55bffe2d6ec6"; + }; + inherit stdenv zlib; +} diff --git a/pkgs/development/tools/misc/gperf/builder.sh b/pkgs/development/tools/misc/gperf/builder.sh new file mode 100755 index 00000000000..8eee4233a94 --- /dev/null +++ b/pkgs/development/tools/misc/gperf/builder.sh @@ -0,0 +1,9 @@ +#! /bin/sh -e + +. $stdenv/setup + +tar xvfz $src +cd gperf-* +./configure --prefix=$out +make +make install diff --git a/pkgs/development/tools/misc/gperf/default.nix b/pkgs/development/tools/misc/gperf/default.nix new file mode 100644 index 00000000000..cc0f3e317d6 --- /dev/null +++ b/pkgs/development/tools/misc/gperf/default.nix @@ -0,0 +1,12 @@ +{stdenv, fetchurl}: + +derivation { + name = "gperf-2.7.2"; + system = stdenv.system; + builder = ./builder.sh; + src = fetchurl { + url = ftp://ftp.gnu.org/gnu/gperf/gperf-2.7.2.tar.gz; + md5 = "e501acc2e18eed2c8f25ca0ac2330d68"; + }; + inherit stdenv; +} diff --git a/pkgs/development/tools/misc/octavefront/builder.sh b/pkgs/development/tools/misc/octavefront/builder.sh new file mode 100755 index 00000000000..ccdd540cf45 --- /dev/null +++ b/pkgs/development/tools/misc/octavefront/builder.sh @@ -0,0 +1,15 @@ +#! /bin/sh -e + +buildinputs="$autoconf $g77 $texinfo $bison $flex $gperf $rna $aterm" +. $stdenv/setup + +g77orig=$(cat $g77/orig-gcc) +export NIX_LDFLAGS="-rpath $g77orig/lib $NIX_LDFLAGS" + +tar xvfz $src +cd octavefront-* +./autogen.sh +./configure --prefix=$out --disable-readline --enable-rna=$rna --enable-aterm +make +make install +strip -S $out/lib/*/*.a diff --git a/pkgs/development/tools/misc/octavefront/default.nix b/pkgs/development/tools/misc/octavefront/default.nix new file mode 100644 index 00000000000..7fdc5b93c72 --- /dev/null +++ b/pkgs/development/tools/misc/octavefront/default.nix @@ -0,0 +1,19 @@ +{ stdenv, fetchurl, autoconf, g77, texinfo, bison, flex, gperf +, rna, aterm +}: + +assert autoconf != null && texinfo != null + && bison != null && flex != null && gperf != null + && rna != null && aterm != null; +assert g77.langF77; + +derivation { + name = "octavefront-0.2"; + system = stdenv.system; + builder = ./builder.sh; + src = fetchurl { + url = ftp://ftp.radionetworkprocessor.com/pub/radionetworkprocessor/octavefront-0.2.tar.gz; + md5 = "14e02d060fd6afc6752dbba0a7445ff2"; + }; + inherit stdenv autoconf g77 texinfo bison flex gperf rna aterm; +} diff --git a/pkgs/development/tools/misc/texinfo/builder.sh b/pkgs/development/tools/misc/texinfo/builder.sh new file mode 100755 index 00000000000..81a30f02d8a --- /dev/null +++ b/pkgs/development/tools/misc/texinfo/builder.sh @@ -0,0 +1,10 @@ +#! /bin/sh -e + +buildinputs="$ncurses" +. $stdenv/setup + +tar xvfz $src +cd texinfo-* +./configure --prefix=$out +make +make install diff --git a/pkgs/development/tools/misc/texinfo/default.nix b/pkgs/development/tools/misc/texinfo/default.nix new file mode 100644 index 00000000000..960bb6107f8 --- /dev/null +++ b/pkgs/development/tools/misc/texinfo/default.nix @@ -0,0 +1,14 @@ +{stdenv, fetchurl, ncurses}: + +assert ncurses != null; + +derivation { + name = "texinfo-4.6"; + system = stdenv.system; + builder = ./builder.sh; + src = fetchurl { + url = ftp://ftp.gnu.org/gnu/texinfo/texinfo-4.6.tar.gz; + md5 = "5730c8c0c7484494cca7a7e2d7459c64"; + }; + inherit stdenv ncurses; +} diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix index 9aae5bb607f..fde797d1608 100644 --- a/pkgs/system/all-packages-generic.nix +++ b/pkgs/system/all-packages-generic.nix @@ -159,6 +159,19 @@ inherit fetchurl stdenv; }; + texinfo = (import ../development/tools/misc/texinfo) { + inherit fetchurl stdenv ncurses; + }; + + gperf = (import ../development/tools/misc/gperf) { + inherit fetchurl stdenv; + }; + + octavefront = (import ../development/tools/misc/octavefront) { + inherit fetchurl stdenv autoconf g77 texinfo flex gperf rna aterm; + bison = bisonnew; + }; + gnumake = (import ../development/tools/build-managers/gnumake) { inherit fetchurl stdenv; }; @@ -188,6 +201,15 @@ inherit fetchurl stdenv binutils; }; + g77 = (import ../development/compilers/gcc-wrapper) { + inherit stdenv; + gcc = (import ../development/compilers/gcc-new) { + inherit fetchurl stdenv; + langF77 = true; + langCC = false; + }; + }; + jikes = (import ../development/compilers/jikes) { inherit fetchurl stdenv; }; @@ -526,6 +548,14 @@ libpng = libpng; }; + ncurses = (import ../development/libraries/ncurses) { + inherit fetchurl stdenv; + }; + + rna = (import ../development/libraries/rna) { + inherit fetchurl stdenv zlib; + }; + perlBerkeleyDB = (import ../development/perl-modules/BerkeleyDB) { inherit fetchurl stdenv perl db4; };