2019-05-22 12:03:39 +01:00
|
|
|
{ stdenv, fetchurl, substituteAll, pkgconfig, intltool, babl, gegl, gtk2, glib, gdk-pixbuf, isocodes
|
2017-12-22 07:59:08 +00:00
|
|
|
, 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
|
2018-07-01 10:06:10 +01:00
|
|
|
, harfbuzz, mypaint-brushes, libwebp, libheif, libgudev, openexr
|
2019-06-19 21:19:04 +01:00
|
|
|
, AppKit, Cocoa, gtk-mac-integration-gtk2 }:
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (python2Packages) pygtk wrapPython python;
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-04-08 13:46:22 +01:00
|
|
|
pname = "gimp";
|
2019-06-14 09:32:38 +01:00
|
|
|
version = "2.10.12";
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-04-08 13:46:22 +01:00
|
|
|
url = "http://download.gimp.org/pub/gimp/v${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
|
2019-06-14 09:32:38 +01:00
|
|
|
sha256 = "0wdcr8d2ink4swn5r4v13bsiya6s3xm4ya97sdbhs4l40y7bb03x";
|
2017-12-22 07:59:08 +00:00
|
|
|
};
|
|
|
|
|
2018-08-20 14:08:23 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig intltool gettext wrapPython ];
|
2017-12-22 07:59:08 +00:00
|
|
|
propagatedBuildInputs = [ gegl ]; # needed by gimp-2.0.pc
|
|
|
|
buildInputs = [
|
2019-05-22 12:03:39 +01:00
|
|
|
babl gegl gtk2 glib gdk-pixbuf pango cairo gexiv2 harfbuzz isocodes
|
2017-12-22 07:59:08 +00:00
|
|
|
freetype fontconfig lcms libpng libjpeg poppler poppler_data libtiff openexr
|
2018-07-01 10:06:10 +01:00
|
|
|
libmng librsvg libwmf zlib libzip ghostscript aalib shared-mime-info libwebp libheif
|
2017-12-22 07:59:08 +00:00
|
|
|
python pygtk libexif xorg.libXpm glib-networking libmypaint mypaint-brushes
|
2018-12-03 15:35:21 +00:00
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
2019-06-19 21:19:04 +01:00
|
|
|
AppKit Cocoa gtk-mac-integration-gtk2
|
2018-12-03 15:35:21 +00:00
|
|
|
] ++ stdenv.lib.optionals stdenv.isLinux [ libgudev ];
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
pythonPath = [ pygtk ];
|
|
|
|
|
|
|
|
# Check if librsvg was built with --disable-pixbuf-loader.
|
2019-05-22 12:03:39 +01:00
|
|
|
PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# The check runs before glib-networking is registered
|
|
|
|
export GIO_EXTRA_MODULES="${glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES"
|
|
|
|
'';
|
|
|
|
|
2018-11-05 23:59:28 +00:00
|
|
|
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;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-12-22 07:59:08 +00:00
|
|
|
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
|
2018-05-20 23:16:19 +01:00
|
|
|
"--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
|
2019-03-24 19:47:08 +00:00
|
|
|
"--with-icc-directory=/run/current-system/sw/share/color/icc"
|
2017-12-22 07:59:08 +00:00
|
|
|
];
|
|
|
|
|
2018-12-03 15:35:21 +00:00
|
|
|
# on Darwin,
|
|
|
|
# test-eevl.c:64:36: error: initializer element is not a compile-time constant
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|