about summary refs log tree commit diff
path: root/pkgs/applications/graphics/gimp
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2017-12-22 08:59:08 +0100
committerJan Tojnar <jtojnar@gmail.com>2018-04-29 08:39:05 +0200
commitb0d3ed348474f02dd79d63149706be66231dff55 (patch)
tree74a41345e9c58968573594badf595cc2846c9666 /pkgs/applications/graphics/gimp
parent3ebb162d902906c2eb65bd4978f9d77a8a841522 (diff)
downloadnixlib-b0d3ed348474f02dd79d63149706be66231dff55.tar
nixlib-b0d3ed348474f02dd79d63149706be66231dff55.tar.gz
nixlib-b0d3ed348474f02dd79d63149706be66231dff55.tar.bz2
nixlib-b0d3ed348474f02dd79d63149706be66231dff55.tar.lz
nixlib-b0d3ed348474f02dd79d63149706be66231dff55.tar.xz
nixlib-b0d3ed348474f02dd79d63149706be66231dff55.tar.zst
nixlib-b0d3ed348474f02dd79d63149706be66231dff55.zip
gimp: 2.8.22 → 2.10.0
Diffstat (limited to 'pkgs/applications/graphics/gimp')
-rw-r--r--pkgs/applications/graphics/gimp/2.8.nix57
-rw-r--r--pkgs/applications/graphics/gimp/default.nix95
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix8
-rw-r--r--pkgs/applications/graphics/gimp/wrapper.nix5
4 files changed, 102 insertions, 63 deletions
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix
deleted file mode 100644
index 3802fff2ad21..000000000000
--- a/pkgs/applications/graphics/gimp/2.8.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, babl, gegl, gtk2, glib, gdk_pixbuf
-, pango, cairo, freetype, fontconfig, lcms, libpng, libjpeg, poppler, libtiff
-, webkit, libmng, librsvg, libwmf, zlib, libzip, ghostscript, aalib, jasper
-, python2Packages, libexif, gettext, xorg
-, AppKit, Cocoa, gtk-mac-integration }:
-
-let
-  inherit (python2Packages) pygtk wrapPython python;
-in stdenv.mkDerivation rec {
-  name = "gimp-${version}";
-  version = "2.8.22";
-
-  # 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 = "12k3lp938qdc9cqj29scg55f3bb8iav2fysd29w0s49bqmfa71wi";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool babl gegl gtk2 glib gdk_pixbuf pango cairo
-      freetype fontconfig lcms libpng libjpeg poppler libtiff webkit
-      libmng librsvg libwmf zlib libzip ghostscript aalib jasper
-      python pygtk libexif gettext xorg.libXpm
-      wrapPython
-    ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Cocoa gtk-mac-integration ];
-
-  pythonPath = [ pygtk ];
-
-  postFixup = ''
-    wrapPythonProgramsIn $out/lib/gimp/2.0/plug-ins/
-    wrapProgram $out/bin/gimp \
-      --prefix PYTHONPATH : "$PYTHONPATH" \
-      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
-  '';
-
-  passthru = { gtk = gtk2; }; # probably its a good idea to use the same gtk in plugins ?
-
-  #configureFlags = [ "--disable-print" ];
-
-  enableParallelBuilding = true;
-
-  # "screenshot" needs this.
-  NIX_LDFLAGS = "-rpath ${xorg.libX11.out}/lib";
-
-  meta = {
-    description = "The GNU Image Manipulation Program";
-    homepage = https://www.gimp.org/;
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.unix;
-  };
-}
diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix
new file mode 100644
index 000000000000..2536367f6ceb
--- /dev/null
+++ b/pkgs/applications/graphics/gimp/default.nix
@@ -0,0 +1,95 @@
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, 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, libgudev, openexr
+, AppKit, Cocoa, gtk-mac-integration }:
+
+let
+  inherit (python2Packages) pygtk wrapPython python;
+in stdenv.mkDerivation rec {
+  name = "gimp-${version}";
+  version = "2.10.0";
+
+  src = fetchurl {
+    url = "http://download.gimp.org/pub/gimp/v${stdenv.lib.versions.majorMinor version}/${name}.tar.bz2";
+    sha256 = "1qkxaigbfkx26xym5nzrgfrmn97cbnhn63v1saaha2nbi3xrdk3z";
+  };
+
+  patches = [
+    # fix rpath of python library https://bugzilla.gnome.org/show_bug.cgi?id=795620
+    (fetchurl {
+      url = https://bugzilla.gnome.org/attachment.cgi?id=371482;
+      sha256 = "18bysndh61pvlv255xapdrfpsl5ivm51wp1w7xgk9vky9z2y3llc";
+    })
+
+    # fix absolute paths stored in configuration
+    (fetchpatch {
+      url = https://git.gnome.org/browse/gimp/patch/?id=0fce8fdb3c056acead8322c976a96fb6fba793b6;
+      sha256 = "09845i3bdpdbf13razr04ksvwydxcvzhjwlb4dfgdv5q203g2ris";
+    })
+    (fetchpatch {
+      url = https://git.gnome.org/browse/gimp/patch/?id=f6b586237cb8c912c1503f8e6086edd17f07d4df;
+      sha256 = "0s68885ip2wgjvsl5vqi2f1xhxdjpzqprifzgdl1vnv6gqmfy3bh";
+    })
+
+    # fix pc file (needed e.g. for building plug-ins)
+    (fetchpatch {
+      url = https://git.gnome.org/browse/gimp/patch/?id=7e19906827d301eb70275dba089849a632a0eabe;
+      sha256 = "0cbjfbwvzg2hqihg3rpsga405v7z2qahj22dfqn2jrb2gbhrjcp1";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig intltool gettext wrapPython ];
+  propagatedBuildInputs = [ gegl ]; # needed by gimp-2.0.pc
+  buildInputs = [
+    babl gegl gtk2 glib gdk_pixbuf pango cairo gexiv2 harfbuzz isocodes libgudev
+    freetype fontconfig lcms libpng libjpeg poppler poppler_data libtiff openexr
+    libmng librsvg libwmf zlib libzip ghostscript aalib shared-mime-info libwebp
+    python pygtk libexif xorg.libXpm glib-networking libmypaint mypaint-brushes
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Cocoa gtk-mac-integration ];
+
+  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"
+  '';
+
+  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
+  ];
+
+  doCheck = true;
+
+  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/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index 0d4215dd5bc2..a19a5487b425 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -12,12 +12,12 @@ let
     prePhases = "extraLib";
     extraLib = ''
       installScripts(){
-        mkdir -p ${targetScriptDir};
-        for p in "$@"; do cp "$p" ${targetScriptDir}; done
+        mkdir -p $out/${targetScriptDir};
+        for p in "$@"; do cp "$p" $out/${targetScriptDir}; done
       }
       installPlugins(){
-        mkdir -p ${targetPluginDir};
-        for p in "$@"; do cp "$p" ${targetPluginDir}; done
+        mkdir -p $out/${targetPluginDir};
+        for p in "$@"; do cp "$p" $out/${targetPluginDir}; done
       }
     '';
   }
diff --git a/pkgs/applications/graphics/gimp/wrapper.nix b/pkgs/applications/graphics/gimp/wrapper.nix
index 7455a69dde97..6e450b25c048 100644
--- a/pkgs/applications/graphics/gimp/wrapper.nix
+++ b/pkgs/applications/graphics/gimp/wrapper.nix
@@ -4,6 +4,7 @@ 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;
+versionBranch = stdenv.lib.versions.majorMinor gimp.version;
 
 in symlinkJoin {
   name = "gimp-with-plugins-${gimp.version}";
@@ -13,14 +14,14 @@ in symlinkJoin {
   buildInputs = [ makeWrapper ];
 
   postBuild = ''
-    for each in gimp-2.8 gimp-console-2.8; do
+    for each in gimp-${versionBranch} gimp-console-${versionBranch}; 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
+      ln -sf "$each-${versionBranch}" $out/bin/$each
     done
   '';
 }