gimp: 2.99.14-unstable-2023-03-17 → 3.0.0-RC1

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 <sandro.jaeckel@gmail.com>

Jan Tojnar 328415cc d65529fc

+77 -66
+71 -45
pkgs/applications/graphics/gimp/default.nix
··· 1 1 { 2 2 stdenv, 3 3 lib, 4 - fetchFromGitLab, 4 + fetchurl, 5 + fetchpatch, 5 6 replaceVars, 6 7 meson, 7 8 ninja, 8 9 pkg-config, 9 10 babl, 11 + cfitsio, 10 12 gegl, 11 13 gtk3, 12 14 glib, ··· 21 23 fontconfig, 22 24 lcms, 23 25 libpng, 26 + libiff, 27 + libilbm, 24 28 libjpeg, 25 29 libjxl, 26 30 poppler, ··· 41 45 libxslt, 42 46 gobject-introspection, 43 47 vala, 48 + gi-docgen, 44 49 perl, 45 50 appstream-glib, 46 51 desktop-file-utils, ··· 48 53 glib-networking, 49 54 json-glib, 50 55 libmypaint, 56 + llvmPackages, 51 57 gexiv2, 52 58 harfbuzz, 53 59 mypaint-brushes1, ··· 63 69 desktopToDarwinBundle, 64 70 AppKit, 65 71 Cocoa, 66 - gtk-mac-integration-gtk3, 67 - unstableGitUpdater, 68 72 }: 69 73 70 74 let ··· 76 80 in 77 81 stdenv.mkDerivation (finalAttrs: { 78 82 pname = "gimp"; 79 - version = "2.99.14-unstable-2023-03-17"; 83 + version = "3.0.0-RC1"; 80 84 81 85 outputs = [ 82 86 "out" 83 87 "dev" 88 + "devdoc" 84 89 ]; 85 90 86 - # We should not use fetchFromGitLab because the build system 87 - # will complain and mark the build as unsupported when it cannot find 88 - # .git directory but downloading the whole repo is jus too much. 89 - src = fetchFromGitLab rec { 90 - name = "gimp-dev-${rev}"; # to make sure the hash is updated 91 - domain = "gitlab.gnome.org"; 92 - owner = "GNOME"; 93 - repo = "gimp"; 94 - rev = "ad7a2e53eb72ef471566fa2d0ce9faeec929fbcf"; 95 - hash = "sha256-IJMUJc817EDWIRqqkCuwAcSw7gcgCkXxPan5fEq1AO0="; 91 + src = fetchurl { 92 + url = "https://download.gimp.org/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.xz"; 93 + hash = "sha256-s9CyZMXjjnifqvNBcAM5fzJAAUxZx/QX+co705xf+2Y="; 96 94 }; 97 95 98 96 patches = [ ··· 104 102 105 103 # Use absolute paths instead of relying on PATH 106 104 # to make sure plug-ins are loaded by the correct interpreter. 105 + # TODO: This now only appears to be used on Windows. 107 106 (replaceVars ./hardcode-plugin-interpreters.patch { 108 107 python_interpreter = python.interpreter; 109 108 PYTHON_PATH = null; ··· 115 114 session_conf = "${dbus.out}/share/dbus-1/session.conf"; 116 115 }) 117 116 118 - # Since we pass absolute datadirs to Meson, the path is resolved incorrectly. 119 - # What is more, even the assumption that iso-codes have the same datadir 120 - # subdirectory as GIMP is incorrect. Though, there is not a way to obtain 121 - # the correct directory at the moment. There is a MR against isocodes to fix that: 122 - # https://salsa.debian.org/iso-codes-team/iso-codes/merge_requests/11 123 - ./fix-isocodes-paths.patch 117 + # Fix pkg-config file. 118 + # https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/2037 119 + (fetchpatch { 120 + url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/a18e1806dbc9b180aefabb2c0fae43493f1ef14a.patch"; 121 + hash = "sha256-BUrPm9lB/aiybB2Sd3TKlJ+59ITMZlNUBXJP5ZdLQ44="; 122 + }) 124 123 ]; 125 124 126 125 nativeBuildInputs = ··· 135 134 perl 136 135 vala 137 136 137 + # for docs 138 + gi-docgen 139 + 138 140 # for tests 139 141 desktop-file-utils 140 142 ] ··· 150 152 [ 151 153 appstream-glib # for library 152 154 babl 155 + cfitsio 153 156 gegl 154 157 gtk3 155 158 glib ··· 164 167 fontconfig 165 168 lcms 166 169 libpng 170 + libiff 171 + libilbm 167 172 libjpeg 168 173 libjxl 169 174 poppler ··· 204 209 gjs 205 210 ] 206 211 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 212 + llvmPackages.openmp 207 213 AppKit 208 214 Cocoa 209 - gtk-mac-integration-gtk3 210 215 ] 211 216 ++ lib.optionals stdenv.hostPlatform.isLinux [ 212 217 libgudev ··· 215 220 propagatedBuildInputs = [ 216 221 # needed by gimp-3.0.pc 217 222 gegl 223 + cairo 224 + pango 225 + gexiv2 218 226 ]; 219 227 220 228 mesonFlags = ··· 227 235 (lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux) 228 236 # Not very important to do downstream, save a dependency. 229 237 "-Dappdata-test=disabled" 230 - # Incompatible with version in nixpkgs 231 - "-Djpeg-xl=disabled" 232 - # Broken references 233 - "-Dgi-docgen=disabled" 234 238 ] 235 239 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 236 240 "-Dalsa=disabled" 237 - "-Djavascript=false" 241 + "-Djavascript=disabled" 238 242 ]; 239 243 240 244 doCheck = true; ··· 243 247 # The check runs before glib-networking is registered 244 248 GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules"; 245 249 246 - NIX_CFLAGS_COMPILE = toString ( 247 - [ ] 248 - ++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=incompatible-pointer-types" ] 249 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DGDK_OSX_BIG_SUR=16" ] 250 - ); 250 + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DGDK_OSX_BIG_SUR=16"; 251 251 252 252 # Check if librsvg was built with --disable-pixbuf-loader. 253 253 PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; ··· 258 258 app/tests/create_test_env.sh \ 259 259 tools/gimp-mkenums 260 260 261 - # Bypass the need for downloading git archive. 262 - substitute app/git-version.h.in git-version.h \ 263 - --subst-var-by GIMP_GIT_VERSION "GIMP_2.99.?-g${builtins.substring 0 10 finalAttrs.src.rev}" \ 264 - --subst-var-by GIMP_GIT_VERSION_ABBREV "${builtins.substring 0 10 finalAttrs.src.rev}" \ 265 - --subst-var-by GIMP_GIT_LAST_COMMIT_YEAR "${builtins.head (builtins.match ".+\-unstable-([0-9]{4})-[0-9]{2}-[0-9]{2}" finalAttrs.version)}" 261 + # GIMP is executed at build time so we need to fix this. 262 + # TODO: Look into if we can fix the interp thing. 263 + 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 264 + patchShebangs \ 265 + 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 266 266 ''; 267 267 268 + preBuild = 269 + let 270 + librarySuffix = 271 + if stdenv.hostPlatform.extensions.library == ".so" then 272 + "3.0.so.0" 273 + else if stdenv.hostPlatform.extensions.library == ".dylib" then 274 + "3.0.0.dylib" 275 + else 276 + throw "Unsupported library extension ‘${stdenv.hostPlatform.extensions.library}’"; 277 + in 278 + '' 279 + # Our gobject-introspection patches make the shared library paths absolute 280 + # in the GIR files. When running GIMP in build or check phase, it will try 281 + # to use plug-ins, which import GIMP introspection files which will try 282 + # to load the GIMP libraries which will not be installed yet. 283 + # So we need to replace the absolute path with a local one. 284 + # We are using a symlink that will be overridden during installation. 285 + mkdir -p "$out/lib" 286 + ln -s "$PWD/libgimp/libgimp-${librarySuffix}" \ 287 + "$PWD/libgimpbase/libgimpbase-${librarySuffix}" \ 288 + "$PWD/libgimpcolor/libgimpcolor-${librarySuffix}" \ 289 + "$PWD/libgimpconfig/libgimpconfig-${librarySuffix}" \ 290 + "$PWD/libgimpmath/libgimpmath-${librarySuffix}" \ 291 + "$PWD/libgimpmodule/libgimpmodule-${librarySuffix}" \ 292 + "$out/lib/" 293 + ''; 294 + 268 295 preCheck = '' 269 296 # Avoid “Error retrieving accessibility bus address” 270 297 export NO_AT_BRIDGE=1 271 298 # Fix storing recent file list in tests 272 299 export HOME="$TMPDIR" 273 - export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:$XDG_DATA_DIRS" 300 + export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:${adwaita-icon-theme}/share:$XDG_DATA_DIRS" 274 301 ''; 275 302 276 303 preFixup = '' ··· 284 311 }") 285 312 ''; 286 313 314 + postFixup = '' 315 + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. 316 + moveToOutput "share/doc" "$devdoc" 317 + ''; 318 + 287 319 passthru = { 288 320 # The declarations for `gimp-with-plugins` wrapper, 289 321 # used for determining plug-in installation paths 290 - majorVersion = "2.99"; 322 + majorVersion = "${lib.versions.major finalAttrs.version}.0"; 291 323 targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}"; 292 324 targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}"; 293 325 targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins"; ··· 295 327 296 328 # probably its a good idea to use the same gtk in plugins ? 297 329 gtk = gtk3; 298 - 299 - updateScript = unstableGitUpdater { 300 - stableVersion = true; 301 - tagPrefix = "GIMP_"; 302 - tagConverter = "sed s/_/./g"; 303 - }; 304 330 }; 305 331 306 332 meta = with lib; { ··· 308 334 homepage = "https://www.gimp.org/"; 309 335 maintainers = with maintainers; [ jtojnar ]; 310 336 license = licenses.gpl3Plus; 311 - platforms = platforms.unix; 337 + platforms = platforms.linux; 312 338 mainProgram = "gimp"; 313 339 }; 314 340 })
-15
pkgs/applications/graphics/gimp/fix-isocodes-paths.patch
··· 1 - diff --git a/meson.build b/meson.build 2 - index 6a19df48a1..3fd77077c1 100644 3 - --- a/meson.build 4 - +++ b/meson.build 5 - @@ -924,8 +924,8 @@ endif 6 - isocodes = dependency('iso-codes', required: false) 7 - if isocodes.found() 8 - isocodes_prefix = isocodes.get_variable(pkgconfig: 'prefix') 9 - - isocodes_location = isocodes_prefix / get_option('datadir') / 'xml' / 'iso-codes' 10 - - isocodes_localedir= isocodes_prefix / get_option('datadir') / 'locale' 11 - + isocodes_location = isocodes_prefix / 'share' / 'xml' / 'iso-codes' 12 - + isocodes_localedir= isocodes_prefix / 'share' / 'locale' 13 - endif 14 - conf.set('HAVE_ISO_CODES', isocodes.found()) 15 -
+3 -3
pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch
··· 1 1 --- a/plug-ins/python/pygimp.interp.in 2 2 +++ b/plug-ins/python/pygimp.interp.in 3 3 @@ -2,4 +2,4 @@ python=@PYTHON_PATH@ 4 - python3=@PYTHON_PATH@ 5 - /usr/bin/python=@PYTHON_PATH@ 6 - /usr/bin/python3=@PYTHON_PATH@ 4 + python3=@PYTHON_PATH@python.exe 5 + /usr/bin/python=@PYTHON_PATH@python.exe 6 + /usr/bin/python3=@PYTHON_PATH@python.exe 7 7 -:Python:E::py::python3: 8 8 +:Python:E::py::@python_interpreter@:
+1 -1
pkgs/applications/graphics/gimp/plugins/default.nix
··· 37 37 attrs: 38 38 let 39 39 name = attrs.name or "${attrs.pname}-${attrs.version}"; 40 - pkgConfigMajorVersion = if gimp.majorVersion == "2.0" then "2" else "3"; 40 + pkgConfigMajorVersion = lib.versions.major gimp.version; 41 41 in 42 42 stdenv.mkDerivation ( 43 43 {
+1 -1
pkgs/applications/graphics/gimp/wrapper.nix
··· 20 20 ]; 21 21 exeVersion = 22 22 if gimp.majorVersion == "2.0" then lib.versions.majorMinor gimp.version else gimp.majorVersion; 23 - majorVersion = if gimp.majorVersion == "2.0" then "2" else "3"; 23 + majorVersion = lib.versions.major gimp.version; 24 24 25 25 in 26 26 symlinkJoin {
+1 -1
pkgs/by-name/gm/gmic-qt/package.nix
··· 103 103 (lib.cmakeFeature "GMIC_QT_HOST" ( 104 104 if variant == "standalone" then 105 105 "none" 106 - else if variant == "gimp" && gimp.majorVersion == "2.99" then 106 + else if variant == "gimp" && gimp.majorVersion == "3.0" then 107 107 "gimp3" 108 108 else 109 109 variant