mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
rPackages: introduce packagesRequiringHome override
Some R packages require access to a home directory to pass install tests. Extend r-modules to allow creating a temporary home directory for packages with such requirements.
This commit is contained in:
parent
40f95ae12a
commit
c417b44d83
@ -158,6 +158,38 @@ let
|
||||
in
|
||||
builtins.listToAttrs nameValuePairs;
|
||||
|
||||
# Overrides package definition requiring a home directory to install or to
|
||||
# run tests.
|
||||
# For example,
|
||||
#
|
||||
# overrideRequireHome [
|
||||
# "foo"
|
||||
# ] old
|
||||
#
|
||||
# results in
|
||||
#
|
||||
# {
|
||||
# foo = old.foo.overrideAttrs (oldAttrs: {
|
||||
# preInstall = ''
|
||||
# ${oldAttrs.preInstall or ""}
|
||||
# export HOME=$(mktemp -d)
|
||||
# '';
|
||||
# });
|
||||
# }
|
||||
overrideRequireHome = packageNames: old:
|
||||
let
|
||||
nameValuePairs = map (name: {
|
||||
inherit name;
|
||||
value = (builtins.getAttr name old).overrideAttrs (oldAttrs: {
|
||||
preInstall = ''
|
||||
${oldAttrs.preInstall or ""}
|
||||
export HOME=$(mktemp -d)
|
||||
'';
|
||||
});
|
||||
}) packageNames;
|
||||
in
|
||||
builtins.listToAttrs nameValuePairs;
|
||||
|
||||
# Overrides package definition to skip check.
|
||||
# For example,
|
||||
#
|
||||
@ -211,13 +243,14 @@ let
|
||||
defaultOverrides = old: new:
|
||||
let old0 = old; in
|
||||
let
|
||||
old1 = old0 // (overrideRequireX packagesRequireingX old0);
|
||||
old2 = old1 // (overrideSkipCheck packagesToSkipCheck old1);
|
||||
old3 = old2 // (overrideRDepends packagesWithRDepends old2);
|
||||
old4 = old3 // (overrideNativeBuildInputs packagesWithNativeBuildInputs old3);
|
||||
old5 = old4 // (overrideBuildInputs packagesWithBuildInputs old4);
|
||||
old6 = old5 // (overrideBroken brokenPackages old5);
|
||||
old = old6;
|
||||
old1 = old0 // (overrideRequireX packagesRequiringX old0);
|
||||
old2 = old1 // (overrideRequireHome packagesRequiringHome old1);
|
||||
old3 = old2 // (overrideSkipCheck packagesToSkipCheck old2);
|
||||
old4 = old3 // (overrideRDepends packagesWithRDepends old3);
|
||||
old5 = old4 // (overrideNativeBuildInputs packagesWithNativeBuildInputs old4);
|
||||
old6 = old5 // (overrideBuildInputs packagesWithBuildInputs old5);
|
||||
old7 = old6 // (overrideBroken brokenPackages old6);
|
||||
old = old7;
|
||||
in old // (otherOverrides old new);
|
||||
|
||||
# Recursive override pattern.
|
||||
@ -480,7 +513,7 @@ let
|
||||
csaw = with pkgs; [ zlib.dev curl ];
|
||||
};
|
||||
|
||||
packagesRequireingX = [
|
||||
packagesRequiringX = [
|
||||
"accrual"
|
||||
"ade4TkGUI"
|
||||
"analogue"
|
||||
@ -670,6 +703,9 @@ let
|
||||
"x12GUI"
|
||||
];
|
||||
|
||||
packagesRequiringHome = [
|
||||
];
|
||||
|
||||
packagesToSkipCheck = [
|
||||
"Rmpi" # tries to run MPI processes
|
||||
"pbdMPI" # tries to run MPI processes
|
||||
|
Loading…
Reference in New Issue
Block a user