rosenthal: Update cargo-inputs implementation.

* modules/rosenthal/packages/rust-crates.scm: Update implementation.
Export interfaces ‘lookup-cargo-inputs’ and ‘rosenthal-cargo-inputs’.
* modules/rosenthal/packages/rust-apps.scm (atuin)[inputs]: Use
‘rosenthal-cargo-inputs’.
Remove rust-ring-0.17.
* modules/rosenthal/packages/wm.scm (rust-pipewire, rust-smithay): Hide and
export.
[arguments]<#:phases>: Update ‘package’ phase.
[inputs]: Use ‘rosenthal-cargo-inputs’.
(niri)[arguments]<#:phases>: Apply updates from rust-team.
[inputs]: Use ‘rosenthal-cargo-inputs’.
Remove rust-pipewire and rust-smithay.
* modules/rosenthal/packages/xorg.scm (xwayland-satellite)[inputs]: Use
‘rosenthal-cargo-inputs’.
This commit is contained in:
Hilton Chain 2025-05-04 19:54:43 +08:00
parent 9c782fad3c
commit 36eeac3b85
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
4 changed files with 2246 additions and 1984 deletions

View File

@ -8,7 +8,6 @@
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build-system cargo) #:use-module (guix build-system cargo)
#:use-module (gnu packages crates-crypto)
#:use-module (rosenthal packages rust-crates)) #:use-module (rosenthal packages rust-crates))
(define-public atuin (define-public atuin
@ -68,7 +67,7 @@
;; otherwise cargo will raise an error. ;; otherwise cargo will raise an error.
(invoke "cargo" "install" "--no-track" "--path" "crates/atuin" (invoke "cargo" "install" "--no-track" "--path" "crates/atuin"
"--root" out "--features" (string-join features)))))))) "--root" out "--features" (string-join features))))))))
(inputs (cons* rust-ring-0.17 atuin-cargo-inputs)) (inputs (rosenthal-cargo-inputs 'atuin))
(home-page "https://atuin.sh/") (home-page "https://atuin.sh/")
(synopsis "Sync, search and backup shell history") (synopsis "Sync, search and backup shell history")
(description (description

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
#:use-module (gnu packages xdisorg) #:use-module (gnu packages xdisorg)
#:use-module (rosenthal packages rust-crates)) #:use-module (rosenthal packages rust-crates))
(define rust-pipewire (define-public rust-pipewire
(let ((commit "fd3d8f7861a29c2eeaa4c393402e013578bb36d9") (let ((commit "fd3d8f7861a29c2eeaa4c393402e013578bb36d9")
(revision "0")) (revision "0"))
(package (package
@ -46,35 +46,30 @@
(substitute* "libspa/Cargo.toml" (substitute* "libspa/Cargo.toml"
(("^pipewire.*") "")))) (("^pipewire.*") ""))))
(replace 'package (replace 'package
(lambda _ (lambda* (#:key cargo-package-flags vendor-dir #:allow-other-keys)
(begin (begin
;;error: invalid inclusion of reserved file name Cargo.toml.orig in package source ;;error: invalid inclusion of reserved file name Cargo.toml.orig in package source
(when (file-exists? "Cargo.toml.orig") (when (file-exists? "Cargo.toml.orig")
(delete-file "Cargo.toml.orig")) (delete-file "Cargo.toml.orig"))
;; Use unstable feature --registry.
(setenv "RUSTC_BOOTSTRAP" "1")
(for-each (for-each
(lambda (pkg) (lambda (pkg)
(invoke "cargo" "package" "--offline" "--package" pkg (apply invoke "cargo" "package" "--offline" "--package" pkg
"--registry" "crates-io" "-Z" "package-workspace" cargo-package-flags)
"--no-metadata" "--no-verify")
(for-each (for-each
(lambda (crate) (lambda (crate)
(invoke "tar" "xzf" crate "-C" "guix-vendor")) (invoke "tar" "xzf" crate "-C" vendor-dir))
(begin (find-files "target/package" "\\.crate$"))
(delete-file-recursively "target/package/tmp-registry")
(find-files "target/package" "\\.crate$")))
((assoc-ref %standard-phases 'patch-cargo-checksums))) ((assoc-ref %standard-phases 'patch-cargo-checksums)))
'("libspa-sys" "libspa" "pipewire-sys" "pipewire")) '("libspa-sys" "libspa" "pipewire-sys" "pipewire"))))))))
(unsetenv "RUSTC_BOOTSTRAP"))))))) (inputs (rosenthal-cargo-inputs 'rust-pipewire))
(inputs rust-pipewire-cargo-inputs)
(home-page "https://pipewire.org/") (home-page "https://pipewire.org/")
(synopsis "Rust bindings for PipeWire") (synopsis "Rust bindings for PipeWire")
(description "This package provides Rust bindings for PipeWire.") (description "This package provides Rust bindings for PipeWire.")
(license license:expat)))) (license license:expat)
(properties '((hidden? . #t))))))
(define rust-smithay (define-public rust-smithay
(let ((commit "0cd3345c59f7cb139521f267956a1a4e33248393") (let ((commit "0cd3345c59f7cb139521f267956a1a4e33248393")
(revision "0")) (revision "0"))
(package (package
@ -95,29 +90,23 @@
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'package (replace 'package
(lambda _ (lambda* (#:key cargo-package-flags vendor-dir #:allow-other-keys)
(begin (begin
;;error: invalid inclusion of reserved file name Cargo.toml.orig in package source ;;error: invalid inclusion of reserved file name Cargo.toml.orig in package source
(when (file-exists? "Cargo.toml.orig") (when (file-exists? "Cargo.toml.orig")
(delete-file "Cargo.toml.orig")) (delete-file "Cargo.toml.orig"))
;; Use unstable feature --registry.
(setenv "RUSTC_BOOTSTRAP" "1")
(for-each (for-each
(lambda (pkg) (lambda (pkg)
(invoke "cargo" "package" "--offline" "--package" pkg (apply invoke "cargo" "package" "--offline" "--package" pkg
"--registry" "crates-io" "-Z" "package-workspace" cargo-package-flags)
"--no-metadata" "--no-verify")
(for-each (for-each
(lambda (crate) (lambda (crate)
(invoke "tar" "xzf" crate "-C" "guix-vendor")) (invoke "tar" "xzf" crate "-C" vendor-dir))
(begin (find-files "target/package" "\\.crate$"))
(delete-file-recursively "target/package/tmp-registry")
(find-files "target/package" "\\.crate$")))
((assoc-ref %standard-phases 'patch-cargo-checksums))) ((assoc-ref %standard-phases 'patch-cargo-checksums)))
'("smithay" "smithay-drm-extras")) '("smithay" "smithay-drm-extras"))))))))
(unsetenv "RUSTC_BOOTSTRAP"))))))) (inputs (rosenthal-cargo-inputs 'rust-smithay))
(inputs rust-smithay-cargo-inputs)
(home-page "https://github.com/Smithay/smithay") (home-page "https://github.com/Smithay/smithay")
(synopsis "Smithy for Rust Wayland compositors") (synopsis "Smithy for Rust Wayland compositors")
(description (description
@ -128,7 +117,8 @@ will need, in a generic fashion.
It supports the @code{wayland}, @code{wayland-protocols}, and some external It supports the @code{wayland}, @code{wayland-protocols}, and some external
extensions, such as @code{wlr-protocols} and @code{plasma-wayland-protocols}.") extensions, such as @code{wlr-protocols} and @code{plasma-wayland-protocols}.")
(license license:expat)))) (license license:expat)
(properties '((hidden? . #t))))))
(define-public niri (define-public niri
(package (package
@ -151,22 +141,22 @@ extensions, such as @code{wlr-protocols} and @code{plasma-wayland-protocols}.")
(add-after 'unpack 'use-guix-vendored-dependencies (add-after 'unpack 'use-guix-vendored-dependencies
(lambda _ (lambda _
(substitute* "Cargo.toml" (substitute* "Cargo.toml"
(("# version = \"0.4.1\"") (("# version =.*")
"version = \"0.4.0\"") "version = \"*\"")
(("# version = \"0.1.0\"")
"version = \"0.1.0\"")
(("git.*optional") (("git.*optional")
"version = \"0.8.0\", optional") "version = \"*\", optional")
(("^git = .*") (("^git = .*")
"")))) ""))))
(add-after 'configure 'set-rust-flags (add-after 'unpack 'set-environment
(lambda _
(setenv "RUSTFLAGS" (string-join
'("-C" "link-arg=-lEGL"
"-C" "link-arg=-lwayland-client")
" "))))
(add-before 'check 'prepare-test-environment
(lambda _ (lambda _
(setenv "RUSTFLAGS"
(string-join
'("-C" "link-arg=-lEGL"
"-C" "link-arg=-lwayland-client")
" "))
(setenv "NIRI_BUILD_VERSION_STRING"
#$(package-version this-package))
;; For tests.
(setenv "XDG_RUNTIME_DIR" "/tmp"))) (setenv "XDG_RUNTIME_DIR" "/tmp")))
(add-after 'install 'install-extras (add-after 'install 'install-extras
(lambda _ (lambda _
@ -190,10 +180,8 @@ extensions, such as @code{wlr-protocols} and @code{plasma-wayland-protocols}.")
mesa mesa
pango pango
pipewire pipewire
rust-pipewire
rust-smithay
wayland wayland
niri-cargo-inputs)) (rosenthal-cargo-inputs 'niri)))
(home-page "https://github.com/YaLTeR/niri") (home-page "https://github.com/YaLTeR/niri")
(synopsis "Scrollable-tiling Wayland compositor") (synopsis "Scrollable-tiling Wayland compositor")
(description (description

View File

@ -43,7 +43,7 @@
(cons* clang (cons* clang
xcb-util-cursor xcb-util-cursor
xorg-server-xwayland xorg-server-xwayland
xwayland-satellite-cargo-inputs)) (rosenthal-cargo-inputs 'xwayland-satellite)))
(home-page "https://github.com/Supreeeme/xwayland-satellite") (home-page "https://github.com/Supreeeme/xwayland-satellite")
(synopsis "Xwayland outside your Wayland") (synopsis "Xwayland outside your Wayland")
(description (description