2021-05-07 22:18:14 +01:00
|
|
|
{ lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, gnome, plugins ? null}:
|
2016-02-25 21:24:45 +00:00
|
|
|
|
|
|
|
let
|
2019-08-31 05:50:22 +01:00
|
|
|
allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues gimpPlugins);
|
2020-11-11 13:33:49 +00:00
|
|
|
selectedPlugins = lib.filter (pkg: pkg != gimpPlugins.gimp) (if plugins == null then allPlugins else plugins);
|
2016-02-25 21:24:45 +00:00
|
|
|
extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
|
2021-01-15 13:21:58 +00:00
|
|
|
versionBranch = lib.versions.majorMinor gimp.version;
|
2016-02-25 21:24:45 +00:00
|
|
|
|
2016-04-26 13:26:45 +01:00
|
|
|
in symlinkJoin {
|
|
|
|
name = "gimp-with-plugins-${gimp.version}";
|
2016-02-25 21:24:45 +00:00
|
|
|
|
|
|
|
paths = [ gimp ] ++ selectedPlugins;
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2016-04-26 13:26:45 +01:00
|
|
|
|
2016-02-25 21:24:45 +00:00
|
|
|
postBuild = ''
|
2017-12-22 07:59:08 +00:00
|
|
|
for each in gimp-${versionBranch} gimp-console-${versionBranch}; do
|
2016-02-25 21:24:45 +00:00
|
|
|
wrapProgram $out/bin/$each \
|
|
|
|
--set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
|
2019-11-02 14:42:33 +00:00
|
|
|
--set GIMP2_DATADIR "$out/share/gimp/2.0" \
|
2021-05-07 22:18:14 +01:00
|
|
|
--prefix GTK_PATH : "${gnome.gnome-themes-extra}/lib/gtk-2.0" \
|
2016-02-25 21:24:45 +00:00
|
|
|
${toString extraArgs}
|
|
|
|
done
|
|
|
|
set +x
|
|
|
|
for each in gimp gimp-console; do
|
2017-12-22 07:59:08 +00:00
|
|
|
ln -sf "$each-${versionBranch}" $out/bin/$each
|
2016-02-25 21:24:45 +00:00
|
|
|
done
|
|
|
|
'';
|
2022-03-06 17:40:06 +00:00
|
|
|
|
|
|
|
inherit (gimp) meta;
|
2016-04-26 13:26:45 +01:00
|
|
|
}
|