From e2fadf0083785142977fa446977edbe5569f2106 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 26 Dec 2025 11:34:25 +0100 Subject: [PATCH] gnu: mypaint: Fix build. * gnu/packages/image.scm (mypaint)[arguments]: Disable tests; patch for compatibility. Change-Id: Id748910420669f206b08fda2650e6792b2f6a1d4 --- gnu/packages/image.scm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 570cfa85178..9abe436279b 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2013, 2015, 2016, 2025 Andreas Enge ;;; Copyright © 2014, 2015, 2016, 2020 Mark H Weaver ;;; Copyright © 2014, 2015 Alex Kost -;;; Copyright © 2014, 2016, 2017, 2018, 2019 Ricardo Wurmus +;;; Copyright © 2014, 2016, 2017, 2018, 2019, 2025 Ricardo Wurmus ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; Copyright © 2015 Amirouche Boubekki ;;; Copyright © 2014, 2017 John Darrington @@ -2891,12 +2891,25 @@ GIF, TIFF, WEBP, BMP, PNG, XPM formats.") #:modules ((guix build python-build-system) ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) (guix build utils)) + ;; XXX: Tests are not discovered. + #:tests? #false #:phases (modify-phases %standard-phases (add-after 'unpack 'python3.11-compatibility (lambda _ (substitute* "setup.py" - (("\"rU\"") "\"r\"")))) + (("\"rU\"") "\"r\"") + (("test_suite='tests'.*") "")) + (substitute* "setup.cfg" + (("install-") "install_")) + ;; This file makes Python confuse it for a module, so we rename + ;; it. + (rename-file "lib/xml.py" "lib/xmlo.py") + (substitute* (find-files "." "\\.py$") + (("lib.xml") "lib.xmlo")) + ;; This procedure has been removed. + (substitute* "lib/gettext_setup.py" + (("c = gettext.bind_textdomain_codeset.*") "c = True\n")))) (add-after 'install 'glib-or-gtk-wrap (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)) (add-after 'install 'wrap-program @@ -2904,6 +2917,10 @@ GIF, TIFF, WEBP, BMP, PNG, XPM formats.") (let* ((out (assoc-ref outputs "out")) (gdk-pixbuf (assoc-ref inputs "gdk-pixbuf")) (gtk+ (assoc-ref inputs "gtk+"))) + ;; This is replaced with an invalid shebang. + (substitute* (string-append out "/bin/mypaint") + (("#!python") + (string-append "#!" (which "python3")))) (wrap-program (string-append out "/bin/mypaint") `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))))))