3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

gnu: meson-python: Update to 0.12.1.

* gnu/packages/build-tools.scm (meson-python): Update to 0.12.1.
[build-system]: Use pyproject-build-system.
[arguments]: Delete #:phases argument.  Add #:build-backend and #:test-flags
argument.  Re-instate most tests.
[propagated-inputs]: Move patchelf to...
[native-inputs]: ... here.  Add git-minimal/pinned, and python-cython.
[home-page]: Update URL.
This commit is contained in:
Maxim Cournoyer 2023-04-10 23:08:05 -04:00
parent 3bc9082523
commit c808cd1bf9
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -77,6 +77,7 @@
#:use-module (gnu packages unicode) #:use-module (gnu packages unicode)
#:use-module (gnu packages version-control) #:use-module (gnu packages version-control)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system pyproject)
#:use-module (guix build-system python)) #:use-module (guix build-system python))
(define-public bam (define-public bam
@ -325,59 +326,25 @@ resembles Python.")
(define-public meson-python (define-public meson-python
(package (package
(name "meson-python") (name "meson-python")
(version "0.8.1") (version "0.12.1")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "meson_python" version)) (uri (pypi-uri "meson_python" version))
(sha256 (sha256
(base32 (base32
"0k2yn0iws1n184sdznzmfw4xgbqgq5cn02hpc7m0xdaxryj1ybs4")))) "1hpjw9qj6ff8ixjs0pz7qysc8v57jxgaf5n1p6bqm9bh3mc3wnrx"))))
(build-system python-build-system) (build-system pyproject-build-system)
(arguments (arguments
(list #:phases ;; The project is configured to use itself to build ('mesonpy') and fails;
#~(modify-phases %standard-phases ;; use another PEP 517 build system.
(add-after 'unpack 'avoid-ninja-dependency (list #:build-backend "setuptools.build_meta"
(lambda _ #:test-flags #~(list "tests"
;; Avoid dependency on the "ninja" PyPI distribution, ;; The test_pep518 tries to install
;; which is a meta-package that simply downloads and ;; dependencies from the network using pip.
;; installs ninja from the web ... "-k" "not test_pep518")))
(substitute* "pyproject.toml"
(("'ninja',")
""))))
(replace 'build
(lambda _
;; ZIP does not support timestamps before 1980.
(setenv "SOURCE_DATE_EPOCH" "315532800")
(invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
(replace 'install
(lambda _
(let ((whl (car (find-files "dist" "\\.whl$"))))
(invoke "pip" "--no-cache-dir" "--no-input"
"install" "--no-deps" "--prefix" #$output whl))))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "pytest" "-vv" "tests" "-k"
(string-append
"not "
;; These tests require a git checkout.
(string-join '("test_contents_unstaged"
"test_no_pep621"
"test_pep621"
"test_dynamic_version"
"test_contents"
"test_contents_subdirs")
" and not ")))))))))
(propagated-inputs (propagated-inputs
(list meson (list meson
ninja ninja
;; XXX: python-meson forcefully sets the RUNPATH of binaries
;; for vendoring purposes, and uses PatchELF for that(!). This
;; functionality is not useful in Guix, but removing this
;; dependency is tricky. There is discussion upstream about making
;; it optional, but for now we'll just carry it:
;; https://github.com/FFY00/meson-python/issues/125
patchelf
python-colorama python-colorama
python-pyproject-metadata python-pyproject-metadata
python-tomli python-tomli
@ -387,14 +354,16 @@ resembles Python.")
python-wheel python-wheel
;; For tests. ;; For tests.
git-minimal/pinned
patchelf
pkg-config pkg-config
python-cython
python-gitpython python-gitpython
python-pytest python-pytest
python-pytest-mock)) python-pytest-mock))
(home-page "https://github.com/FFY00/mesonpy") (home-page "https://github.com/mesonbuild/meson-python")
(synopsis "Meson-based build backend for Python") (synopsis "Meson-based build backend for Python")
(description (description "Meson-python is a PEP 517 build backend for Meson projects.")
"meson-python is a PEP 517 build backend for Meson projects.")
(license license:expat))) (license license:expat)))
(define-public premake4 (define-public premake4