summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2025-09-13 16:53:28 +0200
committerAndreas Enge <andreas@enge.fr>2025-10-17 12:04:45 +0200
commitf0e355cb23c00399a3f3ef7462b043f0a90067c0 (patch)
treea6d7951d237fefef30f8bccd0599eb2ebda0a54c
parentafb626e98d62d975096afe3b10a2c93ca30035da (diff)
gnu: maturin: Improve style.
* gnu/packages/rust-apps.scm (maturin)[arguments]: Improve style. <#:phases>: Use G-expressions. Change-Id: Icf2fd08db952c5dbd71a2c8cbb8b153d21aff61c Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
-rw-r--r--gnu/packages/rust-apps.scm104
1 files changed, 52 insertions, 52 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 6c12b7caed..c215b90fc9 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -1815,15 +1815,17 @@ specified image or color, easing the process of theme creation.")
(patches (search-patches "maturin-no-cross-compile.patch"))))
(build-system cargo-build-system)
(arguments
- `(#:modules ((guix build cargo-build-system)
+ (list
+ #:modules '((guix build cargo-build-system)
((guix build pyproject-build-system) #:prefix py:)
(guix build utils))
- #:imported-modules ((guix build cargo-build-system)
+ #:imported-modules `((guix build cargo-build-system)
(guix build cargo-utils)
+ (guix build json)
,@%pyproject-build-system-modules)
- #:install-source? #f
- #:cargo-test-flags
- '("--"
+ #:install-source? #f
+ #:cargo-test-flags
+ ''("--"
;; Not all files are included.
"--skip=build_options::test::test_find_bridge_bin"
"--skip=build_options::test::test_find_bridge_cffi"
@@ -1835,56 +1837,54 @@ specified image or color, easing the process of theme creation.")
"--skip=metadata::test::test_merge_metadata_from_pyproject_toml"
"--skip=metadata::test::test_merge_metadata_from_pyproject_toml_with_customized_python_source_dir"
"--skip=pyproject_toml::tests::test_warn_missing_maturin_version")
- #:phases
- (modify-phases %standard-phases
- (add-after 'build 'build-python-module
- (lambda _
- ;; Match the features from the cargo-build-system and Cargo.toml.
- (setenv "MATURIN_SETUP_ARGS" "--features=default")
- ((assoc-ref py:%standard-phases 'build))))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'build 'build-python-module
+ (lambda _
+ ;; Match the features from the cargo-build-system and Cargo.toml.
+ (setenv "MATURIN_SETUP_ARGS" "--features=default")
+ ((assoc-ref py:%standard-phases 'build))))
- ;; We can't use the pyproject install phase because maturin is a
- ;; binary, not a python script.
- (add-after 'install 'install-python-module
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (wheel (car (find-files "dist" "\\.whl$")))
- (site-dir (py:site-packages inputs outputs))
- (pyversion
+ ;; We can't use the pyproject install phase because maturin is a
+ ;; binary, not a python script.
+ (add-after 'install 'install-python-module
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((wheel (car (find-files "dist" "\\.whl$")))
+ (site-dir (py:site-packages inputs outputs))
+ (pyversion
(string-append "python"
(py:python-version
- (assoc-ref inputs "python-wrapper")))))
- (invoke "python" "-m" "zipfile" "-e" wheel site-dir)
- (mkdir-p (string-append out "/bin"))
- (for-each delete-file
- (find-files (string-append out "/lib/" pyversion)
- "^maturin$")))))
- (add-after 'install 'install-completions
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (share (string-append out "/share"))
- (maturin (string-append out "/bin/maturin")))
- ;; TODO? fig, powershell
- (mkdir-p (string-append out "/etc/bash_completion.d"))
- (with-output-to-file
- (string-append out "/etc/bash_completion.d/maturin")
- (lambda _ (invoke maturin "completions" "bash")))
- (mkdir-p (string-append share "/fish/vendor_completions.d"))
- (with-output-to-file
- (string-append share "/fish/vendor_completions.d/maturin.fish")
- (lambda _ (invoke maturin "completions" "fish")))
- (mkdir-p (string-append share "/zsh/site-functions"))
- (with-output-to-file
- (string-append share "/zsh/site-functions/_maturin")
- (lambda _ (invoke maturin "completions" "zsh")))
- (mkdir-p (string-append share "/elvish/lib"))
- (with-output-to-file
- (string-append share "/elvish/lib/maturin")
- (lambda _ (invoke maturin "completions" "elvish")))
- (mkdir-p (string-append share "/nushell/vendor/autoload"))
- (with-output-to-file
- (string-append share "/nushell/vendor/autoload/maturin")
- (lambda _ (invoke maturin "completions" "nushell")))))))))
+ (assoc-ref inputs "python-wrapper")))))
+ (invoke "python" "-m" "zipfile" "-e" wheel site-dir)
+ (mkdir-p (string-append #$output "/bin"))
+ (for-each delete-file
+ (find-files (string-append #$output "/lib/" pyversion)
+ "^maturin$")))))
+ (add-after 'install 'install-completions
+ (lambda _
+ (let ((share (string-append #$output "/share"))
+ (maturin (string-append #$output "/bin/maturin")))
+ ;; TODO? fig, powershell
+ (mkdir-p (string-append #$output "/etc/bash_completion.d"))
+ (with-output-to-file
+ (string-append #$output "/etc/bash_completion.d/maturin")
+ (lambda _ (invoke maturin "completions" "bash")))
+ (mkdir-p (string-append share "/fish/vendor_completions.d"))
+ (with-output-to-file
+ (string-append share "/fish/vendor_completions.d/maturin.fish")
+ (lambda _ (invoke maturin "completions" "fish")))
+ (mkdir-p (string-append share "/zsh/site-functions"))
+ (with-output-to-file
+ (string-append share "/zsh/site-functions/_maturin")
+ (lambda _ (invoke maturin "completions" "zsh")))
+ (mkdir-p (string-append share "/elvish/lib"))
+ (with-output-to-file
+ (string-append share "/elvish/lib/maturin")
+ (lambda _ (invoke maturin "completions" "elvish")))
+ (mkdir-p (string-append share "/nushell/vendor/autoload"))
+ (with-output-to-file
+ (string-append share "/nushell/vendor/autoload/maturin")
+ (lambda _ (invoke maturin "completions" "nushell")))))))))
(propagated-inputs
(list python-tomli))
(inputs (cons bzip2 (cargo-inputs 'maturin)))