2019-10-31 22:20:09 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, substituteAll
|
2020-07-03 20:03:26 +01:00
|
|
|
, autoreconfHook
|
2019-10-31 22:20:09 +00:00
|
|
|
, 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
|
2020-07-03 04:44:35 +01:00
|
|
|
, python2
|
2019-10-31 22:20:09 +00:00
|
|
|
, libexif
|
|
|
|
, gettext
|
2020-07-03 04:44:35 +01:00
|
|
|
, makeWrapper
|
2019-10-31 22:20:09 +00:00
|
|
|
, xorg
|
|
|
|
, glib-networking
|
|
|
|
, libmypaint
|
|
|
|
, gexiv2
|
|
|
|
, harfbuzz
|
2019-01-27 09:12:49 +00:00
|
|
|
, mypaint-brushes1
|
2019-10-31 22:20:09 +00:00
|
|
|
, libwebp
|
|
|
|
, libheif
|
|
|
|
, libgudev
|
|
|
|
, openexr
|
|
|
|
, AppKit
|
|
|
|
, Cocoa
|
|
|
|
, gtk-mac-integration-gtk2
|
|
|
|
}:
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
let
|
2020-07-03 04:44:35 +01:00
|
|
|
python = python2.withPackages (pp: [ pp.pygtk ]);
|
2017-12-22 07:59:08 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-04-08 13:46:22 +01:00
|
|
|
pname = "gimp";
|
2020-06-11 19:44:23 +01:00
|
|
|
version = "2.10.20";
|
2017-12-22 07:59:08 +00:00
|
|
|
|
2019-11-20 21:51:37 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2017-12-22 07:59:08 +00:00
|
|
|
src = fetchurl {
|
2019-10-31 22:20:09 +00:00
|
|
|
url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
|
2020-06-11 19:44:23 +01:00
|
|
|
sha256 = "4S+fh0saAHxCd7YKqB4LZzML5+YVPldJ6tg5uQL8ezw=";
|
2017-12-22 07:59:08 +00:00
|
|
|
};
|
|
|
|
|
2020-07-03 20:03:26 +01: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;
|
|
|
|
})
|
|
|
|
|
|
|
|
# Use absolute paths instead of relying on PATH
|
|
|
|
# to make sure plug-ins are loaded by the correct interpreter.
|
|
|
|
./hardcode-plugin-interpreters.patch
|
|
|
|
];
|
|
|
|
|
2019-10-31 22:20:09 +00:00
|
|
|
nativeBuildInputs = [
|
2020-07-03 20:03:26 +01:00
|
|
|
autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am
|
2019-10-31 22:20:09 +00:00
|
|
|
pkgconfig
|
|
|
|
intltool
|
|
|
|
gettext
|
2020-07-03 04:44:35 +01:00
|
|
|
makeWrapper
|
2019-10-31 22:20:09 +00:00
|
|
|
];
|
|
|
|
|
2017-12-22 07:59:08 +00:00
|
|
|
buildInputs = [
|
2019-10-31 22:20:09 +00:00
|
|
|
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
|
|
|
|
libexif
|
|
|
|
xorg.libXpm
|
|
|
|
glib-networking
|
|
|
|
libmypaint
|
2019-01-27 09:12:49 +00:00
|
|
|
mypaint-brushes1
|
2019-10-31 22:20:09 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
Cocoa
|
|
|
|
gtk-mac-integration-gtk2
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libgudev
|
|
|
|
];
|
|
|
|
|
|
|
|
# needed by gimp-2.0.pc
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
gegl
|
|
|
|
];
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2019-10-31 22:20:09 +00:00
|
|
|
wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \
|
2017-12-22 07:59:08 +00:00
|
|
|
--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
|
2019-10-31 22:20:09 +00:00
|
|
|
majorVersion = "${lib.versions.major version}.0";
|
2017-12-22 07:59:08 +00:00
|
|
|
targetPluginDir = "lib/gimp/${majorVersion}/plug-ins";
|
2019-11-02 14:42:33 +00:00
|
|
|
targetScriptDir = "share/gimp/${majorVersion}/scripts";
|
2017-12-22 07:59:08 +00:00
|
|
|
|
|
|
|
# probably its a good idea to use the same gtk in plugins ?
|
|
|
|
gtk = gtk2;
|
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--without-webkit" # old version is required
|
2020-02-21 11:02:55 +00:00
|
|
|
"--disable-check-update"
|
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"
|
2019-12-04 01:33:42 +00:00
|
|
|
# fix libdir in pc files (${exec_prefix} needs to be passed verbatim)
|
|
|
|
"--libdir=\${exec_prefix}/lib"
|
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;
|
|
|
|
|
2019-10-31 22:20:09 +00:00
|
|
|
meta = with lib; {
|
2017-12-22 07:59:08 +00:00
|
|
|
description = "The GNU Image Manipulation Program";
|
2019-10-31 22:20:09 +00:00
|
|
|
homepage = "https://www.gimp.org/";
|
2017-12-22 07:59:08 +00:00
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|