mirror of
https://github.com/NixOS/nix.git
synced 2025-11-22 02:09:36 +01:00
packaging: Unbork win shells with unavailable dependencies
Makes the cross-x86_64-w64-mingw32 devshell slightly less broken. It still needs a bit of massaging to function, but that's much less cumbersome now that the generic machinery with genericClosure that evaluates drvPath doesn't barf on unavailable packages.
This commit is contained in:
parent
09d6847490
commit
2de742155a
3 changed files with 25 additions and 17 deletions
|
|
@ -130,15 +130,19 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
|
||||||
havePerl = stdenv.buildPlatform == stdenv.hostPlatform && stdenv.hostPlatform.isUnix;
|
havePerl = stdenv.buildPlatform == stdenv.hostPlatform && stdenv.hostPlatform.isUnix;
|
||||||
ignoreCrossFile = flags: builtins.filter (flag: !(lib.strings.hasInfix "cross-file" flag)) flags;
|
ignoreCrossFile = flags: builtins.filter (flag: !(lib.strings.hasInfix "cross-file" flag)) flags;
|
||||||
|
|
||||||
|
availableComponents = lib.filterAttrs (
|
||||||
|
k: v: lib.meta.availableOn pkgs.hostPlatform v
|
||||||
|
) allComponents;
|
||||||
|
|
||||||
activeComponents = buildInputsClosureCond isInternal (
|
activeComponents = buildInputsClosureCond isInternal (
|
||||||
lib.attrValues (finalAttrs.passthru.config.getComponents allComponents)
|
lib.attrValues (finalAttrs.passthru.config.getComponents availableComponents)
|
||||||
);
|
);
|
||||||
|
|
||||||
allComponents = lib.filterAttrs (k: v: lib.isDerivation v) pkgs.nixComponents2;
|
allComponents = lib.filterAttrs (k: v: lib.isDerivation v) pkgs.nixComponents2;
|
||||||
internalDrvs = byDrvPath (
|
internalDrvs = byDrvPath (
|
||||||
# Drop the attr names (not present in buildInputs anyway)
|
# Drop the attr names (not present in buildInputs anyway)
|
||||||
lib.attrValues allComponents
|
lib.attrValues availableComponents
|
||||||
++ lib.concatMap (c: lib.attrValues c.tests or { }) (lib.attrValues allComponents)
|
++ lib.concatMap (c: lib.attrValues c.tests or { }) (lib.attrValues availableComponents)
|
||||||
);
|
);
|
||||||
|
|
||||||
isInternal =
|
isInternal =
|
||||||
|
|
@ -187,19 +191,19 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
|
||||||
);
|
);
|
||||||
|
|
||||||
small =
|
small =
|
||||||
(finalAttrs.finalPackage.withActiveComponents (c: {
|
(finalAttrs.finalPackage.withActiveComponents (
|
||||||
inherit (c)
|
c:
|
||||||
nix-cli
|
lib.intersectAttrs (lib.genAttrs [
|
||||||
nix-util-tests
|
"nix-cli"
|
||||||
nix-store-tests
|
"nix-util-tests"
|
||||||
nix-expr-tests
|
"nix-store-tests"
|
||||||
nix-fetchers-tests
|
"nix-expr-tests"
|
||||||
nix-flake-tests
|
"nix-fetchers-tests"
|
||||||
nix-functional-tests
|
"nix-flake-tests"
|
||||||
# Currently required
|
"nix-functional-tests"
|
||||||
nix-perl-bindings
|
"nix-perl-bindings"
|
||||||
;
|
] (_: null)) c
|
||||||
})).overrideAttrs
|
)).overrideAttrs
|
||||||
(o: {
|
(o: {
|
||||||
mesonFlags = o.mesonFlags ++ [
|
mesonFlags = o.mesonFlags ++ [
|
||||||
# TODO: infer from activeComponents or vice versa
|
# TODO: infer from activeComponents or vice versa
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,6 @@ mkMesonDerivation (finalAttrs: {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
platforms = lib.platforms.all;
|
platforms = lib.platforms.unix;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -74,5 +74,9 @@ perl.pkgs.toPerlModule (
|
||||||
];
|
];
|
||||||
|
|
||||||
strictDeps = false;
|
strictDeps = false;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
platforms = lib.platforms.unix;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue