gnu: meld: Update to 3.22.0

* gnu/packages/patchutils.scm (meld): Update to 3.22.0
[build-system]: Switch to meson-build-system.
[native-inputs]: Add desktop-file-utils, itstool, gobject-introspection,
pkg-config, and python.
[inputs]: Add bash-minimal, python, and python-pycairo.
Replace gtksourceview-3 with gtksourceview-4.
[arguments]: Add #:glib-or-gtk?, #:imported-modules, and #:modules.
<#:phases>: Remove custom ‘install’ and ‘check’.
Add ‘skip-gtk-update-icon-cache’.
Adjust ‘copy-styles’ to gtksourceview-4.
Replace ‘wrap-typelib’ with ‘python-and-gi-wrap’.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Andy Tai 2023-02-22 22:37:02 -08:00 committed by Liliana Marie Prikler
parent a4fca7884c
commit f9f9efc467
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -5,6 +5,7 @@
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net> ;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2022 jgart <jgart@dismail.de> ;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2023 Andy Tai <atai@atai.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -29,6 +30,8 @@ (define-module (gnu packages patchutils)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system meson)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages ed) #:use-module (gnu packages ed)
@ -37,6 +40,7 @@ (define-module (gnu packages patchutils)
#:use-module (gnu packages check) #:use-module (gnu packages check)
#:use-module (gnu packages databases) #:use-module (gnu packages databases)
#:use-module (gnu packages django) #:use-module (gnu packages django)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages file) #:use-module (gnu packages file)
#:use-module (gnu packages gawk) #:use-module (gnu packages gawk)
#:use-module (gnu packages gettext) #:use-module (gnu packages gettext)
@ -47,8 +51,11 @@ (define-module (gnu packages patchutils)
#:use-module (gnu packages less) #:use-module (gnu packages less)
#:use-module (gnu packages mail) #:use-module (gnu packages mail)
#:use-module (gnu packages ncurses) #:use-module (gnu packages ncurses)
#:use-module (gnu packages package-management)
#:use-module (gnu packages perl) #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python) #:use-module (gnu packages python)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-xyz) #:use-module (gnu packages python-xyz)
#:use-module (gnu packages version-control) #:use-module (gnu packages version-control)
#:use-module (gnu packages xml)) #:use-module (gnu packages xml))
@ -214,7 +221,7 @@ (define-public vbindiff
(define-public meld (define-public meld
(package (package
(name "meld") (name "meld")
(version "3.20.4") (version "3.22.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
@ -222,66 +229,53 @@ (define-public meld
(version-major+minor version) (version-major+minor version)
"/meld-" version ".tar.xz")) "/meld-" version ".tar.xz"))
(sha256 (sha256
(base32 "04vx2mdbcdin0g3w8x910czfch5vyrl8drv1f2l8gxh6qvp113pl")))) (base32 "03f4j27amyi28flkks8i9bhqzd6xhm6d3c6jzxc57rzniv4hgh9z"))))
(build-system python-build-system) (build-system meson-build-system)
(native-inputs (native-inputs
`(("intltool" ,intltool) `(("desktop-file-utils" ,desktop-file-utils)
("intltool" ,intltool)
("itstool" ,itstool)
("xmllint" ,libxml2) ("xmllint" ,libxml2)
("glib-compile-schemas" ,glib "bin") ("glib-compile-schemas" ,glib "bin")
("python-pytest" ,python-pytest))) ("gobject-introspection" ,gobject-introspection)
("pkg-config" ,pkg-config)
("python" ,python)))
(inputs (inputs
`(("python-cairo" ,python-pycairo) `(("bash-minimal" ,bash-minimal)
("python" ,python)
("python-cairo" ,python-pycairo)
("python-gobject" ,python-pygobject) ("python-gobject" ,python-pygobject)
("gsettings-desktop-schemas" ,gsettings-desktop-schemas) ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
("gtksourceview" ,gtksourceview-3))) ("gtksourceview" ,gtksourceview-4)))
(propagated-inputs (propagated-inputs
(list dconf)) (list dconf))
(arguments (arguments
`(#:imported-modules ((guix build glib-or-gtk-build-system) `(#:glib-or-gtk? #t
,@%python-build-system-modules) #:imported-modules (,@%meson-build-system-modules
#:modules ((guix build python-build-system) (guix build python-build-system))
((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) #:modules ((guix build meson-build-system)
((guix build python-build-system) #:prefix python:)
(guix build utils)) (guix build utils))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; This setup.py script does not support one of the Python build (add-after 'unpack 'skip-gtk-update-icon-cache
;; system's default flags, "--single-version-externally-managed". ;; Don't create 'icon-theme.cache'.
(replace 'install (lambda _
(lambda* (#:key outputs #:allow-other-keys) (substitute* "meson_post_install.py"
(invoke "python" "setup.py" (("gtk-update-icon-cache") (which "true")))))
;; This setup.py runs gtk-update-icon-cache which we don't want.
"--no-update-icon-cache"
;; "--no-compile-schemas"
"install"
(string-append "--prefix=" (assoc-ref outputs "out"))
"--root=/")))
;; The tests need to be run after installation.
(delete 'check)
(add-after 'install 'check
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Tests look for installed package
(add-installed-pythonpath inputs outputs)
;; The tests fail when HOME=/homeless-shelter.
(setenv "HOME" "/tmp")
(invoke "py.test" "-v" "-k"
;; TODO: Those tests fail, why?
"not test_classify_change_actions")))
(add-after 'install 'copy-styles (add-after 'install 'copy-styles
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((styles "/share/gtksourceview-3.0/styles")) (let ((styles "/share/gtksourceview-4/styles"))
(copy-recursively (copy-recursively
(string-append (assoc-ref inputs "gtksourceview") styles) (string-append (assoc-ref inputs "gtksourceview") styles)
(string-append (assoc-ref outputs "out") styles)) (string-append (assoc-ref outputs "out") styles))
#t))) #t)))
(add-after 'wrap 'glib-or-gtk-wrap (add-after 'glib-or-gtk-wrap 'python-and-gi-wrap
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
(add-after 'wrap 'wrap-typelib
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (wrap-program (search-input-file outputs "bin/meld")
(wrap-program (string-append out "/bin/meld") `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")
`("GI_TYPELIB_PATH" prefix ,(python:site-packages inputs outputs)))
,(search-path-as-string->list (getenv "GI_TYPELIB_PATH")))) `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))
#t))))))
(home-page "https://meldmerge.org/") (home-page "https://meldmerge.org/")
(synopsis "Compare files, directories and working copies") (synopsis "Compare files, directories and working copies")
(description "Meld is a visual diff and merge tool targeted at (description "Meld is a visual diff and merge tool targeted at