diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2026-05-11 13:10:49 +0300 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2026-05-11 13:13:59 +0300 |
| commit | 25632f941219ea1fad75145aa335a6c7280989c3 (patch) | |
| tree | ffe56b52f6b3aad2afe4bdd8d30a34a9ccb7de91 | |
| parent | 97731feda5663ea957254e0c7ced1ad47a8142cd (diff) | |
gnu: py-spy: Adjust custom phase.
* gnu/packages/rust-apps.scm (py-spy)[arguments]: Rewrite the phase to
install the shell completions.
Change-Id: I3cd2bc1a68a351e621282ed7a5d13358886ad313
| -rw-r--r-- | gnu/packages/rust-apps.scm | 51 |
1 files changed, 20 insertions, 31 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 44e709e00a..460b1c5d24 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -2738,43 +2738,32 @@ choice. Supported launchers are: dmenu, fuzzel, rofi, walker and custom.") (arguments (list #:install-source? #f + #:modules + '((guix build cargo-build-system) + (guix build utils) + (ice-9 match)) #:cargo-test-flags ;; python-numpy isn't in the build environment ''("--" "--skip=test_local_vars") #:phases #~(modify-phases %standard-phases (add-after 'install 'install-shell-completions - (lambda* (#:key native-inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (share (string-append out "/share")) - (bash-completions-dir - (string-append out "/share/bash-completion/completions")) - (zsh-completions-dir - (string-append share "/zsh/site-functions")) - (fish-completions-dir - (string-append share "/fish/vendor_completions.d")) - (elvish-completions-dir - (string-append share "/elvish/lib")) - (py-spy (if #$(%current-target-system) - (search-input-file native-inputs "/bin/py-spy") - (string-append out "/bin/py-spy")))) - (for-each mkdir-p - (list bash-completions-dir - zsh-completions-dir - fish-completions-dir - elvish-completions-dir)) - (with-output-to-file - (string-append bash-completions-dir "/py-spy") - (lambda _ (invoke py-spy "completions" "bash"))) - (with-output-to-file - (string-append zsh-completions-dir "/_py-spy") - (lambda _ (invoke py-spy "completions" "zsh"))) - (with-output-to-file - (string-append fish-completions-dir "/py-spy.fish") - (lambda _ (invoke py-spy "completions" "fish"))) - (with-output-to-file - (string-append elvish-completions-dir "/py-spy") - (lambda _ (invoke py-spy "completions" "elvish"))))))))) + (lambda* (#:key native-inputs #:allow-other-keys) + (for-each + (match-lambda + ((shell . path) + (mkdir-p (in-vicinity #$output (dirname path))) + (let ((binary + (if #$(%current-target-system) + (search-input-file native-inputs "bin/py-spy") + (in-vicinity #$output "bin/py-spy")))) + (with-output-to-file (in-vicinity #$output path) + (lambda _ + (invoke binary "completions" shell)))))) + '(("bash" . "share/bash-completion/completions/py-spy") + ("elvish" . "share/elvish/lib/py-spy") + ("fish" . "share/fish/vendor_completions.d/py-spy.fish") + ("zsh" . "share/zsh/site-functions/_py-spy")))))))) (native-inputs (append (if (%current-target-system) |
