aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/r-modules/generic-builder.nix
diff options
context:
space:
mode:
authortaku0 <mxxouy6x3m_github@tatapa.org>2014-11-21 22:23:36 +0900
committerPeter Simons <simons@cryp.to>2014-12-03 16:28:28 +0100
commit2a1d9ddbf28799831f3a4e531c4dca974b3d7fd3 (patch)
tree25066c96cdc2bd0d5243f88b64945fd22b63eb04 /pkgs/development/r-modules/generic-builder.nix
parente125997df65f6c6015fd1ef1adc151a09b34c326 (diff)
cran-packages: restructured
Diffstat (limited to 'pkgs/development/r-modules/generic-builder.nix')
-rw-r--r--pkgs/development/r-modules/generic-builder.nix18
1 files changed, 15 insertions, 3 deletions
diff --git a/pkgs/development/r-modules/generic-builder.nix b/pkgs/development/r-modules/generic-builder.nix
index da63566f38bc..72602d1af0f1 100644
--- a/pkgs/development/r-modules/generic-builder.nix
+++ b/pkgs/development/r-modules/generic-builder.nix
@@ -1,9 +1,9 @@
-R:
+{ R, xvfb_run, utillinux }:
{ name, buildInputs ? [], ... } @ attrs:
R.stdenv.mkDerivation ({
- buildInputs = buildInputs ++ [R];
+ buildInputs = buildInputs ++ [R xvfb_run utillinux];
configurePhase = ''
runHook preConfigure
@@ -16,10 +16,22 @@ R.stdenv.mkDerivation ({
runHook postBuild
'';
+ installOptions = if attrs.skipTest or false then
+ "--no-test-load "
+ else
+ "";
+
+ rCommand = if attrs.requireX or false then
+ # Unfortunately, xvfb-run has a race condition even with -a option, so that
+ # we acquire a lock explicitly.
+ "flock ${xvfb_run} xvfb-run -a -e xvfb-error R"
+ else
+ "R";
+
installPhase = ''
runHook preInstall
mkdir -p $out/library
- R CMD INSTALL -l $out/library .
+ $rCommand CMD INSTALL $installOptions --configure-args="$configureFlags" -l $out/library .
runHook postInstall
'';