2016-04-26 12:26:45 +00:00
|
|
|
{ stdenv, lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, plugins ? null}:
|
2016-02-25 21:24:45 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
allPlugins = lib.filter (pkg: builtins.isAttrs pkg && pkg.type == "derivation") (lib.attrValues gimpPlugins);
|
|
|
|
selectedPlugins = if plugins == null then allPlugins else plugins;
|
|
|
|
extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
|
|
|
|
|
2016-04-26 12:26:45 +00:00
|
|
|
in symlinkJoin {
|
|
|
|
name = "gimp-with-plugins-${gimp.version}";
|
2016-02-25 21:24:45 +00:00
|
|
|
|
|
|
|
paths = [ gimp ] ++ selectedPlugins;
|
|
|
|
|
2016-04-26 12:26:45 +00:00
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
2016-02-25 21:24:45 +00:00
|
|
|
postBuild = ''
|
|
|
|
for each in gimp-2.8 gimp-console-2.8; do
|
|
|
|
wrapProgram $out/bin/$each \
|
|
|
|
--set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
|
|
|
|
${toString extraArgs}
|
|
|
|
done
|
|
|
|
set +x
|
|
|
|
for each in gimp gimp-console; do
|
|
|
|
ln -sf "$each-2.8" $out/bin/$each
|
|
|
|
done
|
|
|
|
'';
|
2016-04-26 12:26:45 +00:00
|
|
|
}
|