From be3fc3ae2f3a782226d2b8b8ec36c37f18fa12a3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Jul 2014 17:21:32 +0200 Subject: [PATCH] Prevent an unnecessary evaluation of lib --- pkgs/stdenv/default.nix | 6 +++--- pkgs/stdenv/linux/default.nix | 4 +--- pkgs/stdenv/nix/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 47d1fb6d9f75..e056505f1b7a 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -5,7 +5,7 @@ # Posix utilities, the GNU C compiler, and so on. On other systems, # we use the native C library. -{ system, allPackages ? import ../.., platform, config }: +{ system, allPackages ? import ../.., platform, config, lib }: rec { @@ -28,14 +28,14 @@ rec { # The Nix build environment. stdenvNix = import ./nix { - inherit config; + inherit config lib; stdenv = stdenvNative; pkgs = stdenvNativePkgs; }; # Linux standard environment. - stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux; + stdenvLinux = (import ./linux { inherit system allPackages platform config lib; }).stdenvLinux; # Select the appropriate stdenv for the platform `system'. diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 7169ce9f94eb..d96a94832851 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -7,12 +7,10 @@ # The function defaults are for easy testing. { system ? builtins.currentSystem , allPackages ? import ../../top-level/all-packages.nix -, platform ? null, config ? {} }: +, platform ? null, config ? {}, lib }: rec { - lib = import ../../../lib; - bootstrapFiles = if system == "i686-linux" then import ./bootstrap/i686.nix else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix index a496a819a6df..c7dd659195be 100644 --- a/pkgs/stdenv/nix/default.nix +++ b/pkgs/stdenv/nix/default.nix @@ -1,4 +1,4 @@ -{ stdenv, pkgs, config }: +{ stdenv, pkgs, config, lib }: import ../generic rec { inherit config; @@ -7,7 +7,7 @@ import ../generic rec { '' export NIX_ENFORCE_PURITY=1 export NIX_IGNORE_LD_THROUGH_GCC=1 - '' + (if stdenv.isDarwin then '' + '' + lib.optionalString stdenv.isDarwin '' export NIX_ENFORCE_PURITY= export NIX_DONT_SET_RPATH=1 export NIX_NO_SELF_RPATH=1 @@ -18,7 +18,7 @@ import ../generic rec { export SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true) export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations" export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib" - '' else ""); + ''; initialPath = (import ../common-path.nix) {pkgs = pkgs;}; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c7f4e2700768..c3d5f802b52a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -205,7 +205,7 @@ let allStdenvs = import ../stdenv { - inherit system platform config; + inherit system platform config lib; allPackages = args: import ./all-packages.nix ({ inherit config system; } // args); };