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 { 2 stdenv, 3 lib, 4 - fetchFromGitLab, 5 replaceVars, 6 meson, 7 ninja, 8 pkg-config, 9 babl, 10 gegl, 11 gtk3, 12 glib, ··· 21 fontconfig, 22 lcms, 23 libpng, 24 libjpeg, 25 libjxl, 26 poppler, ··· 41 libxslt, 42 gobject-introspection, 43 vala, 44 perl, 45 appstream-glib, 46 desktop-file-utils, ··· 48 glib-networking, 49 json-glib, 50 libmypaint, 51 gexiv2, 52 harfbuzz, 53 mypaint-brushes1, ··· 63 desktopToDarwinBundle, 64 AppKit, 65 Cocoa, 66 - gtk-mac-integration-gtk3, 67 - unstableGitUpdater, 68 }: 69 70 let ··· 76 in 77 stdenv.mkDerivation (finalAttrs: { 78 pname = "gimp"; 79 - version = "2.99.14-unstable-2023-03-17"; 80 81 outputs = [ 82 "out" 83 "dev" 84 ]; 85 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="; 96 }; 97 98 patches = [ ··· 104 105 # Use absolute paths instead of relying on PATH 106 # to make sure plug-ins are loaded by the correct interpreter. 107 (replaceVars ./hardcode-plugin-interpreters.patch { 108 python_interpreter = python.interpreter; 109 PYTHON_PATH = null; ··· 115 session_conf = "${dbus.out}/share/dbus-1/session.conf"; 116 }) 117 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 124 ]; 125 126 nativeBuildInputs = ··· 135 perl 136 vala 137 138 # for tests 139 desktop-file-utils 140 ] ··· 150 [ 151 appstream-glib # for library 152 babl 153 gegl 154 gtk3 155 glib ··· 164 fontconfig 165 lcms 166 libpng 167 libjpeg 168 libjxl 169 poppler ··· 204 gjs 205 ] 206 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 207 AppKit 208 Cocoa 209 - gtk-mac-integration-gtk3 210 ] 211 ++ lib.optionals stdenv.hostPlatform.isLinux [ 212 libgudev ··· 215 propagatedBuildInputs = [ 216 # needed by gimp-3.0.pc 217 gegl 218 ]; 219 220 mesonFlags = ··· 227 (lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux) 228 # Not very important to do downstream, save a dependency. 229 "-Dappdata-test=disabled" 230 - # Incompatible with version in nixpkgs 231 - "-Djpeg-xl=disabled" 232 - # Broken references 233 - "-Dgi-docgen=disabled" 234 ] 235 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 236 "-Dalsa=disabled" 237 - "-Djavascript=false" 238 ]; 239 240 doCheck = true; ··· 243 # The check runs before glib-networking is registered 244 GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules"; 245 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 - ); 251 252 # Check if librsvg was built with --disable-pixbuf-loader. 253 PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; ··· 258 app/tests/create_test_env.sh \ 259 tools/gimp-mkenums 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)}" 266 ''; 267 268 preCheck = '' 269 # Avoid “Error retrieving accessibility bus address” 270 export NO_AT_BRIDGE=1 271 # Fix storing recent file list in tests 272 export HOME="$TMPDIR" 273 - export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:$XDG_DATA_DIRS" 274 ''; 275 276 preFixup = '' ··· 284 }") 285 ''; 286 287 passthru = { 288 # The declarations for `gimp-with-plugins` wrapper, 289 # used for determining plug-in installation paths 290 - majorVersion = "2.99"; 291 targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}"; 292 targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}"; 293 targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins"; ··· 295 296 # probably its a good idea to use the same gtk in plugins ? 297 gtk = gtk3; 298 - 299 - updateScript = unstableGitUpdater { 300 - stableVersion = true; 301 - tagPrefix = "GIMP_"; 302 - tagConverter = "sed s/_/./g"; 303 - }; 304 }; 305 306 meta = with lib; { ··· 308 homepage = "https://www.gimp.org/"; 309 maintainers = with maintainers; [ jtojnar ]; 310 license = licenses.gpl3Plus; 311 - platforms = platforms.unix; 312 mainProgram = "gimp"; 313 }; 314 })
··· 1 { 2 stdenv, 3 lib, 4 + fetchurl, 5 + fetchpatch, 6 replaceVars, 7 meson, 8 ninja, 9 pkg-config, 10 babl, 11 + cfitsio, 12 gegl, 13 gtk3, 14 glib, ··· 23 fontconfig, 24 lcms, 25 libpng, 26 + libiff, 27 + libilbm, 28 libjpeg, 29 libjxl, 30 poppler, ··· 45 libxslt, 46 gobject-introspection, 47 vala, 48 + gi-docgen, 49 perl, 50 appstream-glib, 51 desktop-file-utils, ··· 53 glib-networking, 54 json-glib, 55 libmypaint, 56 + llvmPackages, 57 gexiv2, 58 harfbuzz, 59 mypaint-brushes1, ··· 69 desktopToDarwinBundle, 70 AppKit, 71 Cocoa, 72 }: 73 74 let ··· 80 in 81 stdenv.mkDerivation (finalAttrs: { 82 pname = "gimp"; 83 + version = "3.0.0-RC1"; 84 85 outputs = [ 86 "out" 87 "dev" 88 + "devdoc" 89 ]; 90 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="; 94 }; 95 96 patches = [ ··· 102 103 # Use absolute paths instead of relying on PATH 104 # to make sure plug-ins are loaded by the correct interpreter. 105 + # TODO: This now only appears to be used on Windows. 106 (replaceVars ./hardcode-plugin-interpreters.patch { 107 python_interpreter = python.interpreter; 108 PYTHON_PATH = null; ··· 114 session_conf = "${dbus.out}/share/dbus-1/session.conf"; 115 }) 116 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 + }) 123 ]; 124 125 nativeBuildInputs = ··· 134 perl 135 vala 136 137 + # for docs 138 + gi-docgen 139 + 140 # for tests 141 desktop-file-utils 142 ] ··· 152 [ 153 appstream-glib # for library 154 babl 155 + cfitsio 156 gegl 157 gtk3 158 glib ··· 167 fontconfig 168 lcms 169 libpng 170 + libiff 171 + libilbm 172 libjpeg 173 libjxl 174 poppler ··· 209 gjs 210 ] 211 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 212 + llvmPackages.openmp 213 AppKit 214 Cocoa 215 ] 216 ++ lib.optionals stdenv.hostPlatform.isLinux [ 217 libgudev ··· 220 propagatedBuildInputs = [ 221 # needed by gimp-3.0.pc 222 gegl 223 + cairo 224 + pango 225 + gexiv2 226 ]; 227 228 mesonFlags = ··· 235 (lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux) 236 # Not very important to do downstream, save a dependency. 237 "-Dappdata-test=disabled" 238 ] 239 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 240 "-Dalsa=disabled" 241 + "-Djavascript=disabled" 242 ]; 243 244 doCheck = true; ··· 247 # The check runs before glib-networking is registered 248 GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules"; 249 250 + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DGDK_OSX_BIG_SUR=16"; 251 252 # Check if librsvg was built with --disable-pixbuf-loader. 253 PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; ··· 258 app/tests/create_test_env.sh \ 259 tools/gimp-mkenums 260 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 ''; 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 + 295 preCheck = '' 296 # Avoid “Error retrieving accessibility bus address” 297 export NO_AT_BRIDGE=1 298 # Fix storing recent file list in tests 299 export HOME="$TMPDIR" 300 + export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:${adwaita-icon-theme}/share:$XDG_DATA_DIRS" 301 ''; 302 303 preFixup = '' ··· 311 }") 312 ''; 313 314 + postFixup = '' 315 + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. 316 + moveToOutput "share/doc" "$devdoc" 317 + ''; 318 + 319 passthru = { 320 # The declarations for `gimp-with-plugins` wrapper, 321 # used for determining plug-in installation paths 322 + majorVersion = "${lib.versions.major finalAttrs.version}.0"; 323 targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}"; 324 targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}"; 325 targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins"; ··· 327 328 # probably its a good idea to use the same gtk in plugins ? 329 gtk = gtk3; 330 }; 331 332 meta = with lib; { ··· 334 homepage = "https://www.gimp.org/"; 335 maintainers = with maintainers; [ jtojnar ]; 336 license = licenses.gpl3Plus; 337 + platforms = platforms.linux; 338 mainProgram = "gimp"; 339 }; 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 --- a/plug-ins/python/pygimp.interp.in 2 +++ b/plug-ins/python/pygimp.interp.in 3 @@ -2,4 +2,4 @@ python=@PYTHON_PATH@ 4 - python3=@PYTHON_PATH@ 5 - /usr/bin/python=@PYTHON_PATH@ 6 - /usr/bin/python3=@PYTHON_PATH@ 7 -:Python:E::py::python3: 8 +:Python:E::py::@python_interpreter@:
··· 1 --- a/plug-ins/python/pygimp.interp.in 2 +++ b/plug-ins/python/pygimp.interp.in 3 @@ -2,4 +2,4 @@ python=@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 -:Python:E::py::python3: 8 +:Python:E::py::@python_interpreter@:
+1 -1
pkgs/applications/graphics/gimp/plugins/default.nix
··· 37 attrs: 38 let 39 name = attrs.name or "${attrs.pname}-${attrs.version}"; 40 - pkgConfigMajorVersion = if gimp.majorVersion == "2.0" then "2" else "3"; 41 in 42 stdenv.mkDerivation ( 43 {
··· 37 attrs: 38 let 39 name = attrs.name or "${attrs.pname}-${attrs.version}"; 40 + pkgConfigMajorVersion = lib.versions.major gimp.version; 41 in 42 stdenv.mkDerivation ( 43 {
+1 -1
pkgs/applications/graphics/gimp/wrapper.nix
··· 20 ]; 21 exeVersion = 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"; 24 25 in 26 symlinkJoin {
··· 20 ]; 21 exeVersion = 22 if gimp.majorVersion == "2.0" then lib.versions.majorMinor gimp.version else gimp.majorVersion; 23 + majorVersion = lib.versions.major gimp.version; 24 25 in 26 symlinkJoin {
+1 -1
pkgs/by-name/gm/gmic-qt/package.nix
··· 103 (lib.cmakeFeature "GMIC_QT_HOST" ( 104 if variant == "standalone" then 105 "none" 106 - else if variant == "gimp" && gimp.majorVersion == "2.99" then 107 "gimp3" 108 else 109 variant
··· 103 (lib.cmakeFeature "GMIC_QT_HOST" ( 104 if variant == "standalone" then 105 "none" 106 + else if variant == "gimp" && gimp.majorVersion == "3.0" then 107 "gimp3" 108 else 109 variant