guix_mirror_bot pushed a commit to branch next-master
in repository guix.
commit 1f904428c4eacfeda17654c8ceda09af08ebd196
Author: Nicolas Graves <[email protected]>
AuthorDate: Tue Jan 6 12:18:51 2026 +0100
gnu: z3: Switch to pyproject.
* gnu/packages/maths.scm (z3):
[arguments]<#:imported-modules, #:modules, #:phases>: Switch to
pyproject-build-system.
<#:phases>: Replace phase 'compile-python-modules by the one in
pyproject-build-system.
Change-Id: Ie74daad5cd152bd80447219a9c82fa7d0827ac9b
Signed-off-by: Sharlatan Hellseher <[email protected]>
---
gnu/packages/maths.scm | 52 +++++++++++++++++++++++---------------------------
1 file changed, 24 insertions(+), 28 deletions(-)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 68a7dd3784..35042017bd 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8755,11 +8755,11 @@ arrays, uninterpreted functions and their
combinations.")
(build-system cmake-build-system)
(arguments
(list
- #:imported-modules `((guix build python-build-system)
- ,@%cmake-build-system-modules)
+ #:imported-modules (append %cmake-build-system-modules
+ %pyproject-build-system-modules)
#:modules '((guix build cmake-build-system)
(guix build utils)
- ((guix build python-build-system) #:select (site-packages)))
+ ((guix build pyproject-build-system) #:prefix py:))
#:configure-flags
#~(list "-DZ3_BUILD_PYTHON_BINDINGS=ON"
"-DZ3_LINK_TIME_OPTIMIZATION=ON"
@@ -8769,31 +8769,27 @@ arrays, uninterpreted functions and their
combinations.")
#$(version-major+minor (package-version python-wrapper))
"/site-packages"))
#:phases
- #~(modify-phases %standard-phases
- (replace 'check
- (lambda* (#:key parallel-build? tests? #:allow-other-keys)
- (when tests?
- (invoke "make" "test-z3"
- (format #f "-j~a"
- (if parallel-build?
- (parallel-job-count)
- 1)))
- (invoke "./test-z3" "/a"))))
- (add-after 'install 'compile-python-modules
- (lambda _
- (setenv "PYTHONHASHSEED" "0")
-
- (invoke "python" "-m" "compileall"
- "--invalidation-mode=unchecked-hash"
- #$output)))
- ;; This step is missing in the CMake build system, do it here.
- (add-after 'compile-python-modules 'fix-z3-library-path
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let* ((dest (string-append (site-packages inputs outputs)
- "/z3/lib/libz3.so"))
- (z3-lib (string-append #$output "/lib/libz3.so")))
- (mkdir-p (dirname dest))
- (symlink z3-lib dest)))))))
+ (with-extensions (list (pyproject-guile-json))
+ #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key parallel-build? tests? #:allow-other-keys)
+ (when tests?
+ (invoke "make" "test-z3"
+ (format #f "-j~a"
+ (if parallel-build?
+ (parallel-job-count)
+ 1)))
+ (invoke "./test-z3" "/a"))))
+ (add-after 'install 'compile-python-modules
+ (assoc-ref py:%standard-phases 'compile-bytecode))
+ ;; This step is missing in the CMake build system, do it here.
+ (add-after 'compile-python-modules 'fix-z3-library-path
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((dest (string-append (py:site-packages inputs outputs)
+ "/z3/lib/libz3.so"))
+ (z3-lib (string-append #$output "/lib/libz3.so")))
+ (mkdir-p (dirname dest))
+ (symlink z3-lib dest))))))))
(native-inputs
(list which python-wrapper))
(synopsis "Theorem prover")