summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2004-09-18 17:23:18 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2004-09-18 17:23:18 +0000
commit1ab4a9324cf8d7a49027eedbc176926f7325cf7a (patch)
treef24b4aedb92b45bc93e22aea08bc0029ce8642a2 /pkgs
parente31d1dd9604033e0d5af6230e41c2a52d53e9a41 (diff)
downloadnixpkgs-1ab4a9324cf8d7a49027eedbc176926f7325cf7a.tar
nixpkgs-1ab4a9324cf8d7a49027eedbc176926f7325cf7a.tar.gz
nixpkgs-1ab4a9324cf8d7a49027eedbc176926f7325cf7a.tar.bz2
nixpkgs-1ab4a9324cf8d7a49027eedbc176926f7325cf7a.tar.lz
nixpkgs-1ab4a9324cf8d7a49027eedbc176926f7325cf7a.tar.xz
nixpkgs-1ab4a9324cf8d7a49027eedbc176926f7325cf7a.tar.zst
nixpkgs-1ab4a9324cf8d7a49027eedbc176926f7325cf7a.zip
* The `patch' command is now part of stdenv, so it no longer needs to
  be passed to derivations that need to apply patches.
* GCC 3.4 is now the default compiler (old GCC renamed to `gcc-3.3').
* The temporary GCCs built during the stdenvLinux bootstrap are now
  built without C++ support and without profiling.
* Remove fixincl in GCC 3.4 to prevent a retained dependency on the
  previous GCC.
* Always set $prefix in setup.sh, even when there is no configure
  script.

svn path=/nixpkgs/trunk/; revision=1444
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/BUGS23
-rw-r--r--pkgs/TODO4
-rw-r--r--pkgs/development/compilers/gcc-2.95/default.nix3
-rw-r--r--pkgs/development/compilers/gcc-3.3/builder.sh (renamed from pkgs/development/compilers/gcc/builder.sh)0
-rw-r--r--pkgs/development/compilers/gcc-3.3/default.nix (renamed from pkgs/development/compilers/gcc/default.nix)0
-rw-r--r--pkgs/development/compilers/gcc-3.4/builder.sh4
-rw-r--r--pkgs/development/compilers/gcc-3.4/default.nix3
-rw-r--r--pkgs/development/tools/build-managers/gnumake/default.nix3
-rw-r--r--pkgs/stdenv/generic/builder.sh (renamed from pkgs/stdenv/generic-branch/builder.sh)0
-rw-r--r--pkgs/stdenv/generic/default-builder.sh (renamed from pkgs/stdenv/generic-branch/default-builder.sh)0
-rw-r--r--pkgs/stdenv/generic/default.nix (renamed from pkgs/stdenv/generic-branch/default.nix)0
-rw-r--r--pkgs/stdenv/generic/docs.txt (renamed from pkgs/stdenv/generic-branch/docs.txt)0
-rw-r--r--pkgs/stdenv/generic/setup.sh (renamed from pkgs/stdenv/generic-branch/setup.sh)16
-rw-r--r--pkgs/system/all-packages-generic.nix36
-rw-r--r--pkgs/system/stdenvs.nix52
15 files changed, 65 insertions, 79 deletions
diff --git a/pkgs/BUGS b/pkgs/BUGS
index a071583b252..f6d40bc6947 100644
--- a/pkgs/BUGS
+++ b/pkgs/BUGS
@@ -14,22 +14,6 @@
     ...
 
 
-* Subtle problems can occur if the Nix store directory or one of its
-  parents is a symlink.  E.g., purity checks can barf:
-
-    impure path `/data/nix/store/099cd9aee7d056a9922fd6dd116a3f5c-gcc-3.3.3/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.3.3/crtbegin.o' used in link
-
-  (This happened because /nix was a symlink to /data/nix.)  Maybe we
-  should disallow this entirely, since, exactly because it is
-  perfectly legal for a builder to expand a symlink, we can end up
-  with derivates referring to paths that existed in the build
-  environment but not in the target environment.
-
-  Disallowing this can be highly inconvenient, since it makes it
-  harder to move the Nix store to a different file system.  (On Linux,
-  `bind' mounts can help here.) 
-
-
 * In libXt:
 
 /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.     -DXTHREADS -DXUSE_MTSAFE_API -I/nix/store/aadf0bd4a908da11d14f6538503b8408-libX11-6.2.1/include -I/nix/store/ba366e3b944ead64ec9b0490bb615874-xproto-6.6.1/include   -I./include/X11 -g -O2 -c -o ActionHook.lo `test -f 'ActionHook.c' || echo './'`ActionHook.c
