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.
This commit is contained in:
parent
68398d2dd5
commit
ef156fb8ed
|
@ -1,21 +1,31 @@
|
||||||
{ runCommand, R, makeWrapper, recommendedPackages, packages }:
|
{ symlinkJoin, R, makeWrapper, recommendedPackages, packages }:
|
||||||
|
symlinkJoin {
|
||||||
runCommand (R.name + "-wrapper") {
|
name = R.name + "-wrapper";
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
allowSubstitutes = false;
|
allowSubstitutes = false;
|
||||||
|
|
||||||
buildInputs = [R] ++ recommendedPackages ++ packages;
|
buildInputs = [R] ++ recommendedPackages ++ packages;
|
||||||
|
paths = [ R ];
|
||||||
|
|
||||||
nativeBuildInputs = [makeWrapper];
|
nativeBuildInputs = [makeWrapper];
|
||||||
|
|
||||||
|
postBuild = ''
|
||||||
|
cd ${R}/bin
|
||||||
|
for exe in *; do
|
||||||
|
rm "$out/bin/$exe"
|
||||||
|
|
||||||
|
makeWrapper "${R}/bin/$exe" "$out/bin/$exe" \
|
||||||
|
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
# Make the list of recommended R packages accessible to other packages such as rpy2
|
# Make the list of recommended R packages accessible to other packages such as rpy2
|
||||||
passthru = { inherit recommendedPackages; };
|
passthru = { inherit recommendedPackages; };
|
||||||
|
|
||||||
|
meta = R.meta // {
|
||||||
|
# To prevent builds on hydra
|
||||||
|
hydraPlatforms = [];
|
||||||
|
# prefer wrapper over the package
|
||||||
|
priority = (R.meta.priority or 0) - 1;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
''
|
|
||||||
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
|
|
||||||
''
|
|
||||||
|
|
Loading…
Reference in a new issue