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
|
2022-06-26 10:26:21 +00:00
|
|
|
, libjxl
|
2020-04-24 23:36:52 +00:00
|
|
|
, poppler
|
|
|
|
, poppler_data
|
|
|
|
, libtiff
|
|
|
|
, libmng
|
|
|
|
, librsvg
|
|
|
|
, libwmf
|
|
|
|
, zlib
|
|
|
|
, libzip
|
|
|
|
, ghostscript
|
|
|
|
, aalib
|
|
|
|
, shared-mime-info
|
|
|
|
, 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
|
2023-04-29 16:46:19 +00:00
|
|
|
, desktopToDarwinBundle
|
2020-04-24 23:36:52 +00:00
|
|
|
, AppKit
|
|
|
|
, Cocoa
|
|
|
|
, gtk-mac-integration-gtk2
|
2022-12-02 08:20:57 +00:00
|
|
|
, withPython ? false
|
|
|
|
, python2
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2020-07-18 16:06:22 +00:00
|
|
|
python = python2.withPackages (pp: [ pp.pygtk ]);
|
2023-03-24 00:07:29 +00:00
|
|
|
in stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gimp";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.10.38";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2023-03-24 00:07:29 +00:00
|
|
|
url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.bz2";
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-UKhF7sEciDH+hmFweVD1uERuNfMO37ms+Y+FwRM/hW4=";
|
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
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
desktopToDarwinBundle
|
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
|
2022-06-26 10:26:21 +00:00
|
|
|
libjxl
|
2020-04-24 23:36:52 +00:00
|
|
|
poppler
|
|
|
|
poppler_data
|
|
|
|
libtiff
|
|
|
|
openexr
|
|
|
|
libmng
|
|
|
|
librsvg
|
|
|
|
libwmf
|
|
|
|
zlib
|
|
|
|
libzip
|
|
|
|
ghostscript
|
|
|
|
aalib
|
|
|
|
shared-mime-info
|
|
|
|
libwebp
|
|
|
|
libheif
|
|
|
|
libexif
|
|
|
|
xorg.libXpm
|
|
|
|
glib-networking
|
|
|
|
libmypaint
|
|
|
|
mypaint-brushes1
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
Cocoa
|
|
|
|
gtk-mac-integration-gtk2
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libgudev
|
2022-12-02 08:20:57 +00:00
|
|
|
] ++ lib.optionals withPython [
|
|
|
|
python
|
|
|
|
# Duplicated here because python.withPackages does not expose the dev output with pkg-config files
|
|
|
|
python2.pkgs.pygtk
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# 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"
|
2022-12-02 08:20:57 +00:00
|
|
|
] ++ lib.optionals (!withPython) [
|
|
|
|
"--disable-python" # depends on Python2 which was EOLed on 2020-01-01
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
env = {
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
# Check if librsvg was built with --disable-pixbuf-loader.
|
|
|
|
PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# The check runs before glib-networking is registered
|
|
|
|
export GIO_EXTRA_MODULES="${glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2023-03-24 00:07:29 +00:00
|
|
|
wrapProgram $out/bin/gimp-${lib.versions.majorMinor finalAttrs.version} \
|
2020-04-24 23:36:52 +00:00
|
|
|
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
|
|
|
|
'';
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
passthru = {
|
2020-04-24 23:36:52 +00:00
|
|
|
# The declarations for `gimp-with-plugins` wrapper,
|
|
|
|
# used for determining plug-in installation paths
|
2023-03-24 00:07:29 +00:00
|
|
|
majorVersion = "${lib.versions.major finalAttrs.version}.0";
|
|
|
|
targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}";
|
|
|
|
targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}";
|
|
|
|
targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins";
|
|
|
|
targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# probably its a good idea to use the same gtk in plugins ?
|
|
|
|
gtk = gtk2;
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
python2Support = withPython;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The GNU Image Manipulation Program";
|
|
|
|
homepage = "https://www.gimp.org/";
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
2022-03-30 09:31:56 +00:00
|
|
|
mainProgram = "gimp";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-03-24 00:07:29 +00:00
|
|
|
})
|