about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/gimp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/graphics/gimp')
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/default.nix88
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix246
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch200
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch13
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix28
5 files changed, 575 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/default.nix b/nixpkgs/pkgs/applications/graphics/gimp/default.nix
new file mode 100644
index 000000000000..657a9dd27e50
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/default.nix
@@ -0,0 +1,88 @@
+{ stdenv, fetchurl, substituteAll, pkgconfig, intltool, babl, gegl, gtk2, glib, gdk_pixbuf, isocodes
+, pango, cairo, freetype, fontconfig, lcms, libpng, libjpeg, poppler, poppler_data, libtiff
+, libmng, librsvg, libwmf, zlib, libzip, ghostscript, aalib, shared-mime-info
+, python2Packages, libexif, gettext, xorg, glib-networking, libmypaint, gexiv2
+, harfbuzz, mypaint-brushes, libwebp, libheif, libgudev, openexr
+, AppKit, Cocoa, gtk-mac-integration-gtk2, cf-private }:
+
+let
+  inherit (python2Packages) pygtk wrapPython python;
+in stdenv.mkDerivation rec {
+  pname = "gimp";
+  version = "2.10.10";
+
+  src = fetchurl {
+    url = "http://download.gimp.org/pub/gimp/v${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    sha256 = "0xwck5nbpb945s1cyij3kfqw1pchbhx8i5vf5hgywyjw4r1z5l8j";
+  };
+
+  nativeBuildInputs = [ pkgconfig intltool gettext wrapPython ];
+  propagatedBuildInputs = [ gegl ]; # needed by gimp-2.0.pc
+  buildInputs = [
+    babl gegl gtk2 glib gdk_pixbuf pango cairo gexiv2 harfbuzz isocodes
+    freetype fontconfig lcms libpng libjpeg poppler poppler_data libtiff openexr
+    libmng librsvg libwmf zlib libzip ghostscript aalib shared-mime-info libwebp libheif
+    python pygtk libexif xorg.libXpm glib-networking libmypaint mypaint-brushes
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    # cf-private is needed to get some things not in swift-corefoundation.
+    # For instance _OBJC_CLASS_$_NSArray is missing.
+    AppKit Cocoa gtk-mac-integration-gtk2 cf-private
+  ] ++ stdenv.lib.optionals stdenv.isLinux [ libgudev ];
+
+  pythonPath = [ pygtk ];
+
+  # Check if librsvg was built with --disable-pixbuf-loader.
+  PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk_pixbuf.moduleDir}";
+
+  preConfigure = ''
+    # The check runs before glib-networking is registered
+    export GIO_EXTRA_MODULES="${glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES"
+  '';
+
+  patches = [
+    # to remove compiler from the runtime closure, reference was retained via
+    # gimp --version --verbose output
+    (substituteAll {
+      src = ./remove-cc-reference.patch;
+      cc_version = stdenv.cc.cc.name;
+    })
+  ];
+
+  postFixup = ''
+    wrapPythonProgramsIn $out/lib/gimp/${passthru.majorVersion}/plug-ins/
+    wrapProgram $out/bin/gimp-${stdenv.lib.versions.majorMinor version} \
+      --prefix PYTHONPATH : "$PYTHONPATH" \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
+  '';
+
+  passthru = rec {
+    # The declarations for `gimp-with-plugins` wrapper,
+    # used for determining plug-in installation paths
+    majorVersion = "${stdenv.lib.versions.major version}.0";
+    targetPluginDir = "lib/gimp/${majorVersion}/plug-ins";
+    targetScriptDir = "lib/gimp/${majorVersion}/scripts";
+
+    # probably its a good idea to use the same gtk in plugins ?
+    gtk = gtk2;
+  };
+
+  configureFlags = [
+    "--without-webkit" # old version is required
+    "--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
+    "--with-icc-directory=/run/current-system/sw/share/color/icc"
+  ];
+
+  # on Darwin,
+  # test-eevl.c:64:36: error: initializer element is not a compile-time constant
+  doCheck = !stdenv.isDarwin;
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "The GNU Image Manipulation Program";
+    homepage = https://www.gimp.org/;
+    maintainers = with maintainers; [ jtojnar ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix b/nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix
new file mode 100644
index 000000000000..714a1f921d62
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -0,0 +1,246 @@
+# install these packages into your profile. Then add
+# ~/.nix-profile/gimp-version-plugins to your plugin list you can find at
+# preferences -> Folders -> Plug-ins
+# same applies for the scripts
+
+{ pkgs, gimp }:
+let
+  inherit (pkgs) stdenv fetchurl pkgconfig intltool glib fetchFromGitHub;
+  inherit (gimp) targetPluginDir targetScriptDir;
+
+  pluginDerivation = a: stdenv.mkDerivation ({
+    prePhases = "extraLib";
+    extraLib = ''
+      installScripts(){
+        mkdir -p $out/${targetScriptDir};
+        for p in "$@"; do cp "$p" $out/${targetScriptDir}; done
+      }
+      installPlugins(){
+        mkdir -p $out/${targetPluginDir};
+        for p in "$@"; do cp "$p" $out/${targetPluginDir}; done
+      }
+    '';
+  }
+  // a
+  // {
+      name = "gimp-plugin-${a.name or "${a.pname}-${a.version}"}";
+      buildInputs = [ gimp gimp.gtk glib ] ++ (a.buildInputs or []);
+      nativeBuildInputs = [ pkgconfig intltool ] ++ (a.nativeBuildInputs or []);
+    }
+  );
+
+  scriptDerivation = {name, src} : pluginDerivation {
+    inherit name; phases = "extraLib installPhase";
+    installPhase = "installScripts ${src}";
+  };
+
+in
+rec {
+  gap = pluginDerivation {
+    /* menu:
+       Video
+    */
+    name = "gap-2.6.0";
+    src = fetchurl {
+      url = https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
+      sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
+    };
+    patchPhase = ''
+      sed -e 's,^\(GIMP_PLUGIN_DIR=\).*,\1'"$out/${gimp.name}-plugins", \
+       -e 's,^\(GIMP_DATA_DIR=\).*,\1'"$out/share/${gimp.name}", -i configure
+    '';
+    hardeningDisable = [ "format" ];
+    meta = with stdenv.lib; {
+      description = "The GIMP Animation Package";
+      homepage = https://www.gimp.org;
+      # The main code is given in GPLv3, but it has ffmpeg in it, and I think ffmpeg license
+      # falls inside "free".
+      license = with licenses; [ gpl3 free ];
+    };
+  };
+
+  fourier = pluginDerivation rec {
+    /* menu:
+       Filters/Generic/FFT Forward
+       Filters/Generic/FFT Inverse
+    */
+    name = "fourier-0.4.1";
+    buildInputs = with pkgs; [ fftw ];
+    postInstall = "fail";
+    installPhase = "installPlugins fourier";
+    src = fetchurl {
+      url = "http://registry.gimp.org/files/${name}.tar.gz";
+      sha256 = "1pr3y3zl9w8xs1circdrxpr98myz9m8wfzy022al79z4pdanwvs1";
+    };
+  };
+
+  focusblur = pluginDerivation rec {
+    /* menu:
+       Blur/Focus Blur
+    */
+    name = "focusblur-3.2.6";
+    buildInputs = with pkgs; [ fftwSinglePrec ];
+    patches = [ ./patches/focusblur-glib.patch ];
+    postInstall = "fail";
+    installPhase = "installPlugins src/focusblur";
+    src = fetchurl {
+      url = "http://registry.gimp.org/files/${name}.tar.bz2";
+      sha256 = "1gqf3hchz7n7v5kpqkhqh8kwnxbsvlb5cr2w2n7ngrvl56f5xs1h";
+    };
+    meta.broken = true;
+  };
+
+  resynthesizer = pluginDerivation {
+    /* menu:
+      Filters/Map/Resynthesize
+      Filters/Enhance/Smart enlarge
+      Filters/Enhance/Smart sharpen
+      Filters/Enhance/Smart remove selection
+    */
+    name = "resynthesizer-0.16";
+    buildInputs = with pkgs; [ fftw ];
+    src = fetchurl {
+      url = http://www.logarithmic.net/pfh-files/resynthesizer/resynthesizer-0.16.tar.gz;
+      sha256 = "1k90a1jzswxmajn56rdxa4r60v9v34fmqsiwfdxqcvx3yf4yq96x";
+    };
+
+    installPhase = "
+      installPlugins resynth
+      installScripts smart-{enlarge,remove}.scm
+    ";
+  };
+
+  resynthesizer2 = pluginDerivation rec {
+    /* menu:
+      Filters/Map/Resynthesize
+      Filters/Enhance/Smart enlarge
+      Filters/Enhance/Smart sharpen
+      Filters/Enhance/Smart remove selection
+    */
+    pname = "resynthesizer";
+    version = "2.0.3";
+    buildInputs = with pkgs; [ fftw ];
+    nativeBuildInputs = with pkgs; [ autoreconfHook ];
+    makeFlags = [ "GIMP_LIBDIR=${placeholder "out"}/lib/gimp/2.0" ];
+    src = fetchFromGitHub {
+      owner = "bootchk";
+      repo = "resynthesizer";
+      rev = "v${version}";
+      sha256 = "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j";
+    };
+  };
+
+  texturize = pluginDerivation {
+    name = "texturize-2.2.2017-07-28";
+    src = fetchFromGitHub {
+      owner = "lmanul";
+      repo = "gimp-texturize";
+      rev = "de4367f71e40fe6d82387eaee68611a80a87e0e1";
+      sha256 = "1zzvbczly7k456c0y6s92a1i8ph4ywmbvdl8i4rcc29l4qd2z8fw";
+    };
+    installPhase = "installPlugins src/texturize";
+    meta.broken = true; # https://github.com/lmanul/gimp-texturize/issues/1
+  };
+
+  waveletSharpen = pluginDerivation {
+    /* menu:
+      Filters/Enhance/Wavelet sharpen
+    */
+    name = "wavelet-sharpen-0.1.2";
+    src = fetchurl {
+      url = http://registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz;
+      sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
+    };
+    installPhase = "installPlugins src/wavelet-sharpen"; # TODO translations are not copied .. How to do this on nix?
+  };
+
+  lqrPlugin = pluginDerivation {
+    /* menu:
+       Layer/Liquid Rescale
+    */
+    name = "lqr-plugin-0.6.1";
+    buildInputs = with pkgs; [ liblqr1 ];
+    src = fetchurl {
+      url = http://registry.gimp.org/files/gimp-lqr-plugin-0.6.1.tar.bz2;
+      sha256 = "00hklkpcimcbpjly4rjhfipaw096cpy768g9wixglwrsyqhil7l9";
+    };
+    #postInstall = ''mkdir -p $out/nix-support; echo "${liblqr1}" > "$out/nix-support/propagated-user-env-packages"'';
+    installPhase = "installPlugins src/gimp-lqr-plugin";
+  };
+
+  gmic = pkgs.gmic.gimpPlugin;
+
+  ufraw = pkgs.ufraw.gimpPlugin;
+
+  gimplensfun = pluginDerivation rec {
+    version = "0.2.4";
+    name = "gimplensfun-${version}";
+
+    src = fetchFromGitHub {
+      owner = "seebk";
+      repo = "GIMP-Lensfun";
+      rev = version;
+      sha256 = "0zlmp9v732qmzj083mnk5z421s57mnckmpjhiw890wmmwzj2lhxz";
+    };
+
+    buildInputs = with pkgs; [ lensfun exiv2 ];
+
+    installPhase = "
+      installPlugins gimp-lensfun
+    ";
+
+    meta = {
+      description = "GIMP plugin to correct lens distortion using the lensfun library and database";
+
+      homepage = http://lensfun.sebastiankraft.net/;
+
+      license = stdenv.lib.licenses.gpl3Plus;
+      maintainers = [ ];
+      platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+    };
+  };
+
+  /* =============== simple script files ==================== */
+
+  # also have a look at enblend-enfuse in all-packages.nix
+  exposureBlend = scriptDerivation {
+    name = "exposure-blend";
+    src = fetchurl {
+      url = http://tir.astro.utoledo.edu/jdsmith/code/eb/exposure-blend.scm;
+      sha256 = "1b6c9wzpklqras4wwsyw3y3jp6fjmhnnskqiwm5sabs8djknfxla";
+    };
+  };
+
+  lightning = scriptDerivation {
+    name = "Lightning";
+    src = fetchurl {
+      url = http://registry.gimp.org/files/Lightning.scm;
+      sha256 = "c14a8f4f709695ede3f77348728a25b3f3ded420da60f3f8de3944b7eae98a49";
+    };
+  };
+
+  /* space in name trouble ?
+
+  rainbowPlasma = scriptDerivation {
+    # http://registry.gimp.org/node/164
+    name = "rainbow-plasma";
+    src = fetchurl {
+      url = "http://registry.gimp.org/files/Rainbow Plasma.scm";
+      sha256 = "34308d4c9441f9e7bafa118af7ec9540f10ea0df75e812e2f3aa3fd7b5344c23";
+      name = "Rainbow-Plasma.scm"; # nix doesn't like spaces, does it?
+    };
+  };
+  */
+
+  /* doesn't seem to be working :-(
+  lightningGate = scriptDerivation {
+    # http://registry.gimp.org/node/153
+    name = "lightning-gate";
+    src = fetchurl {
+      url = http://registry.gimp.org/files/LightningGate.scm;
+      sha256 = "181w1zi9a99kn2mfxjp43wkwcgw5vbb6iqjas7a9mhm8p04csys2";
+    };
+  };
+  */
+
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch b/nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch
new file mode 100644
index 000000000000..b1079ab36604
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch
@@ -0,0 +1,200 @@
+ls diff --git focusblur-3.2.6/src/aaa.h focusblur-3.2.6/src/aaa.h
+index 4a6d90b..c74cab2 100644
+--- focusblur-3.2.6/src/aaa.h
++++ focusblur-3.2.6/src/aaa.h
+@@ -19,8 +19,7 @@
+ #ifndef __AAA_H__
+ #define __AAA_H__
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/brush.h focusblur-3.2.6/src/brush.h
+index 685b253..8778fec 100644
+--- focusblur-3.2.6/src/brush.h
++++ focusblur-3.2.6/src/brush.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_BRUSH_H__
+ #define __FOCUSBLUR_BRUSH_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include "focusblurtypes.h"
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/depthmap.h focusblur-3.2.6/src/depthmap.h
+index 78f5e99..baee540 100644
+--- focusblur-3.2.6/src/depthmap.h
++++ focusblur-3.2.6/src/depthmap.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_DEPTHMAP_H__
+ #define __FOCUSBLUR_DEPTHMAP_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ #include "focusblurenums.h"
+diff --git focusblur-3.2.6/src/diffusion.h focusblur-3.2.6/src/diffusion.h
+index 07ffe4b..3c1e4b9 100644
+--- focusblur-3.2.6/src/diffusion.h
++++ focusblur-3.2.6/src/diffusion.h
+@@ -23,7 +23,7 @@
+ #define __FOCUSBLUR_DIFFUSION_H__
+ 
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblur.h"
+ #include "focusblurtypes.h"
+diff --git focusblur-3.2.6/src/fftblur.h focusblur-3.2.6/src/fftblur.h
+index 124bcba..cd809fa 100644
+--- focusblur-3.2.6/src/fftblur.h
++++ focusblur-3.2.6/src/fftblur.h
+@@ -23,8 +23,7 @@
+ #define __FOCUSBLUR_FFTBLUR_H__
+ 
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimpwidgets/gimpwidgetstypes.h>
+ 
+ #include "focusblurparam.h"
+diff --git focusblur-3.2.6/src/fftblurbuffer.h focusblur-3.2.6/src/fftblurbuffer.h
+index b34d682..42e6380 100644
+--- focusblur-3.2.6/src/fftblurbuffer.h
++++ focusblur-3.2.6/src/fftblurbuffer.h
+@@ -28,8 +28,7 @@
+ #endif
+ #include <fftw3.h>
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <gtk/gtkstyle.h>
+ #include <libgimp/gimptypes.h>
+ #include <libgimpwidgets/gimpwidgetstypes.h>
+diff --git focusblur-3.2.6/src/fftblurproc.h focusblur-3.2.6/src/fftblurproc.h
+index 495572d..10a34f4 100644
+--- focusblur-3.2.6/src/fftblurproc.h
++++ focusblur-3.2.6/src/fftblurproc.h
+@@ -23,8 +23,7 @@
+ #define __FOCUSBLUR_FFTBLUR_PROC_H__
+ 
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ 
+diff --git focusblur-3.2.6/src/focusblur.h focusblur-3.2.6/src/focusblur.h
+index 54ca40a..d7e13a6 100644
+--- focusblur-3.2.6/src/focusblur.h
++++ focusblur-3.2.6/src/focusblur.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_H__
+ #define __FOCUSBLUR_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+diff --git focusblur-3.2.6/src/focusblurparam.h focusblur-3.2.6/src/focusblurparam.h
+index 64c887b..32865b4 100644
+--- focusblur-3.2.6/src/focusblurparam.h
++++ focusblur-3.2.6/src/focusblurparam.h
+@@ -22,8 +22,7 @@
+ #ifndef __FOCUSBLUR_PARAM_H__
+ #define __FOCUSBLUR_PARAM_H__
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <gtk/gtkstyle.h>
+ #include <libgimp/gimptypes.h>
+ 
+diff --git focusblur-3.2.6/src/focusblurstock.h focusblur-3.2.6/src/focusblurstock.h
+index 15f3603..cfc0567 100644
+--- focusblur-3.2.6/src/focusblurstock.h
++++ focusblur-3.2.6/src/focusblurstock.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_STOCK_H__
+ #define __FOCUSBLUR_STOCK_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+diff --git focusblur-3.2.6/src/focusblurtypes.h focusblur-3.2.6/src/focusblurtypes.h
+index 0954c60..1531c84 100644
+--- focusblur-3.2.6/src/focusblurtypes.h
++++ focusblur-3.2.6/src/focusblurtypes.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_TYPES_H__
+ #define __FOCUSBLUR_TYPES_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/interface.h focusblur-3.2.6/src/interface.h
+index 6defd27..e819c60 100644
+--- focusblur-3.2.6/src/interface.h
++++ focusblur-3.2.6/src/interface.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_INTERFACE_H__
+ #define __FOCUSBLUR_INTERFACE_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ 
+diff --git focusblur-3.2.6/src/render.h focusblur-3.2.6/src/render.h
+index febbd24..a501f1e 100644
+--- focusblur-3.2.6/src/render.h
++++ focusblur-3.2.6/src/render.h
+@@ -24,7 +24,7 @@
+ 
+ #include "config.h"
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ //#include <libgimp/gimp.h>
+ #include <libgimp/gimpui.h>
+ 
+diff --git focusblur-3.2.6/src/shine.h focusblur-3.2.6/src/shine.h
+index c5a3621..86b4c09 100644
+--- focusblur-3.2.6/src/shine.h
++++ focusblur-3.2.6/src/shine.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_SHINE_H__
+ #define __FOCUSBLUR_SHINE_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimp/gimptypes.h>
+ 
+ #include "focusblurtypes.h"
+diff --git focusblur-3.2.6/src/source.h focusblur-3.2.6/src/source.h
+index 50d34ca..8eec35c 100644
+--- focusblur-3.2.6/src/source.h
++++ focusblur-3.2.6/src/source.h
+@@ -24,7 +24,7 @@
+ 
+ #include "config.h"
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimp/gimptypes.h>
+ 
+ #include "focusblurtypes.h"
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch b/nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch
new file mode 100644
index 000000000000..0d6a87000ccd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch
@@ -0,0 +1,13 @@
+diff --git a/app/gimp-version.c b/app/gimp-version.c
+index 12605c6..a9083da 100644
+--- a/app/gimp-version.c
++++ b/app/gimp-version.c
+@@ -203,7 +203,7 @@ gimp_version (gboolean be_verbose,
+       lib_versions = gimp_library_versions (localized);
+       verbose_info = g_strdup_printf ("git-describe: %s\n"
+                                       "C compiler:\n%s\n%s",
+-                                      GIMP_GIT_VERSION, CC_VERSION,
++                                      GIMP_GIT_VERSION, "@cc_version@",
+                                       lib_versions);
+       g_free (lib_versions);
+ 
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix b/nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix
new file mode 100644
index 000000000000..11c1e9ada931
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, gnome3, plugins ? null}:
+
+let
+allPlugins = lib.filter (pkg: builtins.isAttrs pkg && pkg.type == "derivation" && !pkg.meta.broken or false) (lib.attrValues gimpPlugins);
+selectedPlugins = if plugins == null then allPlugins else plugins;
+extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
+versionBranch = stdenv.lib.versions.majorMinor gimp.version;
+
+in symlinkJoin {
+  name = "gimp-with-plugins-${gimp.version}";
+
+  paths = [ gimp ] ++ selectedPlugins;
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    for each in gimp-${versionBranch} gimp-console-${versionBranch}; do
+      wrapProgram $out/bin/$each \
+        --set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
+        --prefix GTK_PATH : "${gnome3.gnome-themes-extra}/lib/gtk-2.0" \
+        ${toString extraArgs}
+    done
+    set +x
+    for each in gimp gimp-console; do
+      ln -sf "$each-${versionBranch}" $out/bin/$each
+    done
+  '';
+}