3
0
Fork 0
forked from mirrors/nixpkgs

puredata-with-plugins: use symlinkJoin

This commit is contained in:
Nikolay Amiantov 2016-04-26 15:26:23 +03:00
parent 5690c6ca07
commit 41b6a17826

View file

@ -1,23 +1,16 @@
{ stdenv, buildEnv, puredata, makeWrapper, plugins }:
{ stdenv, symlinkJoin, puredata, makeWrapper, plugins }:
let
puredataFlags = map (x: "-path ${x}/") plugins;
drv = buildEnv {
name = "puredata-with-plugins-" + (builtins.parseDrvName puredata.name).version;
in symlinkJoin {
name = "puredata-with-plugins-${puredata.version}";
paths = [ puredata ] ++ plugins;
buildInputs = [ makeWrapper ];
postBuild = ''
# TODO: This could be avoided if buildEnv could be forced to create all directories
if [ -L $out/bin ]; then
rm $out/bin
mkdir $out/bin
for i in ${puredata}/bin/*; do
ln -s $i $out/bin
done
fi
wrapProgram $out/bin/pd \
--add-flags "${toString puredataFlags}"
'';
};
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
}