mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Merge pull request #11869 from NixOS/unbloat-nix-everything
nix-everything: Remove libs, add dev and devdoc package outputs
This commit is contained in:
commit
03dc3c5769
1 changed files with 104 additions and 38 deletions
|
@ -5,12 +5,10 @@
|
||||||
|
|
||||||
nix-util,
|
nix-util,
|
||||||
nix-util-c,
|
nix-util-c,
|
||||||
nix-util-test-support,
|
|
||||||
nix-util-tests,
|
nix-util-tests,
|
||||||
|
|
||||||
nix-store,
|
nix-store,
|
||||||
nix-store-c,
|
nix-store-c,
|
||||||
nix-store-test-support,
|
|
||||||
nix-store-tests,
|
nix-store-tests,
|
||||||
|
|
||||||
nix-fetchers,
|
nix-fetchers,
|
||||||
|
@ -18,7 +16,6 @@
|
||||||
|
|
||||||
nix-expr,
|
nix-expr,
|
||||||
nix-expr-c,
|
nix-expr-c,
|
||||||
nix-expr-test-support,
|
|
||||||
nix-expr-tests,
|
nix-expr-tests,
|
||||||
|
|
||||||
nix-flake,
|
nix-flake,
|
||||||
|
@ -38,45 +35,80 @@
|
||||||
nix-external-api-docs,
|
nix-external-api-docs,
|
||||||
|
|
||||||
nix-perl-bindings,
|
nix-perl-bindings,
|
||||||
|
|
||||||
|
testers,
|
||||||
|
runCommand,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
dev = stdenv.mkDerivation (finalAttrs: {
|
||||||
|
name = "nix-${nix-cli.version}-dev";
|
||||||
|
pname = "nix";
|
||||||
|
version = nix-cli.version;
|
||||||
|
dontUnpack = true;
|
||||||
|
dontBuild = true;
|
||||||
|
libs = map lib.getDev [
|
||||||
|
nix-cmd
|
||||||
|
nix-expr
|
||||||
|
nix-expr-c
|
||||||
|
nix-fetchers
|
||||||
|
nix-flake
|
||||||
|
nix-main
|
||||||
|
nix-main-c
|
||||||
|
nix-store
|
||||||
|
nix-store-c
|
||||||
|
nix-util
|
||||||
|
nix-util-c
|
||||||
|
nix-perl-bindings
|
||||||
|
];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
echo $libs >> $out/nix-support/propagated-build-inputs
|
||||||
|
'';
|
||||||
|
passthru = {
|
||||||
|
tests = {
|
||||||
|
pkg-config =
|
||||||
|
testers.hasPkgConfigModules {
|
||||||
|
package = finalAttrs.finalPackage;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# If we were to fully emulate output selection here, we'd confuse the Nix CLIs,
|
||||||
|
# because they rely on `drvPath`.
|
||||||
|
dev = finalAttrs.finalPackage.out;
|
||||||
|
|
||||||
|
libs = throw "`nix.dev.libs` is not meant to be used; use `nix.libs` instead.";
|
||||||
|
};
|
||||||
|
meta = {
|
||||||
|
pkgConfigModules = [
|
||||||
|
"nix-cmd"
|
||||||
|
"nix-expr"
|
||||||
|
"nix-expr-c"
|
||||||
|
"nix-fetchers"
|
||||||
|
"nix-flake"
|
||||||
|
"nix-main"
|
||||||
|
"nix-main-c"
|
||||||
|
"nix-store"
|
||||||
|
"nix-store-c"
|
||||||
|
"nix-util"
|
||||||
|
"nix-util-c"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
devdoc = buildEnv {
|
||||||
|
name = "nix-${nix-cli.version}-devdoc";
|
||||||
|
paths = [
|
||||||
|
nix-internal-api-docs
|
||||||
|
nix-external-api-docs
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
(buildEnv {
|
(buildEnv {
|
||||||
name = "nix-${nix-cli.version}";
|
name = "nix-${nix-cli.version}";
|
||||||
paths = [
|
paths = [
|
||||||
nix-util
|
|
||||||
nix-util-c
|
|
||||||
nix-util-test-support
|
|
||||||
nix-util-tests
|
|
||||||
|
|
||||||
nix-store
|
|
||||||
nix-store-c
|
|
||||||
nix-store-test-support
|
|
||||||
nix-store-tests
|
|
||||||
|
|
||||||
nix-fetchers
|
|
||||||
nix-fetchers-tests
|
|
||||||
|
|
||||||
nix-expr
|
|
||||||
nix-expr-c
|
|
||||||
nix-expr-test-support
|
|
||||||
nix-expr-tests
|
|
||||||
|
|
||||||
nix-flake
|
|
||||||
nix-flake-tests
|
|
||||||
|
|
||||||
nix-main
|
|
||||||
nix-main-c
|
|
||||||
|
|
||||||
nix-cmd
|
|
||||||
|
|
||||||
nix-cli
|
nix-cli
|
||||||
|
nix-manual.man
|
||||||
nix-manual
|
|
||||||
nix-internal-api-docs
|
|
||||||
nix-external-api-docs
|
|
||||||
|
|
||||||
] ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
||||||
nix-perl-bindings
|
|
||||||
];
|
];
|
||||||
|
|
||||||
meta.mainProgram = "nix";
|
meta.mainProgram = "nix";
|
||||||
|
@ -85,12 +117,25 @@
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
# Actually run the unit tests too
|
# Make sure the unit tests have passed
|
||||||
nix-util-tests.tests.run
|
nix-util-tests.tests.run
|
||||||
nix-store-tests.tests.run
|
nix-store-tests.tests.run
|
||||||
nix-expr-tests.tests.run
|
nix-expr-tests.tests.run
|
||||||
|
nix-fetchers-tests.tests.run
|
||||||
nix-flake-tests.tests.run
|
nix-flake-tests.tests.run
|
||||||
];
|
|
||||||
|
# dev bundle is ok
|
||||||
|
# (checkInputs must be empty paths??)
|
||||||
|
(runCommand "check-pkg-config" { checked = dev.tests.pkg-config; } "mkdir $out")
|
||||||
|
] ++
|
||||||
|
(if stdenv.buildPlatform.canExecute stdenv.hostPlatform
|
||||||
|
then [
|
||||||
|
# TODO: add perl.tests
|
||||||
|
nix-perl-bindings
|
||||||
|
]
|
||||||
|
else [
|
||||||
|
nix-perl-bindings
|
||||||
|
]);
|
||||||
installCheckInputs = [
|
installCheckInputs = [
|
||||||
nix-functional-tests
|
nix-functional-tests
|
||||||
];
|
];
|
||||||
|
@ -128,5 +173,26 @@
|
||||||
nix-main-c
|
nix-main-c
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tests = prevAttrs.passthru.tests or {} // {
|
||||||
|
# TODO: create a proper fixpoint and:
|
||||||
|
# pkg-config =
|
||||||
|
# testers.hasPkgConfigModules {
|
||||||
|
# package = finalPackage;
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
A derivation referencing the `dev` outputs of the Nix libraries.
|
||||||
|
*/
|
||||||
|
inherit dev;
|
||||||
|
inherit devdoc;
|
||||||
|
doc = nix-manual;
|
||||||
|
outputs = [ "out" "dev" "devdoc" "doc" ];
|
||||||
|
all = lib.attrValues (lib.genAttrs finalAttrs.passthru.outputs (outName: finalAttrs.finalPackage.${outName}));
|
||||||
|
};
|
||||||
|
meta = prevAttrs.meta // {
|
||||||
|
description = "The Nix package manager";
|
||||||
|
pkgConfigModules = dev.meta.pkgConfigModules;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue