2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, substituteAll
|
2020-07-18 16:06:22 +00:00
|
|
|
, autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, 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-18 16:06:22 +00:00
|
|
|
, python2
|
2020-04-24 23:36:52 +00:00
|
|
|
, libexif
|
|
|
|
, gettext
|
2020-07-18 16:06:22 +00:00
|
|
|
, makeWrapper
|
2021-05-20 23:08:51 +00:00
|
|
|
, gtk-doc
|
2020-04-24 23:36:52 +00:00
|
|
|
, xorg
|
|
|
|
, glib-networking
|
|
|
|
, libmypaint
|
|
|
|
, gexiv2
|
|
|
|
, harfbuzz
|
|
|
|
, mypaint-brushes1
|
|
|
|
, libwebp
|
|
|
|
, libheif
|
|
|
|
, libgudev
|
|
|
|
, openexr
|
|
|
|
, AppKit
|
|
|
|
, Cocoa
|
|
|
|
, gtk-mac-integration-gtk2
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2020-07-18 16:06:22 +00:00
|
|
|
python = python2.withPackages (pp: [ pp.pygtk ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "gimp";
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "2.10.28";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
|
2021-10-28 06:52:43 +00:00
|
|
|
sha256 = "T03CLP8atfAm/qoqtV4Fd1s6EeGYGGtHvat5y/oHiCY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-07-18 16:06:22 +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;
|
|
|
|
})
|
|
|
|
|
|
|
|
# Use absolute paths instead of relying on PATH
|
|
|
|
# to make sure plug-ins are loaded by the correct interpreter.
|
|
|
|
./hardcode-plugin-interpreters.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
2020-07-18 16:06:22 +00:00
|
|
|
autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
intltool
|
|
|
|
gettext
|
2020-07-18 16:06:22 +00:00
|
|
|
makeWrapper
|
2021-05-20 23:08:51 +00:00
|
|
|
gtk-doc
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
libexif
|
|
|
|
xorg.libXpm
|
|
|
|
glib-networking
|
|
|
|
libmypaint
|
|
|
|
mypaint-brushes1
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
Cocoa
|
|
|
|
gtk-mac-integration-gtk2
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libgudev
|
|
|
|
];
|
|
|
|
|
|
|
|
# needed by gimp-2.0.pc
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
gegl
|
|
|
|
];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--without-webkit" # old version is required
|
|
|
|
"--disable-check-update"
|
|
|
|
"--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
|
|
|
|
"--with-icc-directory=/run/current-system/sw/share/color/icc"
|
|
|
|
# fix libdir in pc files (${exec_prefix} needs to be passed verbatim)
|
|
|
|
"--libdir=\${exec_prefix}/lib"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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 = ''
|
|
|
|
wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \
|
|
|
|
--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 = "${lib.versions.major version}.0";
|
2020-11-12 09:05:59 +00:00
|
|
|
targetLibDir = "lib/gimp/${majorVersion}";
|
|
|
|
targetDataDir = "share/gimp/${majorVersion}";
|
|
|
|
targetPluginDir = "${targetLibDir}/plug-ins";
|
|
|
|
targetScriptDir = "${targetDataDir}/scripts";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# probably its a good idea to use the same gtk in plugins ?
|
|
|
|
gtk = gtk2;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The GNU Image Manipulation Program";
|
|
|
|
homepage = "https://www.gimp.org/";
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|