gnu: veusz: Update to 3.6.2.

* gnu/packages/maths.scm (veusz): Update to 3.6.2.
[build-system]: Switch to pyproject-build-system.
[arguments]: Improve style, use gexps.
{phases}: Remove phase 'fix-sip-dir. Add phase
'fix-pyqt5-include-dir. Refresh phase 'wrap-executable.
[native-inputs]: Add python-astropy, python-setuptools,
python-wheel. Remove python-sip-4.
[inputs]: Add qtwayland-5.

Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-03-31 08:18:49 +02:00 committed by Andreas Enge
parent f806aa80aa
commit 2be1c0e507
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

@ -108,6 +108,7 @@
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix build-system ruby) #:use-module (guix build-system ruby)
#:use-module (gnu packages algebra) #:use-module (gnu packages algebra)
#:use-module (gnu packages astronomy)
#:use-module (gnu packages audio) #:use-module (gnu packages audio)
#:use-module (gnu packages autotools) #:use-module (gnu packages autotools)
#:use-module (gnu packages backup) #:use-module (gnu packages backup)
@ -3551,46 +3552,51 @@ ASCII text files using Gmsh's own scripting language.")
(define-public veusz (define-public veusz
(package (package
(name "veusz") (name "veusz")
(version "3.3.1") (version "3.6.2")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "veusz" version)) (uri (pypi-uri "veusz" version))
(sha256 (sha256
(base32 "1q7hi1qwwg4pgiz62isvv1pia85m13bspdpp1q3mrnwl11in0ag0")))) (base32 "1lcmcfr0dcam8g1fp5qip8jnxglxx7i62ln3ix6l4c2bbv21l5y2"))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
`(;; Tests will fail because they depend on optional packages like (list
;; python-astropy, which is not packaged. ;; Tests currently fail with exception TypeError:
;; calling <function version ...> returned 3.6.2, not a test
#:tests? #f #:tests? #f
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
;; Veusz will append 'PyQt5' to sip_dir by default. That is not how ;; Veusz uses python's site-packages to look for pyqt5_include_dir.
;; the path is defined in Guix, therefore we have to change it. (add-after 'unpack 'fix-pyqt5-include-dir
(add-after 'unpack 'fix-sip-dir
(lambda _ (lambda _
(substitute* "pyqtdistutils.py" (substitute* "pyqt_setuptools.py"
(("os.path.join\\(sip_dir, 'PyQt5'\\)") "sip_dir")))) (("get_path\\('platlib'\\)")
;; Now we have to pass the correct sip_dir to setup.py. (format #f "~s"
(replace 'build (string-append
(lambda* (#:key inputs #:allow-other-keys) #$(this-package-input "python-pyqt")
;; We need to tell setup.py where to locate QtCoremod.sip "/lib/python"
((@@ (guix build python-build-system) call-setuppy) #$(version-major+minor
"build_ext" (package-version python-wrapper))
(list (string-append "--sip-dir=" "/site-packages"))))))
(search-input-directory inputs "share/sip"))))))
;; Ensure that icons are found at runtime. ;; Ensure that icons are found at runtime.
(add-after 'install 'wrap-executable (add-after 'wrap 'wrap-executable
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (wrap-program (string-append #$output "/bin/veusz")
(wrap-program (string-append out "/bin/veusz")
`("QT_PLUGIN_PATH" prefix `("QT_PLUGIN_PATH" prefix
,(list (string-append (assoc-ref inputs "qtsvg") ,(list (string-append
"/lib/qt5/plugins/")))))))))) (string-join
(list #$(this-package-input "qtbase")
#$(this-package-input "qtsvg")
#$(this-package-input "qtwayland"))
"/lib/qt5/plugins:")
"/lib/qt5/plugins")))))))))
(native-inputs (native-inputs
(list pkg-config (list pkg-config
;;("python-astropy" ,python-astropy) ;; FIXME: Package this. python-astropy
qttools-5 python-sip-4)) python-setuptools
python-wheel
qttools-5))
(inputs (inputs
(list bash-minimal (list bash-minimal
ghostscript ;optional, for EPS/PS output ghostscript ;optional, for EPS/PS output
@ -3598,7 +3604,8 @@ ASCII text files using Gmsh's own scripting language.")
python-h5py ;optional, for HDF5 data python-h5py ;optional, for HDF5 data
python-pyqt python-pyqt
qtbase-5 qtbase-5
qtsvg-5)) qtsvg-5
qtwayland-5))
(propagated-inputs (propagated-inputs
(list python-numpy)) (list python-numpy))
(home-page "https://veusz.github.io/") (home-page "https://veusz.github.io/")