diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-26 21:46:08 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-26 21:46:08 +0000 |
commit | a3403e6828ee7cac9955b7ad7e420e087b62c700 (patch) | |
tree | 5fd4a5b069d5af2ac7d93f4c8994cbd57c952725 /pkgs/stdenv | |
parent | 3cda62f6e1b9fe934798ab27daaa0d5da7e9130c (diff) | |
parent | fe10a3aed5911f4858d667d611c94bb77a375b75 (diff) | |
download | nixlib-a3403e6828ee7cac9955b7ad7e420e087b62c700.tar nixlib-a3403e6828ee7cac9955b7ad7e420e087b62c700.tar.gz nixlib-a3403e6828ee7cac9955b7ad7e420e087b62c700.tar.bz2 nixlib-a3403e6828ee7cac9955b7ad7e420e087b62c700.tar.lz nixlib-a3403e6828ee7cac9955b7ad7e420e087b62c700.tar.xz nixlib-a3403e6828ee7cac9955b7ad7e420e087b62c700.tar.zst nixlib-a3403e6828ee7cac9955b7ad7e420e087b62c700.zip |
Finishing the update from trunk, having resolved the eclipse related directory
renaming. I think directory renaming breaks the usual merges... because it leaves the 'to be removed' directory in the working directory still. A manual 'rm' of the 'to be removed' directory fixed the commit. svn merge ^/nixpkgs/trunk svn path=/nixpkgs/branches/stdenv-updates/; revision=18661
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/adapters.nix | 65 | ||||
-rw-r--r-- | pkgs/stdenv/default.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 5 | ||||
-rw-r--r-- | pkgs/stdenv/native/default.nix | 2 |
4 files changed, 70 insertions, 3 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index c4f8b6db8f24..5718d06c45d2 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -258,4 +258,69 @@ rec { (stdenv.mkDerivation args) { meta.maintainers = maintainers; }; }; + + + /* Use the trace output to report all processed derivations with their + license name. + + */ + traceDrvLicenses = stdenv: stdenv // + { mkDerivation = args: + let + pkg = stdenv.mkDerivation args; + printDrvPath = val: let + drvPath = builtins.unsafeDiscardStringContext pkg.drvPath; + license = + if pkg ? meta && pkg.meta ? license then + pkg.meta.license + else + null; + in + builtins.trace "@:drv:${toString drvPath}:${builtins.exprToString license}:@" + val; + in pkg // { + outPath = printDrvPath pkg.outPath; + drvPath = printDrvPath pkg.drvPath; + }; + }; + + /* Abort if the license predicate is not verified for a derivation + declared with mkDerivation. + + One possible predicate to avoid all non-free packages can be achieved + with the following function: + + isFree = license: with builtins; + if isNull license then true + else if isList license then lib.all isFree license + else license != "non-free" && license != "unfree"; + + This adapter can be defined on the defaultStdenv definition. You can + use it by patching the all-packages.nix file or by using the override + feature of ~/.nixpkgs/config.nix . + */ + validateLicenses = licensePred: stdenv: stdenv // + { mkDerivation = args: + let + pkg = stdenv.mkDerivation args; + license = + if pkg ? meta && pkg.meta ? license then + pkg.meta.license + else + null; + + validate = arg: + if licensePred license then arg + else abort " + Error while building ${builtins.unsafeDiscardStringContext pkg.drvPath}: + The license predicate is not verified. + + bad license: ${builtins.exprToString license} + "; + + in pkg // { + outPath = validate pkg.outPath; + drvPath = validate pkg.drvPath; + }; + }; } diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index ed8f0e39f5f8..40acb8cfece4 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -58,5 +58,6 @@ rec { if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else if stdenvType == "i686-mingw" then stdenvMinGW else if stdenvType == "i686-darwin" then stdenvNix else + if stdenvType == "x86_64-darwin" then stdenvNix else stdenvNative; } diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 0ae71d183dec..191dd54c6aea 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -90,7 +90,7 @@ let (if attrs ? passthru then attrs.passthru else {}); # Utility flags to test the type of platform. - isDarwin = result.system == "i686-darwin" || result.system == "powerpc-darwin"; + isDarwin = result.system == "i686-darwin" || result.system == "powerpc-darwin" || result.system == "x86_64-darwin"; isLinux = result.system == "i686-linux" || result.system == "x86_64-linux" || result.system == "powerpc-linux" @@ -100,7 +100,8 @@ let || result.system == "i686-freebsd" || result.system == "i686-openbsd" || result.system == "i386-sunos"; - is64bit = result.system == "x86_64-linux"; + is64bit = result.system == "x86_64-linux" + || result.system == "x86_64-darwin"; # Utility function: allow stdenv to be easily regenerated with # a different setup script. (See all-packages.nix for an diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index 880fabf64b07..1f2117ebba0f 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -86,7 +86,7 @@ rec { name = "stdenv-native"; preHook = - if system == "i686-darwin" || system == "powerpc-darwin" then prehookDarwin else + if system == "i686-darwin" || system == "powerpc-darwin" || system == "x86_64-darwin" then prehookDarwin else if system == "i686-freebsd" then prehookFreeBSD else if system == "i686-openbsd" then prehookOpenBSD else if system == "i686-netbsd" then prehookNetBSD else |