cran-packages: restructured
This commit is contained in:
@@ -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
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user