Merge commit '3b29468313bc8604fe8f85c8d9316fd276d3985c' into HEAD
This commit is contained in:
@@ -40,6 +40,8 @@ let
|
||||
|
||||
allowBroken = config.allowBroken or false || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
|
||||
|
||||
allowUnsupportedSystem = config.allowUnsupportedSystem or false;
|
||||
|
||||
isUnfree = licenses: lib.lists.any (l:
|
||||
!l.free or true || l == "unfree" || l == "unfree-redistributable") licenses;
|
||||
|
||||
@@ -177,7 +179,7 @@ let
|
||||
{ valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; }
|
||||
else if !allowBroken && attrs.meta.broken or false then
|
||||
{ valid = false; reason = "broken"; errormsg = "is marked as broken"; }
|
||||
else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem system attrs.meta.platforms then
|
||||
else if !allowUnsupportedSystem && !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem system attrs.meta.platforms then
|
||||
{ valid = false; reason = "broken"; errormsg = "is not supported on ‘${system}’"; }
|
||||
else if !(hasAllowedInsecure attrs) then
|
||||
{ valid = false; reason = "insecure"; errormsg = "is marked as insecure"; }
|
||||
|
||||
@@ -43,29 +43,21 @@ rec {
|
||||
, propagatedSandboxProfile ? ""
|
||||
, ... } @ attrs:
|
||||
let
|
||||
dependencies = [
|
||||
(map (drv: drv.nativeDrv or drv) nativeBuildInputs)
|
||||
dependencies = map lib.chooseDevOutputs [
|
||||
(map (drv: drv.nativeDrv or drv) nativeBuildInputs
|
||||
++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh
|
||||
++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh)
|
||||
(map (drv: drv.crossDrv or drv) buildInputs)
|
||||
];
|
||||
propagatedDependencies = [
|
||||
propagatedDependencies = map lib.chooseDevOutputs [
|
||||
(map (drv: drv.nativeDrv or drv) propagatedNativeBuildInputs)
|
||||
(map (drv: drv.crossDrv or drv) propagatedBuildInputs)
|
||||
];
|
||||
in let
|
||||
|
||||
outputs' =
|
||||
outputs ++
|
||||
(if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []);
|
||||
|
||||
dependencies' = let
|
||||
justMap = map lib.chooseDevOutputs dependencies;
|
||||
nativeBuildInputs = lib.head justMap
|
||||
++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh
|
||||
++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh;
|
||||
in [ nativeBuildInputs ] ++ lib.tail justMap;
|
||||
|
||||
propagatedDependencies' = map lib.chooseDevOutputs propagatedDependencies;
|
||||
|
||||
derivationArg =
|
||||
(removeAttrs attrs
|
||||
["meta" "passthru" "crossAttrs" "pos"
|
||||
@@ -73,13 +65,13 @@ rec {
|
||||
"sandboxProfile" "propagatedSandboxProfile"])
|
||||
// (let
|
||||
computedSandboxProfile =
|
||||
lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies');
|
||||
lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies);
|
||||
computedPropagatedSandboxProfile =
|
||||
lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists propagatedDependencies');
|
||||
lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists propagatedDependencies);
|
||||
computedImpureHostDeps =
|
||||
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies'));
|
||||
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies));
|
||||
computedPropagatedImpureHostDeps =
|
||||
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies'));
|
||||
lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies));
|
||||
in
|
||||
{
|
||||
name = name + lib.optionalString
|
||||
@@ -92,11 +84,11 @@ rec {
|
||||
userHook = config.stdenv.userHook or null;
|
||||
__ignoreNulls = true;
|
||||
|
||||
nativeBuildInputs = lib.elemAt dependencies' 0;
|
||||
buildInputs = lib.elemAt dependencies' 1;
|
||||
nativeBuildInputs = lib.elemAt dependencies 0;
|
||||
buildInputs = lib.elemAt dependencies 1;
|
||||
|
||||
propagatedNativeBuildInputs = lib.elemAt propagatedDependencies' 0;
|
||||
propagatedBuildInputs = lib.elemAt propagatedDependencies' 1;
|
||||
propagatedNativeBuildInputs = lib.elemAt propagatedDependencies 0;
|
||||
propagatedBuildInputs = lib.elemAt propagatedDependencies 1;
|
||||
|
||||
# This parameter is sometimes a string, sometimes null, and sometimes a list, yuck
|
||||
configureFlags = let inherit (lib) optional elem; in
|
||||
|
||||
@@ -299,13 +299,22 @@ in
|
||||
shellPackage = prevStage.bash;
|
||||
};
|
||||
|
||||
/* outputs TODO
|
||||
allowedRequisites = with prevStage;
|
||||
[ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk
|
||||
glibc gnumake gnused gnutar gnugrep gnupatch patchelf attr acl
|
||||
paxctl zlib pcre linuxHeaders ed gcc gcc.cc libsigsegv
|
||||
] ++ lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
|
||||
*/
|
||||
# Mainly avoid reference to bootstrap tools
|
||||
allowedRequisites = with prevStage; with lib;
|
||||
# Simple executable tools
|
||||
concatMap (p: [ (getBin p) (getLib p) ])
|
||||
[ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk
|
||||
gnumake gnused gnutar gnugrep gnupatch patchelf ed paxctl
|
||||
]
|
||||
# Library dependencies
|
||||
++ map getLib [ attr acl zlib pcre libsigsegv ]
|
||||
# More complicated cases
|
||||
++ [
|
||||
glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders
|
||||
gcc gcc.cc gcc.cc.lib gcc.expandResponseParams
|
||||
]
|
||||
++ lib.optionals (system == "aarch64-linux")
|
||||
[ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];
|
||||
|
||||
overrides = self: super: {
|
||||
inherit (prevStage)
|
||||
|
||||
Reference in New Issue
Block a user