diff options
| author | Maxim Cournoyer <maxim@guixotic.coop> | 2026-08-15 10:29:59 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2026-08-19 08:31:56 +0900 |
| commit | 6393e03a6e6a19593140f40bb2e51ddd7855d150 (patch) | |
| tree | 3ba0ad8910093295ed7dbe46089c2731c66951f3 /gnu/packages/rust-apps.scm | |
| parent | aeb265f1f9b2266aedf9b0ba0166cc0de2e0b577 (diff) | |
gnu: uv: Relocate to (gnu package build-tools).
* gnu/packages/rust-apps.scm (uv): Add deprecation for move to...
* gnu/packages/build-tools.scm (uv): ... here.
* gnu/packages/package-management.scm (hatch): Delete obsolete comment.
Diffstat (limited to 'gnu/packages/rust-apps.scm')
| -rw-r--r-- | gnu/packages/rust-apps.scm | 129 |
1 files changed, 3 insertions, 126 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 7d0872b97e1..7a188083f82 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm | |||
| @@ -4639,132 +4639,9 @@ window manager.") | |||
| 4639 | Full featured offline client with caching support.") | 4639 | Full featured offline client with caching support.") |
| 4640 | (license (list license:expat license:asl2.0)))) | 4640 | (license (list license:expat license:asl2.0)))) |
| 4641 | 4641 | ||
| 4642 | (define-public uv | 4642 | ;;; TODO: Remove when 2027/03 comes. |
| 4643 | ;; TODO: Move to (gnu packages package-management). | 4643 | (define-deprecated/public-alias uv |
| 4644 | (package | 4644 | (@ (gnu packages build-tools) uv)) |
| 4645 | (name "uv") | ||
| 4646 | (version "0.10.12") | ||
| 4647 | (source | ||
| 4648 | (origin | ||
| 4649 | (method git-fetch) | ||
| 4650 | (uri (git-reference | ||
| 4651 | (url "https://github.com/astral-sh/uv") | ||
| 4652 | (commit version))) | ||
| 4653 | (file-name (git-file-name name version)) | ||
| 4654 | (sha256 | ||
| 4655 | (base32 "04jk8d6wzxclx16mdg56afy2nqfv06j5kbxdch6977226gw80i0p")) | ||
| 4656 | (modules '((guix build utils))) | ||
| 4657 | (snippet | ||
| 4658 | #~(begin | ||
| 4659 | (for-each delete-file | ||
| 4660 | (cons "test/packages/fake-uv/scripts/uv.exe" | ||
| 4661 | (find-files "crates/uv-trampoline-builder/trampolines" | ||
| 4662 | "\\.exe$"))) | ||
| 4663 | ;; Our version of maturin doesn't parse this correctly | ||
| 4664 | (substitute* "pyproject.toml" | ||
| 4665 | (("license-files.*") "")))))) | ||
| 4666 | (build-system pyproject-build-system) | ||
| 4667 | (arguments | ||
| 4668 | (list | ||
| 4669 | #:imported-modules | ||
| 4670 | (append %cargo-build-system-modules | ||
| 4671 | %pyproject-build-system-modules) | ||
| 4672 | #:modules | ||
| 4673 | '((srfi srfi-26) | ||
| 4674 | (ice-9 match) | ||
| 4675 | ((guix build cargo-build-system) #:prefix cargo:) | ||
| 4676 | (guix build pyproject-build-system) | ||
| 4677 | (guix build utils)) | ||
| 4678 | #:tests? #f ; Tests require multiple python versions and network access. | ||
| 4679 | #:phases | ||
| 4680 | #~(modify-phases %standard-phases | ||
| 4681 | (add-after 'unpack 'prepare-cargo-build-system | ||
| 4682 | (lambda args | ||
| 4683 | (for-each | ||
| 4684 | (lambda (phase) | ||
| 4685 | (format #t "Running cargo phase: ~a~%" phase) | ||
| 4686 | (apply (assoc-ref cargo:%standard-phases phase) | ||
| 4687 | args)) | ||
| 4688 | '(prepare-rust-crates | ||
| 4689 | unpack-rust-crates | ||
| 4690 | configure | ||
| 4691 | check-for-pregenerated-files | ||
| 4692 | patch-cargo-checksums)))) | ||
| 4693 | (add-before 'build 'override-jemalloc | ||
| 4694 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 4695 | (let ((jemalloc (assoc-ref inputs "jemalloc"))) | ||
| 4696 | ;; This flag is needed when not using the bundled jemalloc. | ||
| 4697 | ;; https://github.com/tikv/jemallocator/issues/19 | ||
| 4698 | (setenv "CARGO_FEATURE_UNPREFIXED_MALLOC_ON_SUPPORTED_PLATFORMS" "1") | ||
| 4699 | (setenv "JEMALLOC_OVERRIDE" | ||
| 4700 | (string-append jemalloc "/lib/libjemalloc.so"))))) | ||
| 4701 | (replace 'install | ||
| 4702 | ;; We can't use the pyproject install phase because uv is a | ||
| 4703 | ;; binary, not a python script. | ||
| 4704 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 4705 | (let ((out (assoc-ref outputs "out")) | ||
| 4706 | (wheel (car (find-files "dist" "\\.whl$"))) | ||
| 4707 | (site-dir (site-packages inputs outputs)) | ||
| 4708 | (pyversion | ||
| 4709 | (string-append "python" | ||
| 4710 | (python-version | ||
| 4711 | (assoc-ref inputs "python"))))) | ||
| 4712 | (invoke "python" "-m" "zipfile" "-e" wheel site-dir) | ||
| 4713 | (mkdir-p (string-append out "/bin")) | ||
| 4714 | (for-each delete-file | ||
| 4715 | (find-files (string-append out "/lib/" pyversion) | ||
| 4716 | "^uvx?$")) | ||
| 4717 | (for-each (cut install-file <> (string-append out "/bin")) | ||
| 4718 | (find-files "target" "^uvx?$"))))) | ||
| 4719 | (replace 'check | ||
| 4720 | (lambda args | ||
| 4721 | (setenv "HOME" (getcwd)) | ||
| 4722 | ;; NOTE: ‘#:tests?’ is honored here. | ||
| 4723 | (apply (assoc-ref cargo:%standard-phases 'check) args))) | ||
| 4724 | (add-after 'install 'install-extras | ||
| 4725 | (lambda* (#:key native-inputs #:allow-other-keys) | ||
| 4726 | (let ((uv (if #$(%current-target-system) | ||
| 4727 | (search-input-file native-inputs "/bin/uv") | ||
| 4728 | (string-append #$output "/bin/uv"))) | ||
| 4729 | (uvx (if #$(%current-target-system) | ||
| 4730 | (search-input-file native-inputs "/bin/uvx") | ||
| 4731 | (string-append #$output "/bin/uvx")))) | ||
| 4732 | (for-each | ||
| 4733 | (match-lambda | ||
| 4734 | ((shell uv-name uvx-name completions-dir) | ||
| 4735 | (mkdir-p completions-dir) | ||
| 4736 | (with-output-to-file (in-vicinity completions-dir uv-name) | ||
| 4737 | (lambda _ | ||
| 4738 | (invoke uv "generate-shell-completion" shell))) | ||
| 4739 | (with-output-to-file (in-vicinity completions-dir uvx-name) | ||
| 4740 | (lambda _ | ||
| 4741 | (invoke uvx "--generate-shell-completion" shell))))) | ||
| 4742 | `(("bash" "uv" "uvx" | ||
| 4743 | ,(string-append #$output "/share/bash-completion/completions")) | ||
| 4744 | ("zsh" "_uv" "_uvx" | ||
| 4745 | ,(string-append #$output "/share/zsh/site-functions")) | ||
| 4746 | ("fish" "uv.fish" "uvx.fish" | ||
| 4747 | ,(string-append #$output "/share/fish/vendor_completions.d")) | ||
| 4748 | ("elvish" "uv" "uvx" | ||
| 4749 | ,(string-append #$output "/share/elvish/lib")) | ||
| 4750 | ("nushell" "uv" "uvx" | ||
| 4751 | ,(string-append #$output "/share/nushell/vendor/autoload")))))))))) | ||
| 4752 | (native-inputs | ||
| 4753 | (append | ||
| 4754 | (list (@ (gnu packages build-tools) maturin) | ||
| 4755 | pkg-config rust `(,rust "cargo")) | ||
| 4756 | (if (%current-target-system) | ||
| 4757 | (list this-package | ||
| 4758 | (make-rust-sysroot (%current-target-system))) | ||
| 4759 | '()))) | ||
| 4760 | (inputs (cons* jemalloc xz `(,zstd "lib") (cargo-inputs 'uv))) | ||
| 4761 | (home-page "https://docs.astral.sh/uv/") | ||
| 4762 | (synopsis "Python package and project manager written in Rust") | ||
| 4763 | (description | ||
| 4764 | "@command{uv} is a high-performance Python package and project manager | ||
| 4765 | written in Rust, known for its execution speed and compatibility with existing | ||
| 4766 | tools.") | ||
| 4767 | (license (list license:asl2.0 license:expat)))) ;dual-licensed | ||
| 4768 | 4645 | ||
| 4769 | (define-public git-absorb | 4646 | (define-public git-absorb |
| 4770 | (package | 4647 | (package |
