2014-05-04 23:54:11 +02:00
|
|
|
R:
|
|
|
|
|
|
|
|
{ name, buildInputs ? [], ... } @ attrs:
|
|
|
|
|
|
|
|
R.stdenv.mkDerivation ({
|
|
|
|
buildInputs = buildInputs ++ [R];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
export R_LIBS_SITE="$R_LIBS_SITE''${R_LIBS_SITE:+:}$out/library"
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/library
|
2014-05-07 12:28:46 +02:00
|
|
|
R CMD INSTALL -l $out/library .
|
2014-05-04 23:54:11 +02:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
if test -e $out/nix-support/propagated-native-build-inputs; then
|
|
|
|
ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
|
|
|
|
fi
|
|
|
|
'';
|
2014-05-05 00:32:45 +02:00
|
|
|
} // attrs // {
|
|
|
|
name = "r-" + name;
|
|
|
|
})
|