guix_mirror_bot pushed a commit to branch python-team
in repository guix.
commit f76317719a8dfcc2f9a0d4fdd29d6d6566139df3
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Tue Sep 16 10:10:33 2025 +0100
gnu: python-blake3: Fix build.
* gnu/packages/python-crypto.scm (python-blake3)[arguments]
<imported-modules>: Add pyproject-build-system-modules
<modules>: Likewise.
<phases>: Simplify 'build-python-module, and 'install-python-module.
Remove 'install-python-library.
[native-inputs]: Remove python-pypa-build and python-wheel; add maturin.
Change-Id: Ib45da9873b40697ba2166bb31f11da16f4872223
---
gnu/packages/python-crypto.scm | 58 ++++++++----------------------------------
1 file changed, 10 insertions(+), 48 deletions(-)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 963c536649..5f194a734e 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -340,59 +340,21 @@ production use. Include this module and use its backends
at your own risk.")
(arguments
(list
#:install-source? #f
+ #:imported-modules `(,@%pyproject-build-system-modules
+ ,@%cargo-build-system-modules)
+ #:modules `((guix build cargo-build-system)
+ ((guix build pyproject-build-system) #:prefix py:)
+ (guix build utils))
#:phases
#~(modify-phases %standard-phases
- (add-after 'install 'build-python-module
- (lambda _
- ;; We don't use maturin.
- (delete-file "pyproject.toml")
- (call-with-output-file "pyproject.toml"
- (lambda (port)
- (format port "\
-[build-system]
-build-backend = 'setuptools.build_meta'
-requires = ['setuptools']
-")))
- (call-with-output-file "setup.cfg"
- (lambda (port)
- (format port "\
-
-[metadata]
-name = blake3
-version = ~a
-
-[options]
-packages = find:
-
-[options.packages.find]
-exclude =
- src*
- c_impl*
- tests*
- Cargo.toml
-" #$version)))
- ;; ZIP does not support timestamps before 1980.
- (setenv "SOURCE_DATE_EPOCH" "315532800")
- (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
+ (add-after 'build 'build-python-module
+ (assoc-ref py:%standard-phases 'build))
(add-after 'build-python-module 'install-python-module
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((whl (car (find-files "dist" "\\.whl$"))))
- (invoke "pip" "--no-cache-dir" "--no-input"
- "install" "--no-deps" "--prefix" #$output whl))))
- (add-after 'install-python-module 'install-python-library
- (lambda _
- (let ((site (string-append #$output "/lib/python"
- #$(version-major+minor
- (package-version python))
- "/site-packages")))
- (mkdir-p site)
- (copy-file "target/release/libblake3.so"
- (string-append site "/blake3.so"))))))))
- (inputs (cargo-inputs 'python-blake3))
+ (assoc-ref py:%standard-phases 'install)))))
(native-inputs
(list python-wrapper
- python-pypa-build
- python-wheel))
+ maturin))
+ (inputs (cargo-inputs 'python-blake3))
(home-page "https://github.com/oconnor663/blake3-py")
(synopsis "Python bindings for the Rust blake3 crate")
(description "This package provides Python bindings for the Rust crate of