From 8f0d6091bb45bb44f566518f158c29d11e50f9b3 Mon Sep 17 00:00:00 2001 From: taku0 Date: Mon, 24 Nov 2014 15:29:56 +0900 Subject: [PATCH] cran-packages: uses common variable names, doCheck and installFlags --- pkgs/development/r-modules/cran-packages.nix | 18 +++++++++--------- pkgs/development/r-modules/generic-builder.nix | 12 ++++++++---- ...ip-tests.nix => packages-to-skip-check.nix} | 0 3 files changed, 17 insertions(+), 13 deletions(-) rename pkgs/development/r-modules/{packages-to-skip-tests.nix => packages-to-skip-check.nix} (100%) diff --git a/pkgs/development/r-modules/cran-packages.nix b/pkgs/development/r-modules/cran-packages.nix index c58242c9424d..c4a7c08c7122 100644 --- a/pkgs/development/r-modules/cran-packages.nix +++ b/pkgs/development/r-modules/cran-packages.nix @@ -11,7 +11,7 @@ let # # some packages, e.g. cncaGUI, require X running while installation, # so that we use xvfb-run if requireX is true. - derive = lib.makeOverridable ({ name, version, sha256, depends ? [], skipTest ? false, requireX ? false, hydraPlatforms ? R.meta.hydraPlatforms }: buildRPackage { + derive = lib.makeOverridable ({ name, version, sha256, depends ? [], doCheck ? true, requireX ? false, hydraPlatforms ? R.meta.hydraPlatforms }: buildRPackage { name = "${name}-${version}"; src = fetchurl { urls = [ @@ -20,7 +20,7 @@ let ]; inherit sha256; }; - inherit skipTest requireX; + inherit doCheck requireX; propagatedBuildInputs = depends; nativeBuildInputs = depends; meta.homepage = "http://cran.r-project.org/web/packages/${name}/"; @@ -106,10 +106,10 @@ let in builtins.listToAttrs nameValuePairs; - # Overrides package definition to skip tests. + # Overrides package definition to skip check. # For example, # - # overrideSkipTests [ + # overrideSkipCheck [ # "foo" # ] old # @@ -117,15 +117,15 @@ let # # { # foo = old.foo.override { - # skipTest = true; + # doCheck = false; # }; # } - overrideSkipTests = packageNames: old: + overrideSkipCheck = packageNames: old: let nameValuePairs = map (name: { inherit name; value = (builtins.getAttr name old).override { - skipTest = true; + doCheck = false; }; }) packageNames; in @@ -134,13 +134,13 @@ let packagesWithNativeBuildInputs = import ./packages-with-native-build-inputs.nix pkgs; packagesWithBuildInputs = import ./packages-with-build-inputs.nix pkgs; packagesRequireingX = import ./packages-requireing-x.nix; - packagesToSkipTests = import ./packages-to-skip-tests.nix; + packagesToSkipCheck = import ./packages-to-skip-check.nix; defaultOverrides = old: new: let old0 = old; in let old1 = old0 // (overrideRequireX packagesRequireingX old0); - old2 = old1 // (overrideSkipTests packagesToSkipTests old1); + old2 = old1 // (overrideSkipCheck packagesToSkipCheck old1); old3 = old2 // (overrideNativeBuildInputs packagesWithNativeBuildInputs old2); old4 = old3 // (overrideBuildInputs packagesWithBuildInputs old3); old = old4; diff --git a/pkgs/development/r-modules/generic-builder.nix b/pkgs/development/r-modules/generic-builder.nix index 72602d1af0f1..bca7c10e0fd2 100644 --- a/pkgs/development/r-modules/generic-builder.nix +++ b/pkgs/development/r-modules/generic-builder.nix @@ -16,10 +16,10 @@ R.stdenv.mkDerivation ({ runHook postBuild ''; - installOptions = if attrs.skipTest or false then - "--no-test-load " + installFlags = if attrs.doCheck or true then + [] else - ""; + [ "--no-test-load" ]; rCommand = if attrs.requireX or false then # Unfortunately, xvfb-run has a race condition even with -a option, so that @@ -31,7 +31,7 @@ R.stdenv.mkDerivation ({ installPhase = '' runHook preInstall mkdir -p $out/library - $rCommand CMD INSTALL $installOptions --configure-args="$configureFlags" -l $out/library . + $rCommand CMD INSTALL $installFlags --configure-args="$configureFlags" -l $out/library . runHook postInstall ''; @@ -40,6 +40,10 @@ R.stdenv.mkDerivation ({ ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages fi ''; + + checkPhase = '' + # noop since R CMD INSTALL tests packages + ''; } // attrs // { name = "r-" + name; }) diff --git a/pkgs/development/r-modules/packages-to-skip-tests.nix b/pkgs/development/r-modules/packages-to-skip-check.nix similarity index 100% rename from pkgs/development/r-modules/packages-to-skip-tests.nix rename to pkgs/development/r-modules/packages-to-skip-check.nix