Skip to content

Commit

Permalink
Merge pull request NixOS#72386 from jtojnar/gimp-2.10.14
Browse files Browse the repository at this point in the history
gimp: 2.10.12 → 2.10.14
  • Loading branch information
jtojnar committed Nov 3, 2019
2 parents 794c919 + 80a5dd7 commit 3df93db
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 49 deletions.
133 changes: 110 additions & 23 deletions pkgs/applications/graphics/gimp/default.nix
@@ -1,31 +1,118 @@
{ 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 }:
{ stdenv
, lib
, 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
}:

let
inherit (python2Packages) pygtk wrapPython python;
in stdenv.mkDerivation rec {
pname = "gimp";
version = "2.10.12";
version = "2.10.14";

src = fetchurl {
url = "http://download.gimp.org/pub/gimp/v${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
sha256 = "0wdcr8d2ink4swn5r4v13bsiya6s3xm4ya97sdbhs4l40y7bb03x";
url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
sha256 = "0m6wdnfvsxyhimdd4v3351g4r1fklllnbipbwcfym3h7q88hz6yz";
};

nativeBuildInputs = [ pkgconfig intltool gettext wrapPython ];
propagatedBuildInputs = [ gegl ]; # needed by gimp-2.0.pc
nativeBuildInputs = [
pkgconfig
intltool
gettext
wrapPython
];

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 [
AppKit Cocoa gtk-mac-integration-gtk2
] ++ stdenv.lib.optionals stdenv.isLinux [ libgudev ];
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
] ++ lib.optionals stdenv.isDarwin [
AppKit
Cocoa
gtk-mac-integration-gtk2
] ++ lib.optionals stdenv.isLinux [
libgudev
];

# needed by gimp-2.0.pc
propagatedBuildInputs = [
gegl
];

pythonPath = [ pygtk ];

