git.iko.soy/typeable/nixpkgs
on master help sign in
rWrapper: use symlinkJoin instead of runCommand

While trying to build a haskell-project I got: Configuring library for inline-r-0.10.4.. cabal: The pkg-config package 'libR' version ==3.0 || >3.0 is required but it could not be found. the rWrapper was only bringing the R binary without its companion library: this fixes it.

commitef156fb8eda84d192b7af389528edeae50e5ca8b authorMatthieu Coudron <mcoudron@hotmail.com> dateMon 18 Jan 2021, 10:29 (6 years ago) parent68398d2
1 file changed+21−11
pkgs/development/r-modules/wrapper.nix+21−11
pkgs/development/r-modules/wrapper.nix+21−11
@@ -1,21 +1,31 @@
1−{ runCommand, R, makeWrapper, recommendedPackages, packages }:
2−
3−runCommand (R.name + "-wrapper") {
1+{ symlinkJoin, R, makeWrapper, recommendedPackages, packages }:
2+symlinkJoin {
3+ name = R.name + "-wrapper";
44 preferLocalBuild = true;
55 allowSubstitutes = false;
66
77 buildInputs = [R] ++ recommendedPackages ++ packages;
8+ paths = [ R ];
89
910 nativeBuildInputs = [makeWrapper];
1011
12+ postBuild = ''
13+ cd ${R}/bin
14+ for exe in *; do
15+ rm "$out/bin/$exe"
16+
17+ makeWrapper "${R}/bin/$exe" "$out/bin/$exe" \
18+ --prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
19+ done
20+ '';
21+
1122 # Make the list of recommended R packages accessible to other packages such as rpy2
1223 passthru = { inherit recommendedPackages; };
24+
25+ meta = R.meta // {
26+ # To prevent builds on hydra
27+ hydraPlatforms = [];
28+ # prefer wrapper over the package
29+ priority = (R.meta.priority or 0) - 1;
30+ };
1331}
14−''
15−mkdir -p $out/bin
16−cd ${R}/bin
17−for exe in *; do
18− makeWrapper ${R}/bin/$exe $out/bin/$exe \
19− --prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
20−done
21−''