From ba886c5525325a38a5362d83fcfa81b33f6a422a Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Tue, 18 Mar 2025 10:11:13 +0100 Subject: [PATCH 01/12] =?UTF-8?q?babl:=200.1.110=20=E2=86=92=200.1.112?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/GNOME/babl/compare/BABL_0_1_110...BABL_0_1_112 --- pkgs/by-name/ba/babl/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ba/babl/package.nix b/pkgs/by-name/ba/babl/package.nix index bfccb384280f..e99f319fb7e5 100644 --- a/pkgs/by-name/ba/babl/package.nix +++ b/pkgs/by-name/ba/babl/package.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "babl"; - version = "0.1.110"; + version = "0.1.112"; outputs = [ "out" @@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "https://download.gimp.org/pub/babl/${lib.versions.majorMinor finalAttrs.version}/babl-${finalAttrs.version}.tar.xz"; - hash = "sha256-v0e+dUDWJ1OJ9mQx7wMGTfU3YxXiQ9C6tEjGqnE/V0M="; + hash = "sha256-+2lmgkIXh8j+zIPoqrSBId7I7jjRGbZSkc/L4xUCink="; }; patches = [ From c5c61fb5f1b14c6f5943e7c94f9a48df938521b1 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Tue, 18 Mar 2025 10:11:13 +0100 Subject: [PATCH 02/12] =?UTF-8?q?gegl:=200.4.54=20=E2=86=92=200.4.58?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gitlab.gnome.org/GNOME/gegl/-/compare/GEGL_0_4_54...GEGL_0_4_58 --- pkgs/development/libraries/gegl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gegl/default.nix b/pkgs/development/libraries/gegl/default.nix index ab80a9424c23..9c429091908c 100644 --- a/pkgs/development/libraries/gegl/default.nix +++ b/pkgs/development/libraries/gegl/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "gegl"; - version = "0.4.54"; + version = "0.4.58"; outputs = [ "out" @@ -49,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "https://download.gimp.org/pub/gegl/${lib.versions.majorMinor finalAttrs.version}/gegl-${finalAttrs.version}.tar.xz"; - hash = "sha256-NaNC8IxrQ3mt7iy1dI/E4wfP3PJBfAuxfWymVD8jix4="; + hash = "sha256-1WeLvV/lNZQbgvlluX/Mk4XOk29wyYK9VlpT1VGdG/8="; }; nativeBuildInputs = [ From bf0702f01b66a2c3ce427bb438f0bb2a5f86e534 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 25 Feb 2022 21:47:34 +0100 Subject: [PATCH 03/12] gimp-with-plugins: prepare for GIMP 3 The `gimpPlugins` should now support both versions. --- .../graphics/gimp/plugins/default.nix | 38 ++++++++++++++++--- pkgs/applications/graphics/gimp/wrapper.nix | 19 ++++++---- pkgs/by-name/gm/gmic-qt/package.nix | 9 ++++- 3 files changed, 53 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix index b237c5f1bcf1..20d57d50941a 100644 --- a/pkgs/applications/graphics/gimp/plugins/default.nix +++ b/pkgs/applications/graphics/gimp/plugins/default.nix @@ -2,7 +2,11 @@ # If you just want a subset of plug-ins, you can specify them explicitly: # `gimp-with-plugins.override { plugins = with gimpPlugins; [ gap ]; }`. -{ lib, pkgs }: +{ + lib, + pkgs, + gimp, +}: let inherit (pkgs) @@ -16,6 +20,10 @@ let fetchFromGitHub fetchFromGitLab ; + + # We cannot use gimp from the arguments directly, or it would be shadowed by the one + # from scope when initializing the scope with it, leading to infinite recursion. + gimpArg = gimp; in lib.makeScope pkgs.newScope ( @@ -29,6 +37,7 @@ lib.makeScope pkgs.newScope ( attrs: let name = attrs.name or "${attrs.pname}-${attrs.version}"; + pkgConfigMajorVersion = if gimp.majorVersion == "2.0" then "2" else "3"; in stdenv.mkDerivation ( { @@ -63,8 +72,10 @@ lib.makeScope pkgs.newScope ( # Override installation paths. env = { - PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${placeholder "out"}/${gimp.targetLibDir}"; - PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${placeholder "out"}/${gimp.targetDataDir}"; + "PKG_CONFIG_GIMP_${pkgConfigMajorVersion}_0_GIMPLIBDIR" = + "${placeholder "out"}/${gimp.targetLibDir}"; + "PKG_CONFIG_GIMP_${pkgConfigMajorVersion}_0_GIMPDATADIR" = + "${placeholder "out"}/${gimp.targetDataDir}"; } // attrs.env or { }; } ); @@ -86,7 +97,7 @@ lib.makeScope pkgs.newScope ( in { # Allow overriding GIMP package in the scope. - inherit (pkgs) gimp; + gimp = gimpArg; bimp = pluginDerivation rec { /* @@ -130,6 +141,7 @@ lib.makeScope pkgs.newScope ( installTargets = [ "install-admin" ]; meta = with lib; { + broken = gimp.majorVersion != "2.0"; description = "Batch Image Manipulation Plugin for GIMP"; homepage = "https://github.com/alessandrofrancesconi/gimp-plugin-bimp"; license = licenses.gpl2Plus; @@ -153,6 +165,7 @@ lib.makeScope pkgs.newScope ( ''; meta = { + broken = gimp.majorVersion != "2.0"; description = "Gimp plug-in for the farbfeld image format"; homepage = "https://github.com/ids1024/gimp-farbfeld"; license = lib.licenses.mit; @@ -192,6 +205,7 @@ lib.makeScope pkgs.newScope ( ''; meta = with lib; { + broken = gimp.majorVersion != "2.0"; description = "GIMP plug-in to do the fourier transform"; homepage = "https://people.via.ecp.fr/~remi/soft/gimp/gimp_plugin_en.php3#fourier"; license = with licenses; [ gpl3Plus ]; @@ -222,7 +236,7 @@ lib.makeScope pkgs.newScope ( }; meta = { - broken = !gimp.python2Support; + broken = gimp.majorVersion != "2.0"; }; }; @@ -240,6 +254,10 @@ lib.makeScope pkgs.newScope ( ninja gettext ]; + + meta = { + broken = gimp.majorVersion != "2.0"; + }; }; waveletSharpen = pluginDerivation { @@ -264,6 +282,10 @@ lib.makeScope pkgs.newScope ( }; installPhase = "installPlugin src/wavelet-sharpen"; # TODO translations are not copied .. How to do this on nix? + + meta = { + broken = gimp.majorVersion != "2.0"; + }; }; lqrPlugin = pluginDerivation rec { @@ -289,10 +311,15 @@ lib.makeScope pkgs.newScope ( sha256 = "EdjZWM6U1bhUmsOnLA8iJ4SFKuAXHIfNPzxZqel+JrY="; }) ]; + + meta = { + broken = gimp.majorVersion != "2.0"; + }; }; gmic = pkgs.gmic-qt.override { variant = "gimp"; + inherit (self) gimp; }; gimplensfun = pluginDerivation { @@ -320,6 +347,7 @@ lib.makeScope pkgs.newScope ( "; meta = { + broken = gimp.majorVersion != "2.0"; description = "GIMP plugin to correct lens distortion using the lensfun library and database"; homepage = "http://lensfun.sebastiankraft.net/"; diff --git a/pkgs/applications/graphics/gimp/wrapper.nix b/pkgs/applications/graphics/gimp/wrapper.nix index 82ff058ba7dc..2a4e2c3a844b 100644 --- a/pkgs/applications/graphics/gimp/wrapper.nix +++ b/pkgs/applications/graphics/gimp/wrapper.nix @@ -13,8 +13,14 @@ let lib.attrValues gimpPlugins ); selectedPlugins = lib.filter (pkg: pkg != gimp) (if plugins == null then allPlugins else plugins); - extraArgs = map (x: x.wrapArgs or "") selectedPlugins; - versionBranch = lib.versions.majorMinor gimp.version; + extraArgs = + map (x: x.wrapArgs or "") selectedPlugins + ++ lib.optionals (gimp.majorVersion == "2.0") [ + ''--prefix GTK_PATH : "${gnome-themes-extra}/lib/gtk-2.0"'' + ]; + exeVersion = + if gimp.majorVersion == "2.0" then lib.versions.majorMinor gimp.version else gimp.majorVersion; + majorVersion = if gimp.majorVersion == "2.0" then "2" else "3"; in symlinkJoin { @@ -25,16 +31,15 @@ symlinkJoin { nativeBuildInputs = [ makeWrapper ]; postBuild = '' - for each in gimp-${versionBranch} gimp-console-${versionBranch}; do + for each in gimp-${exeVersion} gimp-console-${exeVersion}; do wrapProgram $out/bin/$each \ - --set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \ - --set GIMP2_DATADIR "$out/share/gimp/2.0" \ - --prefix GTK_PATH : "${gnome-themes-extra}/lib/gtk-2.0" \ + --set GIMP${majorVersion}_PLUGINDIR "$out/${gimp.targetLibDir}" \ + --set GIMP${majorVersion}_DATADIR "$out/${gimp.targetDataDir}" \ ${toString extraArgs} done set +x for each in gimp gimp-console; do - ln -sf "$each-${versionBranch}" $out/bin/$each + ln -sf "$each-${exeVersion}" $out/bin/$each done ''; diff --git a/pkgs/by-name/gm/gmic-qt/package.nix b/pkgs/by-name/gm/gmic-qt/package.nix index 4a07ba02bcef..8e93a53a11e0 100644 --- a/pkgs/by-name/gm/gmic-qt/package.nix +++ b/pkgs/by-name/gm/gmic-qt/package.nix @@ -100,7 +100,14 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeBool "ENABLE_DYNAMIC_LINKING" true) (lib.cmakeBool "ENABLE_SYSTEM_GMIC" true) - (lib.cmakeFeature "GMIC_QT_HOST" (if variant == "standalone" then "none" else variant)) + (lib.cmakeFeature "GMIC_QT_HOST" ( + if variant == "standalone" then + "none" + else if variant == "gimp" && gimp.majorVersion == "2.99" then + "gimp3" + else + variant + )) ]; postFixup = lib.optionalString (variant == "gimp") '' From 2eb19e227bfc3aa09f9690ffc1bd78daaf4604b2 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 17 Aug 2020 20:13:43 +0200 Subject: [PATCH 04/12] =?UTF-8?q?gimp:=202.10.38=20=E2=86=92=202.99.10-uns?= =?UTF-8?q?table-2022-06-28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.gimp.org/news/2020/11/06/gimp-2-99-2-released/ https://www.gimp.org/news/2020/12/25/gimp-2-99-4-released/ https://www.gimp.org/news/2021/05/08/gimp-2-99-6-released/ https://www.gimp.org/news/2021/10/20/gimp-2-99-8-released/ https://www.gimp.org/news/2022/02/25/gimp-2-99-10-released/ Ported to GTK 3 and Meson. Co-Authored-By: Linus Heckemann Co-authored-by: Sandro --- pkgs/applications/graphics/gimp/default.nix | 215 +++++++++++++----- .../graphics/gimp/fix-isocodes-paths.patch | 15 ++ .../graphics/gimp/force-enable-libheif.patch | 22 -- .../gimp/hardcode-plugin-interpreters.patch | 19 +- .../graphics/gimp/remove-cc-reference.patch | 4 +- .../applications/graphics/gimp/skip-win.patch | 10 + .../graphics/gimp/tests-dbus-conf.patch | 13 ++ pkgs/top-level/all-packages.nix | 1 - 8 files changed, 207 insertions(+), 92 deletions(-) create mode 100644 pkgs/applications/graphics/gimp/fix-isocodes-paths.patch delete mode 100644 pkgs/applications/graphics/gimp/force-enable-libheif.patch create mode 100644 pkgs/applications/graphics/gimp/skip-win.patch create mode 100644 pkgs/applications/graphics/gimp/tests-dbus-conf.patch diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index e5e552f299f9..18ace779c905 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -1,19 +1,23 @@ { stdenv, lib, - fetchurl, + fetchFromGitLab, + fetchpatch, replaceVars, - autoreconfHook, + meson, + ninja, pkg-config, - intltool, babl, gegl, - gtk2, + gtk3, glib, gdk-pixbuf, + graphviz, isocodes, pango, cairo, + libarchive, + luajit, freetype, fontconfig, lcms, @@ -31,44 +35,65 @@ ghostscript, aalib, shared-mime-info, + python3, libexif, gettext, - makeWrapper, - gtk-doc, + wrapGAppsHook3, + libxslt, + gobject-introspection, + vala, + perl, + appstream-glib, + desktop-file-utils, xorg, glib-networking, + json-glib, libmypaint, gexiv2, harfbuzz, mypaint-brushes1, libwebp, libheif, - libxslt, + gjs, libgudev, openexr, + xvfb-run, + dbus, + adwaita-icon-theme, + alsa-lib, desktopToDarwinBundle, AppKit, Cocoa, - gtk-mac-integration-gtk2, - withPython ? false, - python2, + gtk-mac-integration-gtk3, + unstableGitUpdater, }: let - python = python2.withPackages (pp: [ pp.pygtk ]); + python = python3.withPackages ( + pp: with pp; [ + pygobject3 + ] + ); in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; - version = "2.10.38"; + version = "2.99.10-unstable-2022-06-28"; outputs = [ "out" "dev" ]; - src = fetchurl { - url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.bz2"; - sha256 = "sha256-UKhF7sEciDH+hmFweVD1uERuNfMO37ms+Y+FwRM/hW4="; + # We should not use fetchFromGitLab because the build system + # will complain and mark the build as unsupported when it cannot find + # .git directory but downloading the whole repo is jus too much. + src = fetchFromGitLab rec { + name = "gimp-dev-${rev}"; # to make sure the hash is updated + domain = "gitlab.gnome.org"; + owner = "GNOME"; + repo = "gimp"; + rev = "256b2d9615af2ba6dfcfdc32cc34a437aee214b3"; + hash = "sha256-ITL5nb8fka5Xj+6/JthGRTVVvTDd7LED49IuhZZNk4U="; }; patches = [ @@ -80,26 +105,59 @@ stdenv.mkDerivation (finalAttrs: { # Use absolute paths instead of relying on PATH # to make sure plug-ins are loaded by the correct interpreter. - ./hardcode-plugin-interpreters.patch + (replaceVars ./hardcode-plugin-interpreters.patch { + python_interpreter = python.interpreter; + PYTHON_PATH = null; + }) - # GIMP queries libheif.pc for builtin encoder/decoder support to determine if AVIF/HEIC files are supported - # (see https://gitlab.gnome.org/GNOME/gimp/-/blob/a8b1173ca441283971ee48f4778e2ffd1cca7284/configure.ac?page=2#L1846-1852) - # These variables have been removed since libheif 1.18.0 - # (see https://github.com/strukturag/libheif/commit/cf0d89c6e0809427427583290547a7757428cf5a) - # This has already been fixed for the upcoming GIMP 3, but the fix has not been backported to 2.x yet - # (see https://gitlab.gnome.org/GNOME/gimp/-/issues/9080) - ./force-enable-libheif.patch + # D-Bus configuration is not available in the build sandbox + # so we need to pick up the one from the package. + (replaceVars ./tests-dbus-conf.patch { + session_conf = "${dbus.out}/share/dbus-1/session.conf"; + }) + + # Since we pass absolute datadirs to Meson, the path is resolved incorrectly. + # What is more, even the assumption that iso-codes have the same datadir + # subdirectory as GIMP is incorrect. Though, there is not a way to obtain + # the correct directory at the moment. There is a MR against isocodes to fix that: + # https://salsa.debian.org/iso-codes-team/iso-codes/merge_requests/11 + ./fix-isocodes-paths.patch + + # Skip broken dependency in Windows code. + # https://gitlab.gnome.org/GNOME/gimp/-/issues/7907 + ./skip-win.patch + + # Make the babl-0.1 patch apply + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/06b481a3ecf49563050935ad0e965a664648e450.patch"; + hash = "sha256-mlYj29m1Ay9FFOCTAv01ipiK8VTdjh+Es4fnhBR/Vzs="; + }) + + # Fix compatibility with babl-0.1 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/04a78154e1af5e30dcedde6dbaa321be3f0e24b1.patch"; + hash = "sha256-oSfkTPJb4ai8z3o7QHgrNzwJEtJj04R9mKufXxGNWU8="; + }) ]; nativeBuildInputs = [ - autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am + meson + ninja pkg-config - intltool gettext - makeWrapper - gtk-doc - libxslt + wrapGAppsHook3 + libxslt # for xsltproc + gobject-introspection + perl + vala + + # for tests + desktop-file-utils + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + dbus + xvfb-run ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle @@ -107,13 +165,15 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ + appstream-glib # for library babl gegl - gtk2 + gtk3 glib gdk-pixbuf pango cairo + libarchive gexiv2 harfbuzz isocodes @@ -135,51 +195,71 @@ stdenv.mkDerivation (finalAttrs: { ghostscript aalib shared-mime-info + json-glib libwebp libheif + python libexif xorg.libXpm + xorg.libXmu glib-networking libmypaint mypaint-brushes1 + + # New file dialogue crashes with “Icon 'image-missing' not present in theme Symbolic” without an icon theme. + adwaita-icon-theme + + # for Lua plug-ins + (luajit.withPackages (pp: [ + pp.lgi + ])) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + + # for JavaScript plug-ins + gjs ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit Cocoa - gtk-mac-integration-gtk2 + gtk-mac-integration-gtk3 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libgudev - ] - ++ lib.optionals withPython [ - python - # Duplicated here because python.withPackages does not expose the dev output with pkg-config files - python2.pkgs.pygtk ]; - # needed by gimp-2.0.pc propagatedBuildInputs = [ + # needed by gimp-3.0.pc gegl ]; - configureFlags = + mesonFlags = [ - "--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" + "-Dbug-report-url=https://github.com/NixOS/nixpkgs/issues/new" + "-Dicc-directory=/run/current-system/sw/share/color/icc" + "-Dcheck-update=no" + (lib.mesonEnable "gudev" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "headless-tests" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux) + # Not very important to do downstream, save a dependency. + "-Dappdata-test=disabled" + # Incompatible with version in nixpkgs + "-Djpeg-xl=disabled" + # Broken references + "-Dgi-docgen=disabled" ] - ++ lib.optionals (!withPython) [ - "--disable-python" # depends on Python2 which was EOLed on 2020-01-01 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-Dalsa=disabled" + "-Djavascript=false" ]; - enableParallelBuilding = true; - doCheck = true; env = { + # The check runs before glib-networking is registered + GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules"; + NIX_CFLAGS_COMPILE = toString ( [ ] ++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=incompatible-pointer-types" ] @@ -190,29 +270,52 @@ stdenv.mkDerivation (finalAttrs: { 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" + postPatch = '' + patchShebangs \ + app/tests/create_test_env.sh \ + tools/gimp-mkenums + + # Bypass the need for downloading git archive. + substitute app/git-version.h.in git-version.h \ + --subst-var-by GIMP_GIT_VERSION "GIMP_2.99.?-g${builtins.substring 0 10 finalAttrs.src.rev}" \ + --subst-var-by GIMP_GIT_VERSION_ABBREV "${builtins.substring 0 10 finalAttrs.src.rev}" \ + --subst-var-by GIMP_GIT_LAST_COMMIT_YEAR "${builtins.head (builtins.match ".+\-unstable-([0-9]{4})-[0-9]{2}-[0-9]{2}" finalAttrs.version)}" ''; - postFixup = '' - wrapProgram $out/bin/gimp-${lib.versions.majorMinor finalAttrs.version} \ - --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" + preCheck = '' + # Avoid “Error retrieving accessibility bus address” + export NO_AT_BRIDGE=1 + # Fix storing recent file list in tests + export HOME="$TMPDIR" + export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:$XDG_DATA_DIRS" + ''; + + preFixup = '' + gappsWrapperArgs+=(--prefix PATH : "${ + lib.makeBinPath [ + # for dot for gegl:introspect (Debug » Show Image Graph, hidden by default on stable release) + graphviz + ] + }") ''; passthru = { # The declarations for `gimp-with-plugins` wrapper, # used for determining plug-in installation paths - majorVersion = "${lib.versions.major finalAttrs.version}.0"; + majorVersion = "2.99"; targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}"; targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}"; targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins"; targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts"; # probably its a good idea to use the same gtk in plugins ? - gtk = gtk2; + gtk = gtk3; - python2Support = withPython; + updateScript = unstableGitUpdater { + stableVersion = true; + tagPrefix = "GIMP_"; + tagConverter = "sed s/_/./g"; + }; }; meta = with lib; { diff --git a/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch b/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch new file mode 100644 index 000000000000..32ed7babbf6a --- /dev/null +++ b/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch @@ -0,0 +1,15 @@ +diff --git a/meson.build b/meson.build +index a1ec1f67b6..8ce50973f7 100644 +--- a/meson.build ++++ b/meson.build +@@ -864,8 +864,8 @@ + isocodes = dependency('iso-codes', required: false) + if isocodes.found() + isocodes_prefix = isocodes.get_pkgconfig_variable('prefix') +- isocodes_location = isocodes_prefix / get_option('datadir') / 'xml' / 'iso-codes' +- isocodes_localedir= isocodes_prefix / get_option('datadir') / 'locale' ++ isocodes_location = isocodes_prefix / 'share' / 'xml' / 'iso-codes' ++ isocodes_localedir= isocodes_prefix / 'share' / 'locale' + endif + conf.set('HAVE_ISO_CODES', isocodes.found()) + diff --git a/pkgs/applications/graphics/gimp/force-enable-libheif.patch b/pkgs/applications/graphics/gimp/force-enable-libheif.patch deleted file mode 100644 index de3dfb09b95e..000000000000 --- a/pkgs/applications/graphics/gimp/force-enable-libheif.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 48c3c77892..3189781817 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1843,13 +1843,13 @@ can_export_heic=no - can_import_avif=no - can_export_avif=no - if test "x$have_libheif" = xyes; then -- can_import_heic=`$PKG_CONFIG --variable=builtin_h265_decoder libheif` -- can_export_heic=`$PKG_CONFIG --variable=builtin_h265_encoder libheif` -+ can_import_heic=yes -+ can_export_heic=yes - if test "x$can_import_heic" = xyes; then - MIME_TYPES="$MIME_TYPES;image/heif;image/heic" - fi -- can_import_avif=`$PKG_CONFIG --variable=builtin_avif_decoder libheif` -- can_export_avif=`$PKG_CONFIG --variable=builtin_avif_encoder libheif` -+ can_import_avif=yes -+ can_export_avif=yes - if test "x$can_import_avif" = xyes; then - MIME_TYPES="$MIME_TYPES;image/avif" - fi diff --git a/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch b/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch index 1528404c31d2..6cb261d84ff0 100644 --- a/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch +++ b/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch @@ -1,11 +1,8 @@ ---- a/plug-ins/pygimp/Makefile.am -+++ b/plug-ins/pygimp/Makefile.am -@@ -157,7 +157,7 @@ install-interp-file: - echo 'python=$(PYBIN_PATH)' > '$(DESTDIR)$(pyinterpfile)' - echo 'python2=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)' - echo '/usr/bin/python=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)' -- echo ":Python:E::py::`basename $(PYTHON)`:" >> '$(DESTDIR)$(pyinterpfile)' -+ echo ":Python:E::py::$(PYTHON):" >> '$(DESTDIR)$(pyinterpfile)' - - install-data-local: install-env-file install-interp-file - +--- a/plug-ins/python/pygimp.interp.in ++++ b/plug-ins/python/pygimp.interp.in +@@ -2,4 +2,4 @@ python=@PYTHON_PATH@ + python3=@PYTHON_PATH@ + /usr/bin/python=@PYTHON_PATH@ + /usr/bin/python3=@PYTHON_PATH@ +-:Python:E::py::python3: ++:Python:E::py::@python_interpreter@: diff --git a/pkgs/applications/graphics/gimp/remove-cc-reference.patch b/pkgs/applications/graphics/gimp/remove-cc-reference.patch index 20c350bdaea1..335fb4e44bb1 100644 --- a/pkgs/applications/graphics/gimp/remove-cc-reference.patch +++ b/pkgs/applications/graphics/gimp/remove-cc-reference.patch @@ -1,8 +1,8 @@ diff --git a/app/gimp-version.c b/app/gimp-version.c -index 3d1894a036..48bb670b64 100644 +index 6e311c8252..e6fd9d1d78 100644 --- a/app/gimp-version.c +++ b/app/gimp-version.c -@@ -230,7 +230,7 @@ gimp_version (gboolean be_verbose, +@@ -231,7 +231,7 @@ gimp_version (gboolean be_verbose, GIMP_BUILD_ID, gimp_version_get_revision (), GIMP_BUILD_PLATFORM_FAMILY, diff --git a/pkgs/applications/graphics/gimp/skip-win.patch b/pkgs/applications/graphics/gimp/skip-win.patch new file mode 100644 index 000000000000..5689862fe57a --- /dev/null +++ b/pkgs/applications/graphics/gimp/skip-win.patch @@ -0,0 +1,10 @@ +diff --git a/build/windows/meson.build b/build/windows/meson.build +index 8df68256f6..9cd76ad660 100644 +--- a/build/windows/meson.build ++++ b/build/windows/meson.build +@@ -1,4 +1,5 @@ + # Windows specific ++subdir_done() + + configure_file( + input : 'gimp-plug-ins.rc.in', diff --git a/pkgs/applications/graphics/gimp/tests-dbus-conf.patch b/pkgs/applications/graphics/gimp/tests-dbus-conf.patch new file mode 100644 index 000000000000..4553054b72cd --- /dev/null +++ b/pkgs/applications/graphics/gimp/tests-dbus-conf.patch @@ -0,0 +1,13 @@ +diff --git a/build/meson/run_test_env.sh b/build/meson/run_test_env.sh +index a3fda14f00..71fbdcd00d 100644 +--- a/build/meson/run_test_env.sh ++++ b/build/meson/run_test_env.sh +@@ -33,7 +33,7 @@ if [ -n "${UI_TEST}" ]; then + OPT="--auto-servernum" + fi + xvfb-run $OPT --server-args="-screen 0 1280x1024x24" \ +- dbus-run-session -- "$@" ++ dbus-run-session --config-file="@session_conf@" -- "$@" + + else + # Run the executable directly, diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 729df4dba04c..d14129b927c7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14544,7 +14544,6 @@ with pkgs; inherit (xorg) xlsfonts; gimp = callPackage ../applications/graphics/gimp { - autoreconfHook = buildPackages.autoreconfHook269; lcms = lcms2; inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; }; From 027fa910b0a88c7492d0332b6bc67e5090957b2a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 31 Aug 2022 04:00:48 +0200 Subject: [PATCH 05/12] =?UTF-8?q?gimp:=202.99.10-unstable-2022-06-28=20?= =?UTF-8?q?=E2=86=92=202.99.12-unstable-2022-08-31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.gimp.org/news/2022/08/27/gimp-2-99-12-released/ https://github.com/GNOME/gimp/compare/256b2d9615af2ba6dfcfdc32cc34a437aee214b3...a791151ed05b6e2f7b0ecb71db8be9629d61f5df Introduces `gimp-script-fu-interpreter-3.0` as interpreter invoked by shebang of some plug-ins. Let’s ensure it is on `PATH`. --- pkgs/applications/graphics/gimp/default.nix | 14 +++++++------- .../graphics/gimp/fix-isocodes-paths.patch | 6 +++--- pkgs/applications/graphics/gimp/skip-win.patch | 10 ---------- 3 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 pkgs/applications/graphics/gimp/skip-win.patch diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index 18ace779c905..63f9f520e6f0 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -77,7 +77,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; - version = "2.99.10-unstable-2022-06-28"; + version = "2.99.12-unstable-2022-08-31"; outputs = [ "out" @@ -92,8 +92,8 @@ stdenv.mkDerivation (finalAttrs: { domain = "gitlab.gnome.org"; owner = "GNOME"; repo = "gimp"; - rev = "256b2d9615af2ba6dfcfdc32cc34a437aee214b3"; - hash = "sha256-ITL5nb8fka5Xj+6/JthGRTVVvTDd7LED49IuhZZNk4U="; + rev = "a791151ed05b6e2f7b0ecb71db8be9629d61f5df"; + hash = "sha256-0IIQwJW/HwkvKmjrs2xOhbpyLvvqJ0PR3q75PF+b/Ac="; }; patches = [ @@ -123,10 +123,6 @@ stdenv.mkDerivation (finalAttrs: { # https://salsa.debian.org/iso-codes-team/iso-codes/merge_requests/11 ./fix-isocodes-paths.patch - # Skip broken dependency in Windows code. - # https://gitlab.gnome.org/GNOME/gimp/-/issues/7907 - ./skip-win.patch - # Make the babl-0.1 patch apply (fetchpatch { url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/06b481a3ecf49563050935ad0e965a664648e450.patch"; @@ -248,6 +244,8 @@ stdenv.mkDerivation (finalAttrs: { "-Djpeg-xl=disabled" # Broken references "-Dgi-docgen=disabled" + # Removed pkg-config variable + "-Dheif=disabled" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-Dalsa=disabled" @@ -295,6 +293,8 @@ stdenv.mkDerivation (finalAttrs: { lib.makeBinPath [ # for dot for gegl:introspect (Debug » Show Image Graph, hidden by default on stable release) graphviz + # for gimp-script-fu-interpreter-3.0 invoked by shebang of some plug-ins + "$out" ] }") ''; diff --git a/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch b/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch index 32ed7babbf6a..cb10776d4802 100644 --- a/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch +++ b/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch @@ -1,11 +1,11 @@ diff --git a/meson.build b/meson.build -index a1ec1f67b6..8ce50973f7 100644 +index 6a19df48a1..3fd77077c1 100644 --- a/meson.build +++ b/meson.build -@@ -864,8 +864,8 @@ +@@ -924,8 +924,8 @@ endif isocodes = dependency('iso-codes', required: false) if isocodes.found() - isocodes_prefix = isocodes.get_pkgconfig_variable('prefix') + isocodes_prefix = isocodes.get_variable(pkgconfig: 'prefix') - isocodes_location = isocodes_prefix / get_option('datadir') / 'xml' / 'iso-codes' - isocodes_localedir= isocodes_prefix / get_option('datadir') / 'locale' + isocodes_location = isocodes_prefix / 'share' / 'xml' / 'iso-codes' diff --git a/pkgs/applications/graphics/gimp/skip-win.patch b/pkgs/applications/graphics/gimp/skip-win.patch deleted file mode 100644 index 5689862fe57a..000000000000 --- a/pkgs/applications/graphics/gimp/skip-win.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/build/windows/meson.build b/build/windows/meson.build -index 8df68256f6..9cd76ad660 100644 ---- a/build/windows/meson.build -+++ b/build/windows/meson.build -@@ -1,4 +1,5 @@ - # Windows specific -+subdir_done() - - configure_file( - input : 'gimp-plug-ins.rc.in', From d65529fcdffb7175cde20f11f0c8bf4325bc8b6d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 17 Mar 2023 17:29:04 +0000 Subject: [PATCH 06/12] =?UTF-8?q?gimp:=202.99.12-unstable-2022-08-31=20?= =?UTF-8?q?=E2=86=92=202.99.14-unstable-2023-03-17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.gimp.org/news/2022/11/18/gimp-2-99-14-released/ https://github.com/GNOME/gimp/compare/a791151ed05b6e2f7b0ecb71db8be9629d61f5df...ad7a2e53eb72ef471566fa2d0ce9faeec929fbcf - Adds OpenMP support. - Fixes libheif detection. - Fixes babl discovery. --- pkgs/applications/graphics/gimp/default.nix | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index 63f9f520e6f0..899ff62fc827 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -2,7 +2,6 @@ stdenv, lib, fetchFromGitLab, - fetchpatch, replaceVars, meson, ninja, @@ -77,7 +76,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; - version = "2.99.12-unstable-2022-08-31"; + version = "2.99.14-unstable-2023-03-17"; outputs = [ "out" @@ -92,8 +91,8 @@ stdenv.mkDerivation (finalAttrs: { domain = "gitlab.gnome.org"; owner = "GNOME"; repo = "gimp"; - rev = "a791151ed05b6e2f7b0ecb71db8be9629d61f5df"; - hash = "sha256-0IIQwJW/HwkvKmjrs2xOhbpyLvvqJ0PR3q75PF+b/Ac="; + rev = "ad7a2e53eb72ef471566fa2d0ce9faeec929fbcf"; + hash = "sha256-IJMUJc817EDWIRqqkCuwAcSw7gcgCkXxPan5fEq1AO0="; }; patches = [ @@ -122,18 +121,6 @@ stdenv.mkDerivation (finalAttrs: { # the correct directory at the moment. There is a MR against isocodes to fix that: # https://salsa.debian.org/iso-codes-team/iso-codes/merge_requests/11 ./fix-isocodes-paths.patch - - # Make the babl-0.1 patch apply - (fetchpatch { - url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/06b481a3ecf49563050935ad0e965a664648e450.patch"; - hash = "sha256-mlYj29m1Ay9FFOCTAv01ipiK8VTdjh+Es4fnhBR/Vzs="; - }) - - # Fix compatibility with babl-0.1 - (fetchpatch { - url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/04a78154e1af5e30dcedde6dbaa321be3f0e24b1.patch"; - hash = "sha256-oSfkTPJb4ai8z3o7QHgrNzwJEtJj04R9mKufXxGNWU8="; - }) ]; nativeBuildInputs = @@ -244,8 +231,6 @@ stdenv.mkDerivation (finalAttrs: { "-Djpeg-xl=disabled" # Broken references "-Dgi-docgen=disabled" - # Removed pkg-config variable - "-Dheif=disabled" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-Dalsa=disabled" From 328415ccd674ab237b791aba79ced1e05cd1490a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 27 Dec 2024 02:41:29 +0100 Subject: [PATCH 07/12] =?UTF-8?q?gimp:=202.99.14-unstable-2023-03-17=20?= =?UTF-8?q?=E2=86=92=203.0.0-RC1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.gimp.org/news/2023/07/09/gimp-2-99-16-released/ https://www.gimp.org/news/2024/02/21/gimp-2-99-18-released/ https://www.gimp.org/news/2024/11/06/gimp-3-0-RC1-released/ https://github.com/GNOME/gimp/compare/ad7a2e53eb72ef471566fa2d0ce9faeec929fbcf...GIMP_3_0_0_RC1 - gtk-mac-integration dependency removed https://gitlab.gnome.org/GNOME/gimp/-/commit/df4ed9c1ec85117747e41e4540cb75b02284bdbe - Python plug-in mandatory https://gitlab.gnome.org/GNOME/gimp/-/commit/93cc81281cd12c55139f483d65629be9c31e798d - Only Lua 5.1 is supported https://gitlab.gnome.org/GNOME/gimp/-/commit/70372975261f2fc89aa9bbf92fe975a7663ef59f - Fixes gi-docgen and libjxl. Had to add `adwaita-icon-theme` to `XDG_DATA_DIRS` at check time, or tests would fail: Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Icon 'image-missing' not present in theme Default (gtk-icon-theme-error-quark, 0) No longer builds on Darwin. Co-authored-by: Sandro --- pkgs/applications/graphics/gimp/default.nix | 116 +++++++++++------- .../graphics/gimp/fix-isocodes-paths.patch | 15 --- .../gimp/hardcode-plugin-interpreters.patch | 6 +- .../graphics/gimp/plugins/default.nix | 2 +- pkgs/applications/graphics/gimp/wrapper.nix | 2 +- pkgs/by-name/gm/gmic-qt/package.nix | 2 +- 6 files changed, 77 insertions(+), 66 deletions(-) delete mode 100644 pkgs/applications/graphics/gimp/fix-isocodes-paths.patch diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index 899ff62fc827..6ff35b3e59df 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -1,12 +1,14 @@ { stdenv, lib, - fetchFromGitLab, + fetchurl, + fetchpatch, replaceVars, meson, ninja, pkg-config, babl, + cfitsio, gegl, gtk3, glib, @@ -21,6 +23,8 @@ fontconfig, lcms, libpng, + libiff, + libilbm, libjpeg, libjxl, poppler, @@ -41,6 +45,7 @@ libxslt, gobject-introspection, vala, + gi-docgen, perl, appstream-glib, desktop-file-utils, @@ -48,6 +53,7 @@ glib-networking, json-glib, libmypaint, + llvmPackages, gexiv2, harfbuzz, mypaint-brushes1, @@ -63,8 +69,6 @@ desktopToDarwinBundle, AppKit, Cocoa, - gtk-mac-integration-gtk3, - unstableGitUpdater, }: let @@ -76,23 +80,17 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; - version = "2.99.14-unstable-2023-03-17"; + version = "3.0.0-RC1"; outputs = [ "out" "dev" + "devdoc" ]; - # We should not use fetchFromGitLab because the build system - # will complain and mark the build as unsupported when it cannot find - # .git directory but downloading the whole repo is jus too much. - src = fetchFromGitLab rec { - name = "gimp-dev-${rev}"; # to make sure the hash is updated - domain = "gitlab.gnome.org"; - owner = "GNOME"; - repo = "gimp"; - rev = "ad7a2e53eb72ef471566fa2d0ce9faeec929fbcf"; - hash = "sha256-IJMUJc817EDWIRqqkCuwAcSw7gcgCkXxPan5fEq1AO0="; + src = fetchurl { + url = "https://download.gimp.org/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.xz"; + hash = "sha256-s9CyZMXjjnifqvNBcAM5fzJAAUxZx/QX+co705xf+2Y="; }; patches = [ @@ -104,6 +102,7 @@ stdenv.mkDerivation (finalAttrs: { # Use absolute paths instead of relying on PATH # to make sure plug-ins are loaded by the correct interpreter. + # TODO: This now only appears to be used on Windows. (replaceVars ./hardcode-plugin-interpreters.patch { python_interpreter = python.interpreter; PYTHON_PATH = null; @@ -115,12 +114,12 @@ stdenv.mkDerivation (finalAttrs: { session_conf = "${dbus.out}/share/dbus-1/session.conf"; }) - # Since we pass absolute datadirs to Meson, the path is resolved incorrectly. - # What is more, even the assumption that iso-codes have the same datadir - # subdirectory as GIMP is incorrect. Though, there is not a way to obtain - # the correct directory at the moment. There is a MR against isocodes to fix that: - # https://salsa.debian.org/iso-codes-team/iso-codes/merge_requests/11 - ./fix-isocodes-paths.patch + # Fix pkg-config file. + # https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/2037 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/a18e1806dbc9b180aefabb2c0fae43493f1ef14a.patch"; + hash = "sha256-BUrPm9lB/aiybB2Sd3TKlJ+59ITMZlNUBXJP5ZdLQ44="; + }) ]; nativeBuildInputs = @@ -135,6 +134,9 @@ stdenv.mkDerivation (finalAttrs: { perl vala + # for docs + gi-docgen + # for tests desktop-file-utils ] @@ -150,6 +152,7 @@ stdenv.mkDerivation (finalAttrs: { [ appstream-glib # for library babl + cfitsio gegl gtk3 glib @@ -164,6 +167,8 @@ stdenv.mkDerivation (finalAttrs: { fontconfig lcms libpng + libiff + libilbm libjpeg libjxl poppler @@ -204,9 +209,9 @@ stdenv.mkDerivation (finalAttrs: { gjs ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp AppKit Cocoa - gtk-mac-integration-gtk3 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libgudev @@ -215,6 +220,9 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ # needed by gimp-3.0.pc gegl + cairo + pango + gexiv2 ]; mesonFlags = @@ -227,14 +235,10 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux) # Not very important to do downstream, save a dependency. "-Dappdata-test=disabled" - # Incompatible with version in nixpkgs - "-Djpeg-xl=disabled" - # Broken references - "-Dgi-docgen=disabled" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-Dalsa=disabled" - "-Djavascript=false" + "-Djavascript=disabled" ]; doCheck = true; @@ -243,11 +247,7 @@ stdenv.mkDerivation (finalAttrs: { # The check runs before glib-networking is registered GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules"; - NIX_CFLAGS_COMPILE = toString ( - [ ] - ++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=incompatible-pointer-types" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DGDK_OSX_BIG_SUR=16" ] - ); + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DGDK_OSX_BIG_SUR=16"; # Check if librsvg was built with --disable-pixbuf-loader. PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; @@ -258,19 +258,46 @@ stdenv.mkDerivation (finalAttrs: { app/tests/create_test_env.sh \ tools/gimp-mkenums - # Bypass the need for downloading git archive. - substitute app/git-version.h.in git-version.h \ - --subst-var-by GIMP_GIT_VERSION "GIMP_2.99.?-g${builtins.substring 0 10 finalAttrs.src.rev}" \ - --subst-var-by GIMP_GIT_VERSION_ABBREV "${builtins.substring 0 10 finalAttrs.src.rev}" \ - --subst-var-by GIMP_GIT_LAST_COMMIT_YEAR "${builtins.head (builtins.match ".+\-unstable-([0-9]{4})-[0-9]{2}-[0-9]{2}" finalAttrs.version)}" + # GIMP is executed at build time so we need to fix this. + # TODO: Look into if we can fix the interp thing. + chmod +x plug-ins/python/{colorxhtml,file-openraster,foggify,gradients-save-as-css,histogram-export,palette-offset,palette-sort,palette-to-gradient,python-eval,spyro-plus}.py + patchShebangs \ + plug-ins/python/{colorxhtml,file-openraster,foggify,gradients-save-as-css,histogram-export,palette-offset,palette-sort,palette-to-gradient,python-eval,spyro-plus}.py ''; + preBuild = + let + librarySuffix = + if stdenv.hostPlatform.extensions.library == ".so" then + "3.0.so.0" + else if stdenv.hostPlatform.extensions.library == ".dylib" then + "3.0.0.dylib" + else + throw "Unsupported library extension ‘${stdenv.hostPlatform.extensions.library}’"; + in + '' + # Our gobject-introspection patches make the shared library paths absolute + # in the GIR files. When running GIMP in build or check phase, it will try + # to use plug-ins, which import GIMP introspection files which will try + # to load the GIMP libraries which will not be installed yet. + # So we need to replace the absolute path with a local one. + # We are using a symlink that will be overridden during installation. + mkdir -p "$out/lib" + ln -s "$PWD/libgimp/libgimp-${librarySuffix}" \ + "$PWD/libgimpbase/libgimpbase-${librarySuffix}" \ + "$PWD/libgimpcolor/libgimpcolor-${librarySuffix}" \ + "$PWD/libgimpconfig/libgimpconfig-${librarySuffix}" \ + "$PWD/libgimpmath/libgimpmath-${librarySuffix}" \ + "$PWD/libgimpmodule/libgimpmodule-${librarySuffix}" \ + "$out/lib/" + ''; + preCheck = '' # Avoid “Error retrieving accessibility bus address” export NO_AT_BRIDGE=1 # Fix storing recent file list in tests export HOME="$TMPDIR" - export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:$XDG_DATA_DIRS" + export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:${adwaita-icon-theme}/share:$XDG_DATA_DIRS" ''; preFixup = '' @@ -284,10 +311,15 @@ stdenv.mkDerivation (finalAttrs: { }") ''; + postFixup = '' + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. + moveToOutput "share/doc" "$devdoc" + ''; + passthru = { # The declarations for `gimp-with-plugins` wrapper, # used for determining plug-in installation paths - majorVersion = "2.99"; + 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"; @@ -295,12 +327,6 @@ stdenv.mkDerivation (finalAttrs: { # probably its a good idea to use the same gtk in plugins ? gtk = gtk3; - - updateScript = unstableGitUpdater { - stableVersion = true; - tagPrefix = "GIMP_"; - tagConverter = "sed s/_/./g"; - }; }; meta = with lib; { @@ -308,7 +334,7 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://www.gimp.org/"; maintainers = with maintainers; [ jtojnar ]; license = licenses.gpl3Plus; - platforms = platforms.unix; + platforms = platforms.linux; mainProgram = "gimp"; }; }) diff --git a/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch b/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch deleted file mode 100644 index cb10776d4802..000000000000 --- a/pkgs/applications/graphics/gimp/fix-isocodes-paths.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/meson.build b/meson.build -index 6a19df48a1..3fd77077c1 100644 ---- a/meson.build -+++ b/meson.build -@@ -924,8 +924,8 @@ endif - isocodes = dependency('iso-codes', required: false) - if isocodes.found() - isocodes_prefix = isocodes.get_variable(pkgconfig: 'prefix') -- isocodes_location = isocodes_prefix / get_option('datadir') / 'xml' / 'iso-codes' -- isocodes_localedir= isocodes_prefix / get_option('datadir') / 'locale' -+ isocodes_location = isocodes_prefix / 'share' / 'xml' / 'iso-codes' -+ isocodes_localedir= isocodes_prefix / 'share' / 'locale' - endif - conf.set('HAVE_ISO_CODES', isocodes.found()) - diff --git a/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch b/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch index 6cb261d84ff0..13e37da3bd24 100644 --- a/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch +++ b/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch @@ -1,8 +1,8 @@ --- a/plug-ins/python/pygimp.interp.in +++ b/plug-ins/python/pygimp.interp.in @@ -2,4 +2,4 @@ python=@PYTHON_PATH@ - python3=@PYTHON_PATH@ - /usr/bin/python=@PYTHON_PATH@ - /usr/bin/python3=@PYTHON_PATH@ + python3=@PYTHON_PATH@python.exe + /usr/bin/python=@PYTHON_PATH@python.exe + /usr/bin/python3=@PYTHON_PATH@python.exe -:Python:E::py::python3: +:Python:E::py::@python_interpreter@: diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix index 20d57d50941a..9c86343599b1 100644 --- a/pkgs/applications/graphics/gimp/plugins/default.nix +++ b/pkgs/applications/graphics/gimp/plugins/default.nix @@ -37,7 +37,7 @@ lib.makeScope pkgs.newScope ( attrs: let name = attrs.name or "${attrs.pname}-${attrs.version}"; - pkgConfigMajorVersion = if gimp.majorVersion == "2.0" then "2" else "3"; + pkgConfigMajorVersion = lib.versions.major gimp.version; in stdenv.mkDerivation ( { diff --git a/pkgs/applications/graphics/gimp/wrapper.nix b/pkgs/applications/graphics/gimp/wrapper.nix index 2a4e2c3a844b..efac48c2f7e2 100644 --- a/pkgs/applications/graphics/gimp/wrapper.nix +++ b/pkgs/applications/graphics/gimp/wrapper.nix @@ -20,7 +20,7 @@ let ]; exeVersion = if gimp.majorVersion == "2.0" then lib.versions.majorMinor gimp.version else gimp.majorVersion; - majorVersion = if gimp.majorVersion == "2.0" then "2" else "3"; + majorVersion = lib.versions.major gimp.version; in symlinkJoin { diff --git a/pkgs/by-name/gm/gmic-qt/package.nix b/pkgs/by-name/gm/gmic-qt/package.nix index 8e93a53a11e0..629097841c03 100644 --- a/pkgs/by-name/gm/gmic-qt/package.nix +++ b/pkgs/by-name/gm/gmic-qt/package.nix @@ -103,7 +103,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "GMIC_QT_HOST" ( if variant == "standalone" then "none" - else if variant == "gimp" && gimp.majorVersion == "2.99" then + else if variant == "gimp" && gimp.majorVersion == "3.0" then "gimp3" else variant From ffdeaff3de2b682d46d77d3f6f3eb1172452d8d5 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 28 Dec 2024 01:50:47 +0100 Subject: [PATCH 08/12] =?UTF-8?q?gimp:=203.0.0-RC1=20=E2=86=92=203.0.0-RC2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.gimp.org/news/2024/12/27/gimp-3-0-RC2-released/ https://github.com/GNOME/gimp/compare/GIMP_3_0_0_RC1...GIMP_3_0_0_RC2 --- pkgs/applications/graphics/gimp/default.nix | 6 +++--- .../graphics/gimp/hardcode-plugin-interpreters.patch | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index 6ff35b3e59df..114a5ba7ec28 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -80,7 +80,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; - version = "3.0.0-RC1"; + version = "3.0.0-RC2"; outputs = [ "out" @@ -90,7 +90,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "https://download.gimp.org/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.xz"; - hash = "sha256-s9CyZMXjjnifqvNBcAM5fzJAAUxZx/QX+co705xf+2Y="; + hash = "sha256-9NL5bfGAzlVD+LKzVwe5vxFFnwD3Jspz2i9AbWhtnbc="; }; patches = [ @@ -105,7 +105,7 @@ stdenv.mkDerivation (finalAttrs: { # TODO: This now only appears to be used on Windows. (replaceVars ./hardcode-plugin-interpreters.patch { python_interpreter = python.interpreter; - PYTHON_PATH = null; + PYTHON_EXE = null; }) # D-Bus configuration is not available in the build sandbox diff --git a/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch b/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch index 13e37da3bd24..6a0ec0af6262 100644 --- a/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch +++ b/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch @@ -1,8 +1,8 @@ --- a/plug-ins/python/pygimp.interp.in +++ b/plug-ins/python/pygimp.interp.in -@@ -2,4 +2,4 @@ python=@PYTHON_PATH@ - python3=@PYTHON_PATH@python.exe - /usr/bin/python=@PYTHON_PATH@python.exe - /usr/bin/python3=@PYTHON_PATH@python.exe +@@ -2,4 +2,4 @@ python=@PYTHON_EXE@ + python3=@PYTHON_EXE@ + /usr/bin/python=@PYTHON_EXE@ + /usr/bin/python3=@PYTHON_EXE@ -:Python:E::py::python3: +:Python:E::py::@python_interpreter@: From 79e6d159bf967f31c64b67b01f06e2298c105545 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Tue, 18 Mar 2025 10:11:13 +0100 Subject: [PATCH 09/12] =?UTF-8?q?gimp:=203.0.0-RC2=20=E2=86=92=203.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.gimp.org/news/2025/03/16/gimp-3-0-released/ https://github.com/GNOME/gimp/compare/GIMP_3_0_0_RC2...GIMP_3_0_0 https://www.gimp.org/news/2025/03/23/gimp-3-0-2-released/ https://github.com/GNOME/gimp/compare/GIMP_3_0_0...GIMP_3_0_2 --- doc/release-notes/rl-2505.section.md | 2 ++ pkgs/applications/graphics/gimp/default.nix | 12 ++---------- .../graphics/gimp/remove-cc-reference.patch | 2 +- .../applications/graphics/gimp/tests-dbus-conf.patch | 2 -- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 8294606c917f..933cf114ec1c 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -62,6 +62,8 @@ - [testers.shellcheck](https://nixos.org/manual/nixpkgs/unstable/#tester-shellcheck) now warns when `name` is not provided. The `name` argument will become mandatory in a future release. +- `gimp` has been upgraded to [GIMP 3.0](https://www.gimp.org/news/2025/03/16/gimp-3-0-released/). + - `grafana-agent` and `services.grafana-agent` have been removed in favor of Grafana Alloy (`grafana-alloy` and `services.alloy`), as they depend on an EOL compiler version and will become EOL during the 25.05 lifecycle. diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index 114a5ba7ec28..0b2406c89f8b 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -2,7 +2,6 @@ stdenv, lib, fetchurl, - fetchpatch, replaceVars, meson, ninja, @@ -80,7 +79,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "gimp"; - version = "3.0.0-RC2"; + version = "3.0.2"; outputs = [ "out" @@ -90,7 +89,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "https://download.gimp.org/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.xz"; - hash = "sha256-9NL5bfGAzlVD+LKzVwe5vxFFnwD3Jspz2i9AbWhtnbc="; + hash = "sha256-VG3cMMstDnkSPH/LTXghHh7npqrOkaagrYy8v26lcaI="; }; patches = [ @@ -113,13 +112,6 @@ stdenv.mkDerivation (finalAttrs: { (replaceVars ./tests-dbus-conf.patch { session_conf = "${dbus.out}/share/dbus-1/session.conf"; }) - - # Fix pkg-config file. - # https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/2037 - (fetchpatch { - url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/a18e1806dbc9b180aefabb2c0fae43493f1ef14a.patch"; - hash = "sha256-BUrPm9lB/aiybB2Sd3TKlJ+59ITMZlNUBXJP5ZdLQ44="; - }) ]; nativeBuildInputs = diff --git a/pkgs/applications/graphics/gimp/remove-cc-reference.patch b/pkgs/applications/graphics/gimp/remove-cc-reference.patch index 335fb4e44bb1..8b62b801f02b 100644 --- a/pkgs/applications/graphics/gimp/remove-cc-reference.patch +++ b/pkgs/applications/graphics/gimp/remove-cc-reference.patch @@ -2,7 +2,7 @@ diff --git a/app/gimp-version.c b/app/gimp-version.c index 6e311c8252..e6fd9d1d78 100644 --- a/app/gimp-version.c +++ b/app/gimp-version.c -@@ -231,7 +231,7 @@ gimp_version (gboolean be_verbose, +@@ -90,7 +90,7 @@ gimp_version (gboolean be_verbose, GIMP_BUILD_ID, gimp_version_get_revision (), GIMP_BUILD_PLATFORM_FAMILY, diff --git a/pkgs/applications/graphics/gimp/tests-dbus-conf.patch b/pkgs/applications/graphics/gimp/tests-dbus-conf.patch index 4553054b72cd..da9152eeef01 100644 --- a/pkgs/applications/graphics/gimp/tests-dbus-conf.patch +++ b/pkgs/applications/graphics/gimp/tests-dbus-conf.patch @@ -1,5 +1,3 @@ -diff --git a/build/meson/run_test_env.sh b/build/meson/run_test_env.sh -index a3fda14f00..71fbdcd00d 100644 --- a/build/meson/run_test_env.sh +++ b/build/meson/run_test_env.sh @@ -33,7 +33,7 @@ if [ -n "${UI_TEST}" ]; then From 38a5039f8c9834b98a2c2729cad6793c283e018f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 27 Mar 2025 23:21:38 +0100 Subject: [PATCH 10/12] gimp2: re-init at 2.10.38 Keep around for a while for legacy plug-in support. Re-introducing it in a separate commit so that `gimp` expression retains continuous git history. --- doc/release-notes/rl-2505.section.md | 2 +- .../graphics/gimp/2.0/default.nix | 226 ++++++++++++++++++ .../gimp/2.0/force-enable-libheif.patch | 22 ++ .../2.0/hardcode-plugin-interpreters.patch | 11 + .../gimp/2.0/remove-cc-reference.patch | 13 + pkgs/top-level/all-packages.nix | 17 ++ 6 files changed, 290 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/graphics/gimp/2.0/default.nix create mode 100644 pkgs/applications/graphics/gimp/2.0/force-enable-libheif.patch create mode 100644 pkgs/applications/graphics/gimp/2.0/hardcode-plugin-interpreters.patch create mode 100644 pkgs/applications/graphics/gimp/2.0/remove-cc-reference.patch diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 933cf114ec1c..71689e45fb8c 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -62,7 +62,7 @@ - [testers.shellcheck](https://nixos.org/manual/nixpkgs/unstable/#tester-shellcheck) now warns when `name` is not provided. The `name` argument will become mandatory in a future release. -- `gimp` has been upgraded to [GIMP 3.0](https://www.gimp.org/news/2025/03/16/gimp-3-0-released/). +- `gimp` has been upgraded to [GIMP 3.0](https://www.gimp.org/news/2025/03/16/gimp-3-0-released/). Most plug-ins are not compatible so the old version has been preserved as `gimp2`, `gimp2Plugins` and `gimp2-with-plugins`. - `grafana-agent` and `services.grafana-agent` have been removed in favor of Grafana Alloy (`grafana-alloy` and `services.alloy`), as they depend on an EOL compiler version diff --git a/pkgs/applications/graphics/gimp/2.0/default.nix b/pkgs/applications/graphics/gimp/2.0/default.nix new file mode 100644 index 000000000000..e5e552f299f9 --- /dev/null +++ b/pkgs/applications/graphics/gimp/2.0/default.nix @@ -0,0 +1,226 @@ +{ + stdenv, + lib, + fetchurl, + replaceVars, + autoreconfHook, + pkg-config, + intltool, + babl, + gegl, + gtk2, + glib, + gdk-pixbuf, + isocodes, + pango, + cairo, + freetype, + fontconfig, + lcms, + libpng, + libjpeg, + libjxl, + poppler, + poppler_data, + libtiff, + libmng, + librsvg, + libwmf, + zlib, + libzip, + ghostscript, + aalib, + shared-mime-info, + libexif, + gettext, + makeWrapper, + gtk-doc, + xorg, + glib-networking, + libmypaint, + gexiv2, + harfbuzz, + mypaint-brushes1, + libwebp, + libheif, + libxslt, + libgudev, + openexr, + desktopToDarwinBundle, + AppKit, + Cocoa, + gtk-mac-integration-gtk2, + withPython ? false, + python2, +}: + +let + python = python2.withPackages (pp: [ pp.pygtk ]); +in +stdenv.mkDerivation (finalAttrs: { + pname = "gimp"; + version = "2.10.38"; + + outputs = [ + "out" + "dev" + ]; + + src = fetchurl { + url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.bz2"; + sha256 = "sha256-UKhF7sEciDH+hmFweVD1uERuNfMO37ms+Y+FwRM/hW4="; + }; + + patches = [ + # to remove compiler from the runtime closure, reference was retained via + # gimp --version --verbose output + (replaceVars ./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 + + # GIMP queries libheif.pc for builtin encoder/decoder support to determine if AVIF/HEIC files are supported + # (see https://gitlab.gnome.org/GNOME/gimp/-/blob/a8b1173ca441283971ee48f4778e2ffd1cca7284/configure.ac?page=2#L1846-1852) + # These variables have been removed since libheif 1.18.0 + # (see https://github.com/strukturag/libheif/commit/cf0d89c6e0809427427583290547a7757428cf5a) + # This has already been fixed for the upcoming GIMP 3, but the fix has not been backported to 2.x yet + # (see https://gitlab.gnome.org/GNOME/gimp/-/issues/9080) + ./force-enable-libheif.patch + ]; + + nativeBuildInputs = + [ + autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am + pkg-config + intltool + gettext + makeWrapper + gtk-doc + libxslt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; + + buildInputs = + [ + babl + gegl + gtk2 + glib + gdk-pixbuf + pango + cairo + gexiv2 + harfbuzz + isocodes + freetype + fontconfig + lcms + libpng + libjpeg + libjxl + 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.hostPlatform.isDarwin [ + AppKit + Cocoa + gtk-mac-integration-gtk2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libgudev + ] + ++ lib.optionals withPython [ + python + # Duplicated here because python.withPackages does not expose the dev output with pkg-config files + python2.pkgs.pygtk + ]; + + # needed by gimp-2.0.pc + propagatedBuildInputs = [ + gegl + ]; + + 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" + ] + ++ lib.optionals (!withPython) [ + "--disable-python" # depends on Python2 which was EOLed on 2020-01-01 + ]; + + enableParallelBuilding = true; + + doCheck = true; + + env = { + NIX_CFLAGS_COMPILE = toString ( + [ ] + ++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=incompatible-pointer-types" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DGDK_OSX_BIG_SUR=16" ] + ); + + # 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 finalAttrs.version} \ + --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" + ''; + + passthru = { + # The declarations for `gimp-with-plugins` wrapper, + # used for determining plug-in installation paths + 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"; + + # probably its a good idea to use the same gtk in plugins ? + gtk = gtk2; + + python2Support = withPython; + }; + + meta = with lib; { + description = "GNU Image Manipulation Program"; + homepage = "https://www.gimp.org/"; + maintainers = with maintainers; [ jtojnar ]; + license = licenses.gpl3Plus; + platforms = platforms.unix; + mainProgram = "gimp"; + }; +}) diff --git a/pkgs/applications/graphics/gimp/2.0/force-enable-libheif.patch b/pkgs/applications/graphics/gimp/2.0/force-enable-libheif.patch new file mode 100644 index 000000000000..de3dfb09b95e --- /dev/null +++ b/pkgs/applications/graphics/gimp/2.0/force-enable-libheif.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac +index 48c3c77892..3189781817 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1843,13 +1843,13 @@ can_export_heic=no + can_import_avif=no + can_export_avif=no + if test "x$have_libheif" = xyes; then +- can_import_heic=`$PKG_CONFIG --variable=builtin_h265_decoder libheif` +- can_export_heic=`$PKG_CONFIG --variable=builtin_h265_encoder libheif` ++ can_import_heic=yes ++ can_export_heic=yes + if test "x$can_import_heic" = xyes; then + MIME_TYPES="$MIME_TYPES;image/heif;image/heic" + fi +- can_import_avif=`$PKG_CONFIG --variable=builtin_avif_decoder libheif` +- can_export_avif=`$PKG_CONFIG --variable=builtin_avif_encoder libheif` ++ can_import_avif=yes ++ can_export_avif=yes + if test "x$can_import_avif" = xyes; then + MIME_TYPES="$MIME_TYPES;image/avif" + fi diff --git a/pkgs/applications/graphics/gimp/2.0/hardcode-plugin-interpreters.patch b/pkgs/applications/graphics/gimp/2.0/hardcode-plugin-interpreters.patch new file mode 100644 index 000000000000..1528404c31d2 --- /dev/null +++ b/pkgs/applications/graphics/gimp/2.0/hardcode-plugin-interpreters.patch @@ -0,0 +1,11 @@ +--- a/plug-ins/pygimp/Makefile.am ++++ b/plug-ins/pygimp/Makefile.am +@@ -157,7 +157,7 @@ install-interp-file: + echo 'python=$(PYBIN_PATH)' > '$(DESTDIR)$(pyinterpfile)' + echo 'python2=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)' + echo '/usr/bin/python=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)' +- echo ":Python:E::py::`basename $(PYTHON)`:" >> '$(DESTDIR)$(pyinterpfile)' ++ echo ":Python:E::py::$(PYTHON):" >> '$(DESTDIR)$(pyinterpfile)' + + install-data-local: install-env-file install-interp-file + diff --git a/pkgs/applications/graphics/gimp/2.0/remove-cc-reference.patch b/pkgs/applications/graphics/gimp/2.0/remove-cc-reference.patch new file mode 100644 index 000000000000..20c350bdaea1 --- /dev/null +++ b/pkgs/applications/graphics/gimp/2.0/remove-cc-reference.patch @@ -0,0 +1,13 @@ +diff --git a/app/gimp-version.c b/app/gimp-version.c +index 3d1894a036..48bb670b64 100644 +--- a/app/gimp-version.c ++++ b/app/gimp-version.c +@@ -230,7 +230,7 @@ gimp_version (gboolean be_verbose, + GIMP_BUILD_ID, + gimp_version_get_revision (), + GIMP_BUILD_PLATFORM_FAMILY, +- CC_VERSION, ++ "@cc_version@", + lib_versions); + g_free (lib_versions); + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d14129b927c7..9e81417d38f8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14554,6 +14554,23 @@ with pkgs; gimpPlugins = recurseIntoAttrs (callPackage ../applications/graphics/gimp/plugins { }); + gimp2 = callPackage ../applications/graphics/gimp/2.0 { + autoreconfHook = buildPackages.autoreconfHook269; + lcms = lcms2; + inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; + }; + + gimp2-with-plugins = callPackage ../applications/graphics/gimp/wrapper.nix { + gimpPlugins = gimp2Plugins; + plugins = null; # All packaged plugins enabled, if not explicit plugin list supplied + }; + + gimp2Plugins = recurseIntoAttrs ( + callPackage ../applications/graphics/gimp/plugins { + gimp = gimp2; + } + ); + girara = callPackage ../applications/misc/girara { gtk = gtk3; }; From 9a6a23bd11ad3c47df085e7564d8edee7b6c3208 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 27 Mar 2025 23:25:57 +0100 Subject: [PATCH 11/12] gimp2: Unmaintain Superseded by GIMP 3 in the `gimp` package. --- pkgs/applications/graphics/gimp/2.0/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/gimp/2.0/default.nix b/pkgs/applications/graphics/gimp/2.0/default.nix index e5e552f299f9..1d64cc10806f 100644 --- a/pkgs/applications/graphics/gimp/2.0/default.nix +++ b/pkgs/applications/graphics/gimp/2.0/default.nix @@ -218,7 +218,7 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { description = "GNU Image Manipulation Program"; homepage = "https://www.gimp.org/"; - maintainers = with maintainers; [ jtojnar ]; + maintainers = with maintainers; [ ]; license = licenses.gpl3Plus; platforms = platforms.unix; mainProgram = "gimp"; From bc17b33471454e8bce6edf92de8030a121c15dbd Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 2 Apr 2025 01:05:57 +0200 Subject: [PATCH 12/12] gimp: Switch back go GIMP 2 Temporarily, rename `gimp` to `gimp3` and `gimp2` back to `gimp`. Revert once GIMP 3 works on Darwin again and performance regressions are debugged. --- doc/release-notes/rl-2505.section.md | 2 +- pkgs/top-level/all-packages.nix | 36 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 71689e45fb8c..10ec2a0a023b 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -62,7 +62,7 @@ - [testers.shellcheck](https://nixos.org/manual/nixpkgs/unstable/#tester-shellcheck) now warns when `name` is not provided. The `name` argument will become mandatory in a future release. -- `gimp` has been upgraded to [GIMP 3.0](https://www.gimp.org/news/2025/03/16/gimp-3-0-released/). Most plug-ins are not compatible so the old version has been preserved as `gimp2`, `gimp2Plugins` and `gimp2-with-plugins`. +- [GIMP 3.0](https://www.gimp.org/news/2025/03/16/gimp-3-0-released/) available as `gimp3`. - `grafana-agent` and `services.grafana-agent` have been removed in favor of Grafana Alloy (`grafana-alloy` and `services.alloy`), as they depend on an EOL compiler version diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9e81417d38f8..0c9af914fbf6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14543,7 +14543,24 @@ with pkgs; inherit (xorg) xlsfonts; - gimp = callPackage ../applications/graphics/gimp { + gimp3 = callPackage ../applications/graphics/gimp { + lcms = lcms2; + inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; + }; + + gimp3-with-plugins = callPackage ../applications/graphics/gimp/wrapper.nix { + gimpPlugins = gimp3Plugins; + plugins = null; # All packaged plugins enabled, if not explicit plugin list supplied + }; + + gimp3Plugins = recurseIntoAttrs ( + callPackage ../applications/graphics/gimp/plugins { + gimp = gimp3; + } + ); + + gimp = callPackage ../applications/graphics/gimp/2.0 { + autoreconfHook = buildPackages.autoreconfHook269; lcms = lcms2; inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; }; @@ -14554,23 +14571,6 @@ with pkgs; gimpPlugins = recurseIntoAttrs (callPackage ../applications/graphics/gimp/plugins { }); - gimp2 = callPackage ../applications/graphics/gimp/2.0 { - autoreconfHook = buildPackages.autoreconfHook269; - lcms = lcms2; - inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; - }; - - gimp2-with-plugins = callPackage ../applications/graphics/gimp/wrapper.nix { - gimpPlugins = gimp2Plugins; - plugins = null; # All packaged plugins enabled, if not explicit plugin list supplied - }; - - gimp2Plugins = recurseIntoAttrs ( - callPackage ../applications/graphics/gimp/plugins { - gimp = gimp2; - } - ); - girara = callPackage ../applications/misc/girara { gtk = gtk3; };