diff options
author | zimbatm <zimbatm@zimbatm.com> | 2016-02-25 23:27:25 +0000 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2016-02-25 23:27:25 +0000 |
commit | 35f47333d0a291e8173d7c9380d1e1a77080c493 (patch) | |
tree | 471f689ee732ab8141c9ed7ce5baf7556dd3d714 /pkgs/applications/graphics | |
parent | 0b33cd7b59d894e61b0c58296cdc518c23ea425c (diff) | |
parent | 0649c8bde74d5e0e2036a66f0cab72b9de777617 (diff) | |
download | nixlib-35f47333d0a291e8173d7c9380d1e1a77080c493.tar nixlib-35f47333d0a291e8173d7c9380d1e1a77080c493.tar.gz nixlib-35f47333d0a291e8173d7c9380d1e1a77080c493.tar.bz2 nixlib-35f47333d0a291e8173d7c9380d1e1a77080c493.tar.lz nixlib-35f47333d0a291e8173d7c9380d1e1a77080c493.tar.xz nixlib-35f47333d0a291e8173d7c9380d1e1a77080c493.tar.zst nixlib-35f47333d0a291e8173d7c9380d1e1a77080c493.zip |
Merge pull request #13463 from avnik/feature/gimp-with-plugins
Feature: gimp with plugins
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r-- | pkgs/applications/graphics/gimp/2.8.nix | 6 | ||||
-rw-r--r-- | pkgs/applications/graphics/gimp/plugins/default.nix | 6 | ||||
-rw-r--r-- | pkgs/applications/graphics/gimp/wrapper.nix | 33 |
3 files changed, 41 insertions, 4 deletions
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix index 96d6dbd52857..55e85fc5ec6b 100644 --- a/pkgs/applications/graphics/gimp/2.8.nix +++ b/pkgs/applications/graphics/gimp/2.8.nix @@ -6,6 +6,12 @@ stdenv.mkDerivation rec { 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 { url = "http://download.gimp.org/pub/gimp/v2.8/${name}.tar.bz2"; sha256 = "1dsgazia9hmab8cw3iis7s69dvqyfj5wga7ds7w2q5mms1xqbqwm"; diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix index 702911fee744..4084018d1d53 100644 --- a/pkgs/applications/graphics/gimp/plugins/default.nix +++ b/pkgs/applications/graphics/gimp/plugins/default.nix @@ -6,9 +6,7 @@ { pkgs, gimp }: let inherit (pkgs) stdenv fetchurl pkgconfig glib; - targetPluginDir = "$out/${gimp.name}-plugins"; - targetScriptDir = "$out/${gimp.name}-scripts"; - prefix = "plugin-gimp-"; + inherit (gimp) targetPluginDir targetScriptDir; pluginDerivation = a: stdenv.mkDerivation ({ prePhases = "extraLib"; @@ -52,7 +50,7 @@ rec { name = "gap-2.6.0"; buildInputs = [ gimp pkgconfig glib pkgs.intltool gimp.gtk ] ++ gimp.nativeBuildInputs; src = fetchurl { - url = ftp://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2; + url = http://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2; sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql"; }; patchPhase = '' diff --git a/pkgs/applications/graphics/gimp/wrapper.nix b/pkgs/applications/graphics/gimp/wrapper.nix new file mode 100644 index 000000000000..53067dc39c9a --- /dev/null +++ b/pkgs/applications/graphics/gimp/wrapper.nix @@ -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 ]; }) |