mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 07:31:26 +00:00
Merge pull request #13463 from avnik/feature/gimp-with-plugins
Feature: gimp with plugins
This commit is contained in:
commit
35f47333d0
@ -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";
|
||||
|
@ -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 = ''
|
||||
|
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 ]; })
|
@ -12231,6 +12231,11 @@ let
|
||||
|
||||
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 {});
|
||||
|
||||
gitAndTools = recurseIntoAttrs (callPackage ../applications/version-management/git-and-tools {});
|
||||
|
Loading…
Reference in New Issue
Block a user