Expand All @@ -48,17 +135,17 @@ in stdenv.mkDerivation rec {

postFixup = ''
wrapPythonProgramsIn $out/lib/gimp/${passthru.majorVersion}/plug-ins/
wrapProgram $out/bin/gimp-${stdenv.lib.versions.majorMinor version} \
wrapProgram $out/bin/gimp-${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";
majorVersion = "${lib.versions.major version}.0";
targetPluginDir = "lib/gimp/${majorVersion}/plug-ins";
targetScriptDir = "lib/gimp/${majorVersion}/scripts";
targetScriptDir = "share/gimp/${majorVersion}/scripts";

# probably its a good idea to use the same gtk in plugins ?
gtk = gtk2;
Expand All @@ -76,9 +163,9 @@ in stdenv.mkDerivation rec {

enableParallelBuilding = true;

meta = with stdenv.lib; {
meta = with lib; {
description = "The GNU Image Manipulation Program";
homepage = https://www.gimp.org/;
homepage = "https://www.gimp.org/";
maintainers = with maintainers; [ jtojnar ];
license = licenses.gpl3Plus;
platforms = platforms.unix;
Expand Down
23 changes: 14 additions & 9 deletions pkgs/applications/graphics/gimp/plugins/default.nix
Expand Up @@ -8,31 +8,33 @@ let
inherit (pkgs) stdenv fetchurl pkgconfig intltool glib fetchFromGitHub;
inherit (gimp) targetPluginDir targetScriptDir;

pluginDerivation = a: stdenv.mkDerivation ({
pluginDerivation = a: let
name = a.name or "${a.pname}-${a.version}";
in stdenv.mkDerivation ({
prePhases = "extraLib";
extraLib = ''
installScripts(){
mkdir -p $out/${targetScriptDir};
for p in "$@"; do cp "$p" $out/${targetScriptDir}; done
mkdir -p $out/${targetScriptDir}/${name};
for p in "$@"; do cp "$p" -r $out/${targetScriptDir}/${name}; done
}
installPlugins(){
mkdir -p $out/${targetPluginDir};
for p in "$@"; do cp "$p" $out/${targetPluginDir}; done
mkdir -p $out/${targetPluginDir}/${name};
for p in "$@"; do cp "$p" -r $out/${targetPluginDir}/${name}; done
}
'';
}
// a
// {
name = "gimp-plugin-${a.name or "${a.pname}-${a.version}"}";
name = "gimp-plugin-${name}";
buildInputs = [ gimp gimp.gtk glib ] ++ (a.buildInputs or []);
nativeBuildInputs = [ pkgconfig intltool ] ++ (a.nativeBuildInputs or []);
}
);

scriptDerivation = {name, src} : pluginDerivation {
inherit name; phases = "extraLib installPhase";
scriptDerivation = {src, ...}@attrs : pluginDerivation ({
phases = [ "extraLib" "installPhase" ];
installPhase = "installScripts ${src}";
};
} // attrs);

in

Expand All @@ -46,6 +48,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
url = https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
};
NIX_LDFLAGS = [ "-lm" ];
patchPhase = ''
sed -e 's,^\(GIMP_PLUGIN_DIR=\).*,\1'"$out/${gimp.name}-plugins", \
-e 's,^\(GIMP_DATA_DIR=\).*,\1'"$out/share/${gimp.name}", -i configure
Expand Down Expand Up @@ -131,6 +134,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
Filters/Enhance/Wavelet sharpen
*/
name = "wavelet-sharpen-0.1.2";
NIX_LDFLAGS = [ "-lm" ];
src = fetchurl {
url = http://registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz;
sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
Expand Down Expand Up @@ -195,6 +199,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
url = http://tir.astro.utoledo.edu/jdsmith/code/eb/exposure-blend.scm;
sha256 = "1b6c9wzpklqras4wwsyw3y3jp6fjmhnnskqiwm5sabs8djknfxla";
};
meta.broken = true;
};

lightning = scriptDerivation {
Expand Down
1 change: 1 addition & 0 deletions pkgs/applications/graphics/gimp/wrapper.nix
Expand Up @@ -17,6 +17,7 @@ in symlinkJoin {
for each in gimp-${versionBranch} gimp-console-${versionBranch}; do
wrapProgram $out/bin/$each \
--set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
--set GIMP2_DATADIR "$out/share/gimp/2.0" \
--prefix GTK_PATH : "${gnome3.gnome-themes-extra}/lib/gtk-2.0" \
${toString extraArgs}
done
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/netsurf/buildsystem/default.nix
Expand Up @@ -19,6 +19,6 @@ stdenv.mkDerivation rec {
description = "Build system for netsurf browser";
license = licenses.gpl2;
maintainers = [ maintainers.vrthra ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
2 changes: 1 addition & 1 deletion pkgs/applications/misc/netsurf/libnsgif/default.nix
Expand Up @@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
description = "GIF Decoder for netsurf browser";
license = licenses.gpl2;
maintainers = [ maintainers.vrthra ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
3 changes: 2 additions & 1 deletion pkgs/desktops/gnome-3/default.nix
Expand Up @@ -24,7 +24,6 @@ lib.makeScope pkgs.newScope (self: with self; {
libsoup = pkgs.libsoup.override { gnomeSupport = true; };
libchamplain = pkgs.libchamplain.override { libsoup = libsoup; };
gnome3 = self // { recurseForDerivations = false; };
gegl_0_4 = pkgs.gegl_0_4.override { gtk = pkgs.gtk3; };

# ISO installer
# installerIso = callPackage ./installer.nix {};
Expand Down Expand Up @@ -359,4 +358,6 @@ lib.makeScope pkgs.newScope (self: with self; {
nautilus-sendto = throw "deprecated 2019-09-17: abandoned";

inherit (pkgs) vala; # added 2019-10-10

inherit (pkgs) gegl_0_4; # added 2019-10-31
})

0 comments on commit 3df93db

Please sign in to comment.