mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 14:43:37 +00:00
468cb5980b
Since GNOME version is now 40, it no longer makes sense to use the old attribute name.
31 lines
1009 B
Nix
31 lines
1009 B
Nix
{ lib, symlinkJoin, glimpse, makeWrapper, glimpsePlugins, gnome, plugins ? null }:
|
|
|
|
let
|
|
allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues glimpsePlugins);
|
|
selectedPlugins = if plugins == null then allPlugins else plugins;
|
|
extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
|
|
versionBranch = lib.versions.majorMinor glimpse.version;
|
|
|
|
in
|
|
symlinkJoin {
|
|
name = "glimpse-with-plugins-${glimpse.version}";
|
|
|
|
paths = [ glimpse ] ++ selectedPlugins;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
postBuild = ''
|
|
for each in glimpse-${versionBranch} glimpse-console-${versionBranch}; do
|
|
wrapProgram $out/bin/$each \
|
|
--set GIMP2_PLUGINDIR "$out/lib/glimpse/2.0" \
|
|
--set GIMP2_DATADIR "$out/share/glimpse/2.0" \
|
|
--prefix GTK_PATH : "${gnome.gnome-themes-extra}/lib/gtk-2.0" \
|
|
${toString extraArgs}
|
|
done
|
|
|
|
for each in glimpse glimpse-console; do
|
|
ln -sf "$each-${versionBranch}" $out/bin/$each
|
|
done
|
|
'';
|
|
}
|