GNU bug report logs -
#75283
[PATCH rust-team] gnu: rust-xremap: Use output for each feature.
Previous Next
To reply to this bug, email your comments to 75283 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
efraim <at> flashner.co.il, guix-patches <at> gnu.org
:
bug#75283
; Package
guix-patches
.
(Thu, 02 Jan 2025 13:08:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Herman Rimm <herman <at> rimm.ee>
:
New bug report received and forwarded. Copy sent to
efraim <at> flashner.co.il, guix-patches <at> gnu.org
.
(Thu, 02 Jan 2025 13:08:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/rust-apps.scm (output-features): Add procedure.
(rust-xremap)[outputs]: Add.
[arguments]: Remove features, add modules and output-features phases.
(xremap-gnome, xremap-kde, xremap-wlroots, xremap-hyprland, xremap-sway,
xremap-x11): Deprecate.
Change-Id: I9cf6a27f908a0fa42e89daba12fba3615d05ad4e
---
gnu/packages/rust-apps.scm | 79 +++++++++++++++++++++-----------------
1 file changed, 44 insertions(+), 35 deletions(-)
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 2182daa2f30..074c1f56408 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -28,7 +28,7 @@
;;; Copyright © 2023, 2024 Jaeme Sifat <jaeme <at> runbox.com>
;;; Copyright © 2023 Steve George <steve <at> futurile.net>
;;; Copyright © 2024 Troy Figiel <troy <at> troyfigiel.com>
-;;; Copyright © 2024 Herman Rimm <herman <at> rimm.ee>
+;;; Copyright © 2024-2025 Herman Rimm <herman <at> rimm.ee>
;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
;;; Copyright © 2024 Suhail Singh <suhail <at> bayesians.ca>
;;; Copyright © 2024 Jordan Moore <lockbox <at> struct.foo>
@@ -113,7 +113,8 @@ (define-module (gnu packages rust-apps)
#:use-module (gnu packages tls)
#:use-module (gnu packages version-control)
#:use-module (gnu packages webkit)
- #:use-module (gnu packages xorg))
+ #:use-module (gnu packages xorg)
+ #:use-module (srfi srfi-1))
(define-public aardvark-dns
(package
@@ -4244,6 +4245,34 @@ (define-public git-delta
@command{grep} and a stylized box presentation.")
(license license:expat)))
+(define* (output-features output #:optional (features (list output)))
+ (define (phase-name prefix)
+ (string->symbol (string-append prefix "-" output)))
+
+ (define set-args
+ `(let loop ((lst args)
+ (result '()))
+ (match lst
+ (() (reverse result))
+ ((#:outputs outputs rest ...)
+ ;; XXX: Make give output the default.
+ (loop rest (cons* `(("out" . ,(assoc-ref outputs ,output)))
+ #:outputs result)))
+ ((#:features _ rest ...)
+ (loop rest (cons* ',features #:features result)))
+ ((kw value rest ...)
+ (loop rest (cons* value kw result))))))
+ ;; XXX: Run after previous install-output phase.
+ `((add-after 'install ',(phase-name "build")
+ (lambda args
+ (apply (assoc-ref %standard-phases 'build) ,set-args)))
+ (add-after ',(phase-name "build") ',(phase-name "check")
+ (lambda args
+ (apply (assoc-ref %standard-phases 'check) ,set-args)))
+ (add-after ',(phase-name "check") ',(phase-name "install")
+ (lambda args
+ (apply (assoc-ref %standard-phases 'install) ,set-args)))))
+
(define-public rust-xremap
(package
(name "rust-xremap")
@@ -4257,9 +4286,9 @@ (define-public rust-xremap
(base32
"0whvw9bbgjf5znb3025iqkj2aijasg6fcx9q1jy97kb0s4m996q2"))))
(build-system cargo-build-system)
+ (outputs '("out" "hyprland" "gnome" "kde" "wlroots" "x11"))
(arguments
- `(#:features '()
- #:install-source? #f
+ `(#:install-source? #f
#:cargo-inputs
(("rust-anyhow" ,rust-anyhow-1)
("rust-clap" ,rust-clap-4)
@@ -4283,8 +4312,13 @@ (define-public rust-xremap
("rust-wayland-protocols-wlr" ,rust-wayland-protocols-wlr-0.1)
("rust-x11rb" ,rust-x11rb-0.13)
("rust-zbus" ,rust-zbus-1))
+ #:modules ((guix build cargo-build-system)
+ (guix build utils)
+ (ice-9 match))
#:phases
(modify-phases %standard-phases
+ ,@(concatenate (map output-features (drop outputs 1)))
+ ;; XXX: Separately output default xremap and completions?
(add-after 'install 'install-completions
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -4312,47 +4346,22 @@ (define-public rust-xremap
(license license:expat)))
(define-public xremap-gnome
- (package
- (inherit rust-xremap)
- (name "xremap-gnome")
- (arguments
- (substitute-keyword-arguments (package-arguments rust-xremap)
- ((#:features _) '(list "gnome"))))))
+ (deprecated-package "xremap-gnome" rust-xremap))
(define-public xremap-kde
- (package
- (inherit rust-xremap)
- (name "xremap-kde")
- (arguments
- (substitute-keyword-arguments (package-arguments rust-xremap)
- ((#:features _) '(list "kde"))))))
+ (deprecated-package "xremap-kde" rust-xremap))
(define-public xremap-wlroots
- (package
- (inherit rust-xremap)
- (name "xremap-wlroots")
- (arguments
- (substitute-keyword-arguments (package-arguments rust-xremap)
- ((#:features _) '(list "wlroots"))))))
+ (deprecated-package "xremap-wlroots" rust-xremap))
(define-public xremap-hyprland
- (package
- (inherit rust-xremap)
- (name "xremap-hyprland")
- (arguments
- (substitute-keyword-arguments (package-arguments rust-xremap)
- ((#:features _) '(list "hyprland"))))))
+ (deprecated-package "xremap-hyprland" rust-xremap))
(define-public xremap-sway
- (deprecated-package "xremap-sway" xremap-wlroots))
+ (deprecated-package "xremap-sway" rust-xremap))
(define-public xremap-x11
- (package
- (inherit rust-xremap)
- (name "xremap-x11")
- (arguments
- (substitute-keyword-arguments (package-arguments rust-xremap)
- ((#:features _) '(list "x11"))))))
+ (deprecated-package "xremap-x11" rust-xremap))
(define-public xsv
(package
base-commit: 5f92f009a19c1a5a8b7df5a7bcb1e1f283a953f8
--
2.45.2
Information forwarded
to
guix-patches <at> gnu.org
:
bug#75283
; Package
guix-patches
.
(Sun, 05 Jan 2025 08:58:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 75283 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Do we actually need a separate output/package for each desktop type? Or
can we just add in all the features and provide just one package for all
of them?
I compared the outputs of xremap-wlroots and xremap-gnome and the shell
completions are the same between them.
On Thu, Jan 02, 2025 at 02:06:09PM +0100, Herman Rimm wrote:
> * gnu/packages/rust-apps.scm (output-features): Add procedure.
> (rust-xremap)[outputs]: Add.
> [arguments]: Remove features, add modules and output-features phases.
> (xremap-gnome, xremap-kde, xremap-wlroots, xremap-hyprland, xremap-sway,
> xremap-x11): Deprecate.
>
> Change-Id: I9cf6a27f908a0fa42e89daba12fba3615d05ad4e
> ---
> gnu/packages/rust-apps.scm | 79 +++++++++++++++++++++-----------------
> 1 file changed, 44 insertions(+), 35 deletions(-)
>
--
Efraim Flashner <efraim <at> flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#75283
; Package
guix-patches
.
(Mon, 06 Jan 2025 19:44:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 75283 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Sun, Jan 05, 2025 at 10:56:46AM +0200, Efraim Flashner wrote:
> Do we actually need a separate output/package for each desktop type? Or
> can we just add in all the features and provide just one package for all
> of them?
In .../xremap/src/client/mod.rs, each feature (e.g. wlroots) is used
like:
#[cfg(feature = "wlroots")]
pub fn build_client() -> WMClient { ... }
Enabling multiple features would define multiple build_client in the
module, which would not compile I think.
Cheers,
Herman
This bug report was last modified 159 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.