From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Replacing polkit by polkit-duktape on core-updates-frozen ?
Date: Mon, 22 Nov 2021 15:41:43 -0500 [thread overview]
Message-ID: <871r37c48o.fsf@gmail.com> (raw)
In-Reply-To: <87a6hwnwqn.fsf@gnu.org> ("Ludovic Courtès"'s message of "Mon, 22 Nov 2021 14:30:40 +0100")
Hello again,
I've now tried this:
--8<---------------cut here---------------start------------->8---
gnu: polkit: Define polkit package variable based on architecture.
* gnu/packages/polkit.scm (polkit): Rename to...
(polkit*): ... this.
(polkit-duktape): Adjust to inherit from polkit*.
(polkit-for-system): New procedure.
(polkit): New variable.
1 file changed, 44 insertions(+), 27 deletions(-)
gnu/packages/polkit.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++---------------------------
modified gnu/packages/polkit.scm
@@ -48,7 +48,7 @@ (define-module (gnu packages polkit)
#:use-module (gnu packages qt)
#:use-module (gnu packages xml))
-(define-public polkit
+(define-public polkit*
(package
(name "polkit")
(version "0.120")
@@ -151,32 +151,49 @@ (define-public polkit
;;; Variant of polkit built with Duktape, a lighter JavaScript engine compared
;;; to mozjs.
(define-public polkit-duktape
- (package/inherit polkit
- (name "polkit-duktape")
- (source
- (origin
- (inherit (package-source polkit))
- (patches
- (append
- (search-patches "polkit-use-duktape.patch")
- (origin-patches (package-source polkit))))))
- (arguments
- (substitute-keyword-arguments (package-arguments polkit)
- ((#:configure-flags flags)
- `(cons "--with-duktape" ,flags))
- ((#:phases phases)
- `(modify-phases ,phases
- (add-after 'unpack 'force-gnu-build-system-bootstrap
- (lambda _
- (delete-file "configure")))))))
- (native-inputs
- (append `(("autoconf" ,autoconf)
- ("automake" ,automake)
- ("libtool" ,libtool)
- ("pkg-config" ,pkg-config))
- (package-native-inputs polkit)))
- (inputs (alist-replace "mozjs" `(,duktape)
- (package-inputs polkit)))))
+ (let ((base polkit*))
+ (package/inherit base
+ (name "polkit-duktape")
+ (source
+ (origin
+ (inherit (package-source base))
+ (patches
+ (append
+ (search-patches "polkit-use-duktape.patch")
+ (origin-patches (package-source base))))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments base)
+ ((#:configure-flags flags)
+ `(cons "--with-duktape" ,flags))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'unpack 'force-gnu-build-system-bootstrap
+ (lambda _
+ (delete-file "configure")))))))
+ (native-inputs
+ (append `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)
+ ("pkg-config" ,pkg-config))
+ (package-native-inputs base)))
+ (inputs (alist-replace "mozjs" `(,duktape)
+ (package-inputs base))))))
+
+
+(define (polkit-for-system system)
+ "Return a polkit package that can be built for SYSTEM; that is, either the
+regular polkit that requires mozjs or its duktape variant."
+ (if (string-prefix? "x86_64" system)
+ polkit*
+ polkit-duktape))
+
+;;; Define a top level polkit variable that can be built on any of the
+;;; supported platforms. This is to work around the fact that our
+;;; mrustc-bootstrapped rust toolchain currently only supports the x86_64
+;;; architecture.
+(define-syntax polkit
+ (identifier-syntax (polkit-for-system
+ (or (%current-system) (%current-target-system)))))
(define-public polkit-qt
(package
--8<---------------cut here---------------end--------------->8---
But my "test" fails the same:
--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build --system=aarch64-linux \
-e '(@ (gnu packages polkit) polkit)' -n |& grep polkit
/gnu/store/dw11y85xfsb8hcg7w2cw57f1xfs4i74m-polkit-0.120.drv
/gnu/store/ric7yf4ra2p14p29fwsh18m1nakciakv-polkit-0.120.tar.xz
--8<---------------cut here---------------end--------------->8---
I'd have expected to see 'polkit-duktape' as the name of the package in
the output.
Thanks,
Maxim
next prev parent reply other threads:[~2021-11-22 20:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 18:23 Replacing polkit by polkit-duktape on core-updates-frozen ? Maxim Cournoyer
2021-11-11 23:30 ` Thiago Jung Bauermann
2021-11-17 11:08 ` Ludovic Courtès
2021-11-22 3:35 ` Maxim Cournoyer
2021-11-22 13:30 ` Ludovic Courtès
2021-11-22 20:26 ` Maxim Cournoyer
2021-11-22 20:41 ` Maxim Cournoyer [this message]
2021-11-23 17:18 ` Ludovic Courtès
2021-11-23 20:34 ` Thiago Jung Bauermann
2021-11-24 4:11 ` Maxim Cournoyer
2021-11-24 4:02 ` Maxim Cournoyer
2021-11-24 8:42 ` Josselin Poiret via Development of GNU Guix and the GNU System distribution.
2021-11-24 14:42 ` Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871r37c48o.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.