mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 12:42:24 +00:00
34 lines
706 B
Nix
34 lines
706 B
Nix
|
R:
|
||
|
|
||
|
{ name, buildInputs ? [], ... } @ attrs:
|
||
|
|
||
|
R.stdenv.mkDerivation ({
|
||
|
name = "r-" + name;
|
||
|
|
||
|
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
|
||
|
R CMD INSTALL -l $out/library $src
|
||
|
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
|
||
|
'';
|
||
|
} // attrs)
|