diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 2f117e12ae18..428adcd4d562 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -68,6 +68,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 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 and will become EOL during the 25.05 lifecycle. 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..1d64cc10806f --- /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; [ ]; + license = licenses.gpl3Plus; + platforms = platforms.unix; + mainProgram = "gimp"; + }; +}) diff --git a/pkgs/applications/graphics/gimp/force-enable-libheif.patch b/pkgs/applications/graphics/gimp/2.0/force-enable-libheif.patch similarity index 100% rename from pkgs/applications/graphics/gimp/force-enable-libheif.patch rename to pkgs/applications/graphics/gimp/2.0/force-enable-libheif.patch 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/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index e5e552f299f9..0b2406c89f8b 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -3,21 +3,27 @@ lib, fetchurl, replaceVars, - autoreconfHook, + meson, + ninja, pkg-config, - intltool, babl, + cfitsio, gegl, - gtk2, + gtk3, glib, gdk-pixbuf, + graphviz, isocodes, pango, cairo, + libarchive, + luajit, freetype, fontconfig, lcms, libpng, + libiff, + libilbm, libjpeg, libjxl, poppler, @@ -31,44 +37,59 @@ ghostscript, aalib, shared-mime-info, + python3, libexif, gettext, - makeWrapper, - gtk-doc, + wrapGAppsHook3, + libxslt, + gobject-introspection, + vala, + gi-docgen, + perl, + appstream-glib, + desktop-file-utils, xorg, glib-networking, + json-glib, libmypaint, + llvmPackages, 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, }: 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 = "3.0.2"; outputs = [ "out" "dev" + "devdoc" ]; 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="; + url = "https://download.gimp.org/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.xz"; + hash = "sha256-VG3cMMstDnkSPH/LTXghHh7npqrOkaagrYy8v26lcaI="; }; patches = [ @@ -80,26 +101,40 @@ 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 + # TODO: This now only appears to be used on Windows. + (replaceVars ./hardcode-plugin-interpreters.patch { + python_interpreter = python.interpreter; + PYTHON_EXE = 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"; + }) ]; 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 docs + gi-docgen + + # for tests + desktop-file-utils + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + dbus + xvfb-run ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle @@ -107,13 +142,16 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ + appstream-glib # for library babl + cfitsio gegl - gtk2 + gtk3 glib gdk-pixbuf pango cairo + libarchive gexiv2 harfbuzz isocodes @@ -121,6 +159,8 @@ stdenv.mkDerivation (finalAttrs: { fontconfig lcms libpng + libiff + libilbm libjpeg libjxl poppler @@ -135,69 +175,137 @@ 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 [ + llvmPackages.openmp 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 = [ + # needed by gimp-3.0.pc gegl + cairo + pango + gexiv2 ]; - 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" ] - ++ lib.optionals (!withPython) [ - "--disable-python" # depends on Python2 which was EOLed on 2020-01-01 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-Dalsa=disabled" + "-Djavascript=disabled" ]; - 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" ] - ); + # The check runs before glib-networking is registered + GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules"; + + 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}"; }; - 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 + + # 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}:${adwaita-icon-theme}/share:$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 + # for gimp-script-fu-interpreter-3.0 invoked by shebang of some plug-ins + "$out" + ] + }") ''; postFixup = '' - wrapProgram $out/bin/gimp-${lib.versions.majorMinor finalAttrs.version} \ - --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. + moveToOutput "share/doc" "$devdoc" ''; passthru = { @@ -210,9 +318,7 @@ stdenv.mkDerivation (finalAttrs: { targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts"; # probably its a good idea to use the same gtk in plugins ? - gtk = gtk2; - - python2Support = withPython; + gtk = gtk3; }; meta = with lib; { @@ -220,7 +326,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/hardcode-plugin-interpreters.patch b/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch index 1528404c31d2..6a0ec0af6262 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_EXE@ + python3=@PYTHON_EXE@ + /usr/bin/python=@PYTHON_EXE@ + /usr/bin/python3=@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 b237c5f1bcf1..9c86343599b1 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 = lib.versions.major gimp.version; 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/remove-cc-reference.patch b/pkgs/applications/graphics/gimp/remove-cc-reference.patch index 20c350bdaea1..8b62b801f02b 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, +@@ -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 new file mode 100644 index 000000000000..da9152eeef01 --- /dev/null +++ b/pkgs/applications/graphics/gimp/tests-dbus-conf.patch @@ -0,0 +1,11 @@ +--- 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/applications/graphics/gimp/wrapper.nix b/pkgs/applications/graphics/gimp/wrapper.nix index 82ff058ba7dc..efac48c2f7e2 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 = lib.versions.major gimp.version; 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/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 = [ diff --git a/pkgs/by-name/gm/gmic-qt/package.nix b/pkgs/by-name/gm/gmic-qt/package.nix index 4a07ba02bcef..629097841c03 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 == "3.0" then + "gimp3" + else + variant + )) ]; postFixup = lib.optionalString (variant == "gimp") '' 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 = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 90df80b9aa7a..deb2e805d58c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14514,7 +14514,23 @@ 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;