cran-packages: restructured

This commit is contained in:
taku0
2014-12-03 16:28:28 +01:00
committed by Peter Simons
parent e125997df6
commit 2a1d9ddbf2
28 changed files with 7317 additions and 6034 deletions
+15 -3
View File
@@ -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
'';