@@ -69,4 +53,9 @@ stdenv.mkDerivation {
 * Add "exit 0" at the end of configure of rte package.
 
 
-* In stdenv/nix/path.nix: remove gcc.
+* Starting at gcc 3.4, all C programs incur a retained dependency on
+  gcc through the rpath stored in the executable, even though the
+  executable doesn't use against any library in gcc.  The reason is
+  that the gcc passes a `-lgcc_s' switch to the linker.  Solution:
+  patch the linker so that rpaths are only added for libraries that we
+  actually use.
\ No newline at end of file
diff --git a/pkgs/TODO b/pkgs/TODO
index 1891fe9e2b0..73c442d7888 100644
--- a/pkgs/TODO
+++ b/pkgs/TODO
@@ -11,10 +11,6 @@
 * After building gcc, filter out references to /tmp/nix... in
   .../lib/libsupc++.la and .../lib/libstdc++.la
 
-* diffutils retains a dependency on coreutils/bin/pr; causes stdenv to
-  depend on 2 copies of coreutils (the first one impure in
-  stdenv-nix-linux!)
-
 
 
 * change dontMake & dontMakeInstall into dontBuild and dontInstall in
diff --git a/pkgs/development/compilers/gcc-2.95/default.nix b/pkgs/development/compilers/gcc-2.95/default.nix
index 698bea7950f..c95a9027758 100644
--- a/pkgs/development/compilers/gcc-2.95/default.nix
+++ b/pkgs/development/compilers/gcc-2.95/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, patch, noSysDirs
+{ stdenv, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langF77 ? false
 }:
 
@@ -13,6 +13,5 @@ stdenv.mkDerivation {
   };
   # !!! apply only if noSysDirs is set
   patches = [./no-sys-dirs.patch];
-  buildInputs = [patch];
   inherit noSysDirs langC langCC langF77;
 }
diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc-3.3/builder.sh
index 22d1e38707a..22d1e38707a 100644
--- a/pkgs/development/compilers/gcc/builder.sh
+++ b/pkgs/development/compilers/gcc-3.3/builder.sh
diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc-3.3/default.nix
index 46b6a2d863e..46b6a2d863e 100644
--- a/pkgs/development/compilers/gcc/default.nix
+++ b/pkgs/development/compilers/gcc-3.3/default.nix
diff --git a/pkgs/development/compilers/gcc-3.4/builder.sh b/pkgs/development/compilers/gcc-3.4/builder.sh
index 2d425eabc73..60af74ed765 100644
--- a/pkgs/development/compilers/gcc-3.4/builder.sh
+++ b/pkgs/development/compilers/gcc-3.4/builder.sh
@@ -71,6 +71,10 @@ postInstall() {
     # Remove precompiled headers for now.  They are very big and
     # probably not very useful yet.
     find $out/include -name "*.gch" -exec rm -rf {} \; -prune
+
+    # Remove `fixincl' to prevent a retained dependency on the
+    # previous gcc.
+    rm -rf $out/libexec/gcc/*/*/install-tools
 }
 
 
diff --git a/pkgs/development/compilers/gcc-3.4/default.nix b/pkgs/development/compilers/gcc-3.4/default.nix
index c29a9502854..b766c972344 100644
--- a/pkgs/development/compilers/gcc-3.4/default.nix
+++ b/pkgs/development/compilers/gcc-3.4/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, patch, noSysDirs
+{ stdenv, fetchurl, noSysDirs
 , langC ? true, langCC ? true, langF77 ? false
 , profiledCompiler ? false
 }:
@@ -14,6 +14,5 @@ stdenv.mkDerivation {
   };
   # !!! apply only if noSysDirs is set
   patches = [./no-sys-dirs.patch];
-  buildInputs = [patch];
   inherit noSysDirs langC langCC langF77 profiledCompiler;
 }
diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix
index 0b7a044f258..16347e39fd1 100644
--- a/pkgs/development/tools/build-managers/gnumake/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, patch}:
+{stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "gnumake-3.80";
@@ -7,5 +7,4 @@ stdenv.mkDerivation {
     md5 = "0bbd1df101bc0294d440471e50feca71";
   };
   patches = [./log.diff];
-  buildInputs = [patch];
 }
diff --git a/pkgs/stdenv/generic-branch/builder.sh b/pkgs/stdenv/generic/builder.sh
index bbcd19448cb..bbcd19448cb 100644
--- a/pkgs/stdenv/generic-branch/builder.sh
+++ b/pkgs/stdenv/generic/builder.sh
diff --git a/pkgs/stdenv/generic-branch/default-builder.sh b/pkgs/stdenv/generic/default-builder.sh
index 9a297c67f6e..9a297c67f6e 100644
--- a/pkgs/stdenv/generic-branch/default-builder.sh
+++ b/pkgs/stdenv/generic/default-builder.sh
diff --git a/pkgs/stdenv/generic-branch/default.nix b/pkgs/stdenv/generic/default.nix
index 3aa2d3bfac0..3aa2d3bfac0 100644
--- a/pkgs/stdenv/generic-branch/default.nix
+++ b/pkgs/stdenv/generic/default.nix
diff --git a/pkgs/stdenv/generic-branch/docs.txt b/pkgs/stdenv/generic/docs.txt
index 060f3cd154b..060f3cd154b 100644
--- a/pkgs/stdenv/generic-branch/docs.txt
+++ b/pkgs/stdenv/generic/docs.txt
diff --git a/pkgs/stdenv/generic-branch/setup.sh b/pkgs/stdenv/generic/setup.sh
index 0fcbb5ee1ea..0e2dac944e3 100644
--- a/pkgs/stdenv/generic-branch/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -424,6 +424,14 @@ configureW() {
         $preConfigure
     fi
 
+    if test -z "$prefix"; then
+        prefix="$out";
+    fi
+
+    if test "$useTempPrefix" = "1"; then
+        prefix="$NIX_BUILD_TOP/tmp_prefix";
+    fi
+
     if test -z "$configureScript"; then
         configureScript=./configure
         if ! test -x $configureScript; then
@@ -439,14 +447,6 @@ configureW() {
         done
     fi
 
-    if test -z "$prefix"; then
-        prefix="$out";
-    fi
-
-    if test "$useTempPrefix" = "1"; then
-        prefix="$NIX_BUILD_TOP/tmp_prefix";
-    fi
-
     if test -z "$dontAddPrefix"; then
         configureFlags="--prefix=$prefix $configureFlags"
     fi
diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix
index 23417fc818b..ff8a0b0909b 100644
--- a/pkgs/system/all-packages-generic.nix
+++ b/pkgs/system/all-packages-generic.nix
@@ -2,7 +2,10 @@
 # identifier and a standard build environment, returns the set of all
 # packages provided by the Nix Package Collection.
 
-{stdenv, bootCurl, noSysDirs ? true}:
+{ stdenv, bootCurl, noSysDirs ? true
+, gccWithCC ? true
+, gccWithProfiling ? true
+}:
 
 rec {
 
@@ -41,7 +44,7 @@ rec {
   };
 
   diffutils = (import ../tools/text/diffutils) {
-    inherit fetchurl stdenv;
+    inherit fetchurl stdenv coreutils;
   };
 
   gnupatch = (import ../tools/text/gnupatch) {
@@ -218,7 +221,7 @@ rec {
   };
 
   gnumake = (import ../development/tools/build-managers/gnumake) {
-    inherit fetchurl stdenv patch;
+    inherit fetchurl stdenv;
   };
 
   bison = (import ../development/tools/parsing/bison) {
@@ -242,8 +245,10 @@ rec {
     m4 = gnum4;
   };
 
-  gcc = (import ../development/compilers/gcc) {
+  gcc = (import ../development/compilers/gcc-3.4) {
     inherit fetchurl stdenv noSysDirs;
+    langCC = gccWithCC;
+    profiledCompiler = gccWithProfiling;
   };
 
   gcc_static = (import ../stdenv/nix-linux/gcc-static) {
@@ -254,7 +259,7 @@ rec {
     nativeTools = false;
     nativeGlibc = false;
     gcc = (import ../development/compilers/gcc-3.4) {
-      inherit fetchurl stdenv patch noSysDirs;
+      inherit fetchurl stdenv noSysDirs;
       profiledCompiler = true;
     };
     binutils = stdenv.gcc.binutils;
@@ -266,7 +271,7 @@ rec {
     nativeTools = false;
     nativeGlibc = false;
     gcc = (import ../development/compilers/gcc-2.95) {
-      inherit fetchurl stdenv patch noSysDirs;
+      inherit fetchurl stdenv noSysDirs;
     };
     binutils = stdenv.gcc.binutils;
     glibc = stdenv.gcc.glibc;
@@ -277,7 +282,7 @@ rec {
     name = "g77";
     nativeTools = false;
     nativeGlibc = false;
-    gcc = (import ../development/compilers/gcc) {
+    gcc = (import ../development/compilers/gcc-3.3) {
       inherit fetchurl stdenv noSysDirs;
       langF77 = true;
       langCC = false;
@@ -399,7 +404,7 @@ rec {
   };
 
   realPerl = (import ../development/interpreters/perl) {
-    inherit fetchurl stdenv patch;
+    inherit fetchurl stdenv;
   };
 
   sysPerl = (import ../development/interpreters/sys-perl) {
@@ -451,7 +456,8 @@ rec {
   };
 
   glibc = (import ../development/libraries/glibc) {
-    inherit fetchurl stdenv kernelHeaders patch;
+    inherit fetchurl stdenv kernelHeaders;
+    installLocales = false;
   };
 
   aterm = (import ../development/libraries/aterm) {
@@ -504,7 +510,7 @@ rec {
 
   zlib = if stdenv.system == "powerpc-darwin" then
     (import ../development/libraries/zlib-mac-fix) {
-      inherit fetchurl stdenv patch;
+      inherit fetchurl stdenv;
     }
   else
     (import ../development/libraries/zlib) {
@@ -609,7 +615,7 @@ rec {
   };
 
   xlibs = (import ../development/libraries/xlibs) {
-    inherit fetchurl stdenv pkgconfig freetype expat patch;
+    inherit fetchurl stdenv pkgconfig freetype expat;
   };
 
   mesa = (import ../development/libraries/mesa) {
@@ -672,11 +678,11 @@ rec {
   };
 
   utillinux = (import ../os-specific/linux/util-linux) {
-    inherit fetchurl stdenv patch;
+    inherit fetchurl stdenv;
   };
 
   sysvinit = (import ../os-specific/linux/sysvinit) {
-    inherit fetchurl stdenv patch;
+    inherit fetchurl stdenv;
   };
 
   e2fsprogs = (import ../os-specific/linux/e2fsprogs) {
@@ -726,7 +732,7 @@ rec {
   };
 
   subversionWithJava = (import ../applications/version-management/subversion-1.1rc) {
-    inherit fetchurl stdenv openssl db4 expat patch;
+    inherit fetchurl stdenv openssl db4 expat;
     swig = swigWithJava;
     localServer = true;
     httpServer = false;
@@ -841,7 +847,7 @@ rec {
   ### MISC
 
   uml = (import ../misc/uml) {
-    inherit fetchurl stdenv perl patch;
+    inherit fetchurl stdenv perl;
     m4 = gnum4;
   };
 
diff --git a/pkgs/system/stdenvs.nix b/pkgs/system/stdenvs.nix
index 3f1f3cbae93..7399767f707 100644
--- a/pkgs/system/stdenvs.nix
+++ b/pkgs/system/stdenvs.nix
@@ -28,33 +28,41 @@
     inherit genericStdenv gccWrapper;
   };
 
-  stdenvNativePkgs = allPackages {
+  stdenvNativePkgsFun = bootstrap: allPackages {
     stdenv = stdenvNative;
     bootCurl = null;
     noSysDirs = false;
+    gccWithCC = !bootstrap;
+    gccWithProfiling = !bootstrap;
   };
 
+  stdenvNativePkgs = stdenvNativePkgsFun false;
+
 
   # The Nix build environment.
-  stdenvNix = (import ../stdenv/nix) {
+  stdenvNixFun = bootstrap: (import ../stdenv/nix) {
     stdenv = stdenvNative;
-    pkgs = stdenvNativePkgs;
+    pkgs = stdenvNativePkgsFun bootstrap;
     inherit genericStdenv gccWrapper;
   };
 
-  stdenvNixPkgs = allPackages {
-    stdenv = stdenvNix;
-    bootCurl = stdenvNativePkgs.curl;
+  stdenvNix = stdenvNixFun false;
+
+  stdenvNixPkgsFun = bootstrap: allPackages {
+    stdenv = stdenvNixFun bootstrap;
+    bootCurl = (stdenvNativePkgsFun bootstrap).curl;
     noSysDirs = false;
   };
 
+  stdenvNixPkgs = stdenvNixPkgs false;
+
 
   # The Linux build environment is a fully bootstrapped Nix
   # environment, that is, it should contain no external references.
 
   # 1) Build glibc in the Nix build environment.  The result is
   #    pure.
-  stdenvLinuxGlibc = stdenvNixPkgs.glibc;
+  stdenvLinuxGlibc = (stdenvNixPkgsFun true).glibc;
 
   # 2) Construct a stdenv consisting of the Nix build environment, but
   #    with a gcc-wrapper that causes linking against the glibc from
@@ -64,7 +72,7 @@
   #    `-lncurses').
   stdenvLinuxBoot1 = (import ../stdenv/nix-linux) {
     stdenv = stdenvNative;
-    pkgs = stdenvNativePkgs;
+    pkgs = stdenvNativePkgsFun true;
     glibc = stdenvLinuxGlibc;
     inherit genericStdenv gccWrapper;
   };
@@ -76,8 +84,10 @@
   #    *doesn't* search in `/lib' etc.  So these programs won't work.
   stdenvLinuxBoot1Pkgs = allPackages {
     stdenv = stdenvLinuxBoot1;
-    bootCurl = stdenvNativePkgs.curl;
+    bootCurl = (stdenvNativePkgsFun true).curl;
     noSysDirs = true;
+    gccWithCC = false;
+    gccWithProfiling = false;
   };
 
   # 4) Therefore we build a new standard environment which is the same
@@ -86,7 +96,7 @@
   #    system directories), things built by this stdenv should be pure.
   stdenvLinuxBoot2 = (import ../stdenv/nix-linux) {
     stdenv = stdenvLinuxBoot1;
-    pkgs = stdenvNativePkgs // {
+    pkgs = (stdenvNativePkgsFun true) // {
       inherit (stdenvLinuxBoot1Pkgs) gcc binutils;
     };
     glibc = stdenvLinuxGlibc;
@@ -96,7 +106,7 @@
   # 5) So these packages should be pure.
   stdenvLinuxBoot2Pkgs = allPackages {
     stdenv = stdenvLinuxBoot2;
-    bootCurl = stdenvNativePkgs.curl;
+    bootCurl = (stdenvNativePkgsFun true).curl;
   };
 
   # 6) Finally we can construct the Nix build environment from the
@@ -138,7 +148,7 @@
   # (essentially it's just the native environment).
   stdenvDarwin = (import ../stdenv/darwin) {
     stdenv = stdenvInitial;
-    genericStdenv = import ../stdenv/generic-branch;
+    genericStdenv = import ../stdenv/generic;
     inherit gccWrapper;
   };
 
@@ -147,21 +157,5 @@
     bootCurl = null;
     noSysDirs = false;
   };
-
-
-  # Testing the new stdenv-linux (TODO: remove this eventually).
-  stdenvLinuxTest = (import ../stdenv/nix-linux) {
-    stdenv = stdenvLinuxBoot2;
-    pkgs = stdenvLinuxBoot2Pkgs;
-    glibc = stdenvLinuxGlibc;
-    genericStdenv = import ../stdenv/generic-branch;
-    inherit gccWrapper;
-  };
-
-  stdenvDarwinTest = (import ../stdenv/darwin) {
-    stdenv = stdenvInitial;
-    genericStdenv = import ../stdenv/generic-branch;
-    inherit gccWrapper;
-  };
-    
+  
 }