Wrapped R's package system similarly to perlPackages
This commit is contained in:
committed by
Peter Simons
parent
b0bf894b43
commit
fdc6e4372f
23
pkgs/development/r-modules/generic/builder.sh
Normal file
23
pkgs/development/r-modules/generic/builder.sh
Normal 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
|
||||
17
pkgs/development/r-modules/generic/default.nix
Normal file
17
pkgs/development/r-modules/generic/default.nix
Normal 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" ];
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user