mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
29969a5ec7
This attempts to fix the issue described at https://github.com/NixOS/nixpkgs/pull/22219#issuecomment-291801133. Any change to the custom packages passed to RStudio causes this to completely rebuild RStudio, which is completely unnecessary and also a bit of a hindrance as it's a fairly slow build. This rolls back most of that old PR, and instead implements something more like rWrapper. Existing configurations with the old useRPackages will break.
23 lines
458 B
Nix
23 lines
458 B
Nix
{ stdenv, R, makeWrapper, recommendedPackages, packages }:
|
|
|
|
stdenv.mkDerivation {
|
|
name = R.name + "-wrapper";
|
|
|
|
buildInputs = [makeWrapper R] ++ recommendedPackages ++ packages;
|
|
|
|
unpackPhase = ":";
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cd ${R}/bin
|
|
for exe in *; do
|
|
makeWrapper ${R}/bin/$exe $out/bin/$exe \
|
|
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
|
|
done
|
|
'';
|
|
|
|
meta = {
|
|
platforms = stdenv.lib.platforms.unix;
|
|
};
|
|
}
|