2023-03-24 00:07:29 +00:00
|
|
|
{ lib, symlinkJoin, makeWrapper, gimpPlugins, gnome, plugins ? null}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2023-03-24 00:07:29 +00:00
|
|
|
inherit (gimpPlugins) gimp;
|
2020-04-24 23:36:52 +00:00
|
|
|
allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues gimpPlugins);
|
2023-03-24 00:07:29 +00:00
|
|
|
selectedPlugins = lib.filter (pkg: pkg != gimp) (if plugins == null then allPlugins else plugins);
|
2020-04-24 23:36:52 +00:00
|
|
|
extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
|
2021-01-17 00:15:33 +00:00
|
|
|
versionBranch = lib.versions.majorMinor gimp.version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
in symlinkJoin {
|
|
|
|
name = "gimp-with-plugins-${gimp.version}";
|
|
|
|
|
|
|
|
paths = [ gimp ] ++ selectedPlugins;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
for each in gimp-${versionBranch} gimp-console-${versionBranch}; do
|
|
|
|
wrapProgram $out/bin/$each \
|
|
|
|
--set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
|
|
|
|
--set GIMP2_DATADIR "$out/share/gimp/2.0" \
|
2021-05-20 23:08:51 +00:00
|
|
|
--prefix GTK_PATH : "${gnome.gnome-themes-extra}/lib/gtk-2.0" \
|
2020-04-24 23:36:52 +00:00
|
|
|
${toString extraArgs}
|
|
|
|
done
|
|
|
|
set +x
|
|
|
|
for each in gimp gimp-console; do
|
|
|
|
ln -sf "$each-${versionBranch}" $out/bin/$each
|
|
|
|
done
|
|
|
|
'';
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
inherit (gimp) meta;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|