summaryrefslogtreecommitdiffstats
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2016-12-19 08:10:47 -0800
committerJohn Ericson <Ericson2314@Yahoo.com>2017-01-13 10:36:11 -0500
commit0ef8b69d12d1ab1574568f5660b44feba1f44179 (patch)
tree753926b8722fae81634cd6050c00e71c9020afe1 /pkgs/stdenv
parentf673243aff0bc9ae4d2e96ccd60124ff9fe5b103 (diff)
top-level: Modernize stdenv.overrides giving it self and super
Document breaking change in 17.03 release notes
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/darwin/default.nix32
-rw-r--r--pkgs/stdenv/generic/default.nix2
-rw-r--r--pkgs/stdenv/linux/default.nix41
-rw-r--r--pkgs/stdenv/native/default.nix4
-rw-r--r--pkgs/stdenv/nix/default.nix2
5 files changed, 40 insertions, 41 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index b9044f25cd7a..0ff583e6ebb2 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -54,7 +54,7 @@ in rec {
};
stageFun = step: last: {shell ? "${bootstrapTools}/bin/sh",
- overrides ? (pkgs: {}),
+ overrides ? (self: super: {}),
extraPreHook ? "",
extraBuildInputs,
allowedRequisites ? null}:
@@ -96,7 +96,7 @@ in rec {
extraSandboxProfile = binShClosure + libSystemProfile;
extraAttrs = { inherit platform; parent = last; };
- overrides = pkgs: (overrides pkgs) // { fetchurl = thisStdenv.fetchurlBoot; };
+ overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
};
thisPkgs = allPackages {
@@ -107,8 +107,8 @@ in rec {
in { stdenv = thisStdenv; pkgs = thisPkgs; };
stage0 = stageFun 0 null {
- overrides = orig: with stage0; rec {
- darwin = orig.darwin // {
+ overrides = self: super: with stage0; rec {
+ darwin = super.darwin // {
Libsystem = stdenv.mkDerivation {
name = "bootstrap-Libsystem";
buildCommand = ''
@@ -145,7 +145,7 @@ in rec {
extraBuildInputs = [];
};
- persistent0 = _: {};
+ persistent0 = _: _: {};
stage1 = with stage0; stageFun 1 stage0 {
extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\"";
@@ -157,14 +157,14 @@ in rec {
overrides = persistent0;
};
- persistent1 = orig: with stage1.pkgs; {
+ persistent1 = self: super: with stage1.pkgs; {
inherit
zlib patchutils m4 scons flex perl bison unifdef unzip openssl icu python
libxml2 gettext sharutils gmp libarchive ncurses pkg-config libedit groff
openssh sqlite sed serf openldap db cyrus-sasl expat apr-util subversion xz
findfreetype libssh curl cmake autoconf automake libtool ed cpio coreutils;
- darwin = orig.darwin // {
+ darwin = super.darwin // {
inherit (darwin)
dyld Libsystem xnu configd libdispatch libclosure launchd;
};
@@ -185,7 +185,7 @@ in rec {
overrides = persistent1;
};
- persistent2 = orig: with stage2.pkgs; {
+ persistent2 = self: super: with stage2.pkgs; {
inherit
patchutils m4 scons flex perl bison unifdef unzip openssl python
gettext sharutils libarchive pkg-config groff bash subversion
@@ -193,7 +193,7 @@ in rec {
findfreetype libssh curl cmake autoconf automake libtool cpio
libcxx libcxxabi;
- darwin = orig.darwin // {
+ darwin = super.darwin // {
inherit (darwin)
dyld Libsystem xnu configd libdispatch libclosure launchd libiconv locale;
};
@@ -221,19 +221,19 @@ in rec {
overrides = persistent2;
};
- persistent3 = orig: with stage3.pkgs; {
+ persistent3 = self: super: with stage3.pkgs; {
inherit
gnumake gzip gnused bzip2 gawk ed xz patch bash
libcxxabi libcxx ncurses libffi zlib gmp pcre gnugrep
coreutils findutils diffutils patchutils;
llvmPackages = let llvmOverride = llvmPackages.llvm.override { inherit libcxxabi; };
- in orig.llvmPackages // {
+ in super.llvmPackages // {
llvm = llvmOverride;
clang-unwrapped = llvmPackages.clang-unwrapped.override { llvm = llvmOverride; };
};
- darwin = orig.darwin // {
+ darwin = super.darwin // {
inherit (darwin) dyld Libsystem libiconv locale;
};
};
@@ -247,17 +247,17 @@ in rec {
overrides = persistent3;
};
- persistent4 = orig: with stage4.pkgs; {
+ persistent4 = self: super: with stage4.pkgs; {
inherit
gnumake gzip gnused bzip2 gawk ed xz patch bash
libcxxabi libcxx ncurses libffi zlib icu llvm gmp pcre gnugrep
coreutils findutils diffutils patchutils binutils binutils-raw;
- llvmPackages = orig.llvmPackages // {
+ llvmPackages = super.llvmPackages // {
inherit (llvmPackages) llvm clang-unwrapped;
};
- darwin = orig.darwin // {
+ darwin = super.darwin // {
inherit (darwin) dyld Libsystem cctools libiconv;
};
};
@@ -307,7 +307,7 @@ in rec {
dyld Libsystem CF cctools libiconv locale
]);
- overrides = orig: persistent4 orig // {
+ overrides = self: super: persistent4 self super // {
clang = cc;
inherit cc;
};
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index bd35970e0d12..32e0d8948188 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -1,7 +1,7 @@
let lib = import ../../../lib; in lib.makeOverridable (
{ system, name ? "stdenv", preHook ? "", initialPath, cc, shell
-, allowedRequisites ? null, extraAttrs ? {}, overrides ? (pkgs: {}), config
+, allowedRequisites ? null, extraAttrs ? {}, overrides ? (self: super: {}), config
, # The `fetchurl' to use for downloading curl and its dependencies
# (see all-packages.nix).
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 9900fc6dd3d5..708f0ec3b6d6 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -44,7 +44,7 @@ rec {
# the bootstrap. In all stages, we build an stdenv and the package
# set that can be built with that stdenv.
stageFun =
- {gccPlain, glibc, binutils, coreutils, gnugrep, name, overrides ? (pkgs: {}), extraBuildInputs ? []}:
+ {gccPlain, glibc, binutils, coreutils, gnugrep, name, overrides ? (self: super: {}), extraBuildInputs ? []}:
let
@@ -87,7 +87,7 @@ rec {
# /usr/include directory.
inherit glibc;
};
- overrides = pkgs: (overrides pkgs) // { fetchurl = thisStdenv.fetchurlBoot; };
+ overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
};
thisPkgs = allPackages {
@@ -109,13 +109,13 @@ rec {
gnugrep = null;
name = null;
- overrides = pkgs: {
+ overrides = self: super: {
# The Glibc include directory cannot have the same prefix as the
# GCC include directory, since GCC gets confused otherwise (it
# will search the Glibc headers before the GCC headers). So
# create a dummy Glibc here, which will be used in the stdenv of
# stage1.
- glibc = stage0.stdenv.mkDerivation {
+ glibc = self.stdenv.mkDerivation {
name = "bootstrap-glibc";
buildCommand = ''
mkdir -p $out
@@ -146,8 +146,8 @@ rec {
name = "bootstrap-gcc-wrapper";
# Rebuild binutils to use from stage2 onwards.
- overrides = pkgs: {
- binutils = pkgs.binutils.override { gold = false; };
+ overrides = self: super: {
+ binutils = super.binutils.override { gold = false; };
inherit (stage0.pkgs) glibc;
# A threaded perl build needs glibc/libpthread_nonshared.a,
@@ -155,7 +155,7 @@ rec {
# This is not an issue for the final stdenv, because this perl
# won't be included in the final stdenv and won't be exported to
# top-level pkgs as an override either.
- perl = pkgs.perl.override { enableThreading = false; };
+ perl = super.perl.override { enableThreading = false; };
};
};
@@ -170,7 +170,7 @@ rec {
gnugrep = bootstrapTools;
name = "bootstrap-gcc-wrapper";
- overrides = pkgs: {
+ overrides = self: super: {
inherit (stage1.pkgs) perl binutils paxctl gnum4 bison;
# This also contains the full, dynamically linked, final Glibc.
};
@@ -187,16 +187,16 @@ rec {
gnugrep = bootstrapTools;
name = "bootstrap-gcc-wrapper";
- overrides = pkgs: rec {
+ overrides = self: super: rec {
inherit (stage2.pkgs) binutils glibc perl patchelf linuxHeaders gnum4 bison;
# Link GCC statically against GMP etc. This makes sense because
# these builds of the libraries are only used by GCC, so it
# reduces the size of the stdenv closure.
- gmp = pkgs.gmp.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
- mpfr = pkgs.mpfr.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
- libmpc = pkgs.libmpc.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
- isl_0_14 = pkgs.isl_0_14.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
- gccPlain = pkgs.gcc.cc.override {
+ gmp = super.gmp.override { stdenv = self.makeStaticLibraries self.stdenv; };
+ mpfr = super.mpfr.override { stdenv = self.makeStaticLibraries self.stdenv; };
+ libmpc = super.libmpc.override { stdenv = self.makeStaticLibraries self.stdenv; };
+ isl_0_14 = super.isl_0_14.override { stdenv = self.makeStaticLibraries self.stdenv; };
+ gccPlain = super.gcc.cc.override {
isl = isl_0_14;
};
};
@@ -212,7 +212,7 @@ rec {
coreutils = bootstrapTools;
name = "";
- overrides = pkgs: {
+ overrides = self: super: {
# Zlib has to be inherited and not rebuilt in this stage,
# because gcc (since JAR support) already depends on zlib, and
# then if we already have a zlib we want to use that for the
@@ -223,12 +223,11 @@ rec {
nativeTools = false;
nativeLibc = false;
isGNU = true;
- cc = stage4.stdenv.cc.cc;
- libc = stage4.pkgs.glibc;
- inherit (stage4.pkgs) binutils coreutils gnugrep;
+ cc = self.stdenv.cc.cc;
+ libc = self.glibc;
+ inherit (self) stdenv binutils coreutils gnugrep;
name = "";
- stdenv = stage4.stdenv;
- shell = stage4.pkgs.bash + "/bin/bash";
+ shell = self.bash + "/bin/bash";
};
};
extraBuildInputs = [ stage3.pkgs.patchelf stage3.pkgs.xz ];
@@ -278,7 +277,7 @@ rec {
];
*/
- overrides = pkgs: {
+ overrides = self: super: {
gcc = cc;
inherit (stage4.pkgs)
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index 8396bd0cb017..5a2d2c965599 100644
--- a/pkgs/stdenv/native/default.nix
+++ b/pkgs/stdenv/native/default.nix
@@ -77,7 +77,7 @@ rec {
# A function that builds a "native" stdenv (one that uses tools in
# /usr etc.).
makeStdenv =
- { cc, fetchurl, extraPath ? [], overrides ? (pkgs: { }) }:
+ { cc, fetchurl, extraPath ? [], overrides ? (self: super: { }) }:
import ../generic {
preHook =
@@ -142,7 +142,7 @@ rec {
stdenvBoot2 = makeStdenv {
inherit cc fetchurl;
extraPath = [ stdenvBoot1Pkgs.xz ];
- overrides = pkgs: { inherit (stdenvBoot1Pkgs) xz; };
+ overrides = self: super: { inherit (stdenvBoot1Pkgs) xz; };
};
diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix
index e58972e5c8a6..21ee29ad5af9 100644
--- a/pkgs/stdenv/nix/default.nix
+++ b/pkgs/stdenv/nix/default.nix
@@ -29,7 +29,7 @@ import ../generic rec {
fetchurlBoot = stdenv.fetchurlBoot;
- overrides = pkgs_: {
+ overrides = self: super: {
inherit cc;
inherit (cc) binutils;
inherit (pkgs)