Wrapped R's package system similarly to perlPackages

This commit is contained in:
Justin Bedo
2013-09-20 09:26:07 +10:00
committed by Peter Simons
parent b0bf894b43
commit fdc6e4372f
7 changed files with 397 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
source $stdenv/setup
export R_LIBS_SITE="$R_LIBS_SITE${R_LIBS_SITE:+:}$out/library"
if test -n "$rPreHook"; then
eval "$rPreHook"
fi
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
}
genericBuild

View File

@@ -0,0 +1,17 @@
R:
{ buildInputs ? [], ... } @ attrs:
R.stdenv.mkDerivation (
{
}
//
attrs
//
{
name = "r-" + attrs.name;
builder = ./builder.sh;
buildInputs = buildInputs ++ [ R ];
phases = [ "installPhase" "fixupPhase" ];
}
)