gimp: add gimp-with-plugin derivation
By default all plugins from pkgs.gimpPlugins set are enabled. Default location of plugins changed from $out/${gimp.name} to $out/lib/gimp/${majorVersion}. Resulting derivation for gimp+plugins is set as search path for plugins by default (additional tweaking in gimprc done for old plugin scheme should be removed)
This commit is contained in:
parent
fdd11c2c2b
commit
0649c8bde7
@ -6,6 +6,12 @@
|
|||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "gimp-2.8.16";
|
name = "gimp-2.8.16";
|
||||||
|
|
||||||
|
# This declarations for `gimp-with-plugins` wrapper,
|
||||||
|
# (used for determining $out/lib/gimp/${majorVersion}/ paths)
|
||||||
|
majorVersion = "2.0";
|
||||||
|
targetPluginDir = "$out/lib/gimp/${majorVersion}/plug-ins";
|
||||||
|
targetScriptDir = "$out/lib/gimp/${majorVersion}/scripts";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://download.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
|
url = "http://download.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
|
||||||
sha256 = "1dsgazia9hmab8cw3iis7s69dvqyfj5wga7ds7w2q5mms1xqbqwm";
|
sha256 = "1dsgazia9hmab8cw3iis7s69dvqyfj5wga7ds7w2q5mms1xqbqwm";
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
{ pkgs, gimp }:
|
{ pkgs, gimp }:
|
||||||
let
|
let
|
||||||
inherit (pkgs) stdenv fetchurl pkgconfig glib;
|
inherit (pkgs) stdenv fetchurl pkgconfig glib;
|
||||||
targetPluginDir = "$out/${gimp.name}-plugins";
|
inherit (gimp) targetPluginDir targetScriptDir;
|
||||||
targetScriptDir = "$out/${gimp.name}-scripts";
|
|
||||||
prefix = "plugin-gimp-";
|
|
||||||
|
|
||||||
pluginDerivation = a: stdenv.mkDerivation ({
|
pluginDerivation = a: stdenv.mkDerivation ({
|
||||||
prePhases = "extraLib";
|
prePhases = "extraLib";
|
||||||
|
33
pkgs/applications/graphics/gimp/wrapper.nix
Normal file
33
pkgs/applications/graphics/gimp/wrapper.nix
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ stdenv, lib, buildEnv, gimp, makeWrapper, gimpPlugins, plugins ? null}:
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
drv = buildEnv {
|
||||||
|
name = "gimp-with-plugins-" + (builtins.parseDrvName gimp.name).version;
|
||||||
|
|
||||||
|
paths = [ gimp ] ++ selectedPlugins;
|
||||||
|
|
||||||
|
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 ${gimp}/bin/*; do
|
||||||
|
ln -s $i $out/bin
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
|
@ -12225,6 +12225,11 @@ let
|
|||||||
|
|
||||||
gimp = gimp_2_8;
|
gimp = gimp_2_8;
|
||||||
|
|
||||||
|
gimp-with-plugins = callPackage ../applications/graphics/gimp/wrapper.nix {
|
||||||
|
gimp = gimp_2_8;
|
||||||
|
plugins = null; # All packaged plugins enabled, if not explicit plugin list supplied
|
||||||
|
};
|
||||||
|
|
||||||
gimpPlugins = recurseIntoAttrs (callPackage ../applications/graphics/gimp/plugins {});
|
gimpPlugins = recurseIntoAttrs (callPackage ../applications/graphics/gimp/plugins {});
|
||||||
|
|
||||||
gitAndTools = recurseIntoAttrs (callPackage ../applications/version-management/git-and-tools {});
|
gitAndTools = recurseIntoAttrs (callPackage ../applications/version-management/git-and-tools {});
|
||||||
|
Loading…
Reference in New Issue
Block a user