Package: guix-patches;
Reported by: Maxime Devos <maximedevos <at> telenet.be>
Date: Tue, 2 Aug 2022 11:55:02 UTC
Severity: normal
Tags: patch
Done: Mathieu Othacehe <othacehe <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56882 in the body.
You can then email your comments to 56882 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
guix-patches <at> gnu.org
:bug#56882
; Package guix-patches
.
(Tue, 02 Aug 2022 11:55:02 GMT) Full text and rfc822 format available.Maxime Devos <maximedevos <at> telenet.be>
:guix-patches <at> gnu.org
.
(Tue, 02 Aug 2022 11:55:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Maxime Devos <maximedevos <at> telenet.be> To: guix-patches <at> gnu.org Subject: [PATCH 0/4] build-system/perl: Support some cross-compilation, and test with xdg-utils Date: Tue, 2 Aug 2022 13:54:18 +0200
[Message part 1 (text/plain, inline)]
Supporting cross-compilation of xdg-utils opens the way to trying cross-compilation of Qt things. Things like XS are unsupported -- going by https://arsv.github.io/perl-cross/modules.html and the web page that states that external modules need to be copied into Perl first (but which I cannot find anymore), it sounds rather complicated. Greeetings, Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]
guix-patches <at> gnu.org
:bug#56882
; Package guix-patches
.
(Tue, 02 Aug 2022 12:14:01 GMT) Full text and rfc822 format available.Message #8 received at 56882 <at> debbugs.gnu.org (full text, mbox):
From: Maxime Devos <maximedevos <at> telenet.be> To: 56882 <at> debbugs.gnu.org Cc: Maxime Devos <maximedevos <at> telenet.be> Subject: [PATCH 1/4] build-system/perl: Support cross-compilation of some Perl packages. Date: Tue, 2 Aug 2022 14:13:26 +0200
* guix/build-system/perl.scm: Add info on cross-compilation. (lower)[private-keywords]: Remove #:target when cross-compiling. (lower)[target]: Set. (host-inputs)[perl]: New entry. (host-inputs)[(standard-packages)]: Move to ... (build-inputs)[(standard-packages)]: ... here when cross-compiling. (build-inputs)[standard-cross-packages]: Add when cross-compiling. (target-inputs): New entry when cross-compiling. (build): Use perl-cross-build when cross-compiling. (perl-cross-build): New procedure. --- guix/build-system/perl.scm | 120 +++++++++++++++++++++++++++++++------ 1 file changed, 103 insertions(+), 17 deletions(-) diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm index db0a916fb2..3890cd91ea 100644 --- a/guix/build-system/perl.scm +++ b/guix/build-system/perl.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2021 Ludovic Courtès <ludo <at> gnu.org> +;;; Copyright © 2022 Maxime Devos <maximedevos <at> telenet.be> ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,13 +30,17 @@ (define-module (guix build-system perl) #:use-module (ice-9 match) #:export (%perl-build-system-modules perl-build + perl-cross-build perl-build-system)) ;; Commentary: ;; ;; Standard build procedure for Perl packages using the "makefile ;; maker"---i.e., "perl Makefile.PL". This is implemented as an extension of -;; `gnu-build-system'. +;; `gnu-build-system'. Cross-compilation is supported for some simple Perl +;; packages, but not for any Perl packages that do things like XS (Perl's FFI), +;; which makes C-style shared libraries, as it is currently not known how to +;; tell Perl to properly cross-compile. ;; ;; Code: @@ -59,24 +64,43 @@ (define* (lower name #:rest arguments) "Return a bag for NAME." (define private-keywords - '(#:target #:perl #:inputs #:native-inputs)) + `(#:perl #:inputs #:native-inputs + ,@(if target '() '(#:target)))) - (and (not target) ;XXX: no cross-compilation - (bag - (name name) - (system system) - (host-inputs `(,@(if source - `(("source" ,source)) - '()) - ,@inputs + (bag + (name name) + (system system) (target target) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + ;; For interpreters in #! (shebang) + ,@(if target + `(("perl" ,perl)) + '()) - ;; Keep the standard inputs of 'gnu-build-system'. - ,@(standard-packages))) - (build-inputs `(("perl" ,perl) - ,@native-inputs)) - (outputs outputs) - (build perl-build) - (arguments (strip-keyword-arguments private-keywords arguments))))) + ;; Keep the standard inputs of 'gnu-build-system'. + ;; TODO: make this unconditional, putting this into 'build-inputs'. + ,@(if target + '() + (standard-packages)))) + (build-inputs `(("perl" ,perl) + ,@native-inputs + ,@(if target + (standard-cross-packages target 'host) + '()) + ,@(if target + (standard-packages) + '()))) + ;; Keep the standard inputs of 'gnu-build-system'. + (target-inputs (if target + (standard-cross-packages target 'target) + '())) + (outputs outputs) + (build (if target + perl-cross-build + perl-build)) + (arguments (strip-keyword-arguments private-keywords arguments)))) (define* (perl-build name inputs #:key source @@ -127,6 +151,68 @@ (define build (gexp->derivation name build #:system system #:target #f + #:graft? #f + #:guile-for-build guile))) + +(define* (perl-cross-build name #:key + source + target + build-inputs host-inputs target-inputs + (search-paths '()) + (native-search-paths '()) + (tests? #f) ; usually not possible when cross-compiling + (parallel-build? #t) + (parallel-tests? #t) + (make-maker? #f) + (make-maker-flags ''()) + (module-build-flags ''()) + (phases '(@ (guix build perl-build-system) + %standard-phases)) + (outputs '("out")) + (system (%current-system)) + (build (nix-system->gnu-triplet system)) + (guile #f) + (imported-modules %perl-build-system-modules) + (modules '((guix build perl-build-system) + (guix build utils)))) + "Cross-build SOURCE to TARGET using PERL, and with INPUTS. This assumes that +SOURCE provides a `Makefile.PL' file as its build system and does not use XS +or similar." + (define inputs + #~(append #$(input-tuples->gexp host-inputs) + #+(input-tuples->gexp target-inputs))) + (define builder + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + (perl-build #:name #$name + #:source #+source + #:search-paths '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:native-search-paths '#$(sexp->gexp + (map search-path-specification->sexp + native-search-paths)) + #:make-maker? #$make-maker? + #:make-maker-flags #$make-maker-flags + #:module-build-flags #$(sexp->gexp module-build-flags) + #:phases #$phases + #:build #$build + #:system #$system + #:target #$target + #:test-target "test" + #:tests? #$tests? + #:parallel-build? #$parallel-build? + #:parallel-tests? #$parallel-tests? + #:outputs #$(outputs->gexp outputs) + #:inputs #$inputs + #:native-inputs #+(input-tuples->gexp build-inputs))))) + (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) + system #:graft? #f))) + (gexp->derivation name builder + #:system system + #:target target + #:graft? #false #:guile-for-build guile))) (define perl-build-system base-commit: d519305d83d08058e4def2c4d72fe62102d9599d -- 2.37.0
guix-patches <at> gnu.org
:bug#56882
; Package guix-patches
.
(Tue, 02 Aug 2022 12:14:02 GMT) Full text and rfc822 format available.Message #11 received at 56882 <at> debbugs.gnu.org (full text, mbox):
From: Maxime Devos <maximedevos <at> telenet.be> To: 56882 <at> debbugs.gnu.org Cc: Maxime Devos <maximedevos <at> telenet.be> Subject: [PATCH 3/4] perl-file-mimeinfo: Fix cross-compilation. Date: Tue, 2 Aug 2022 14:13:28 +0200
The result of "guix style" was ignored, as it put #~(modify-phases ...) on the same line as #:phases, causing it to go beyond to 80 columns limit. * gnu/packages/freedesktop.scm (perl-file-mimeinfo)[arguments]<#:phases>: Make it a G-exp to avoid messy nested quasiquotation. {wrap-programs}: When cross-compiling, don't use the PELRL5LIB environment variable, instead use 'search-path-as-list'. --- gnu/packages/freedesktop.scm | 37 +++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 577b354f66..2d12567a42 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -1946,19 +1946,30 @@ (define-public perl-file-mimeinfo (arguments ;; Some tests fail due to requiring the mimetype of perl files to be ;; text/plain when they are actually application/x-perl. - `(#:tests? #f - #:phases - (modify-phases %standard-phases - (add-after 'install 'wrap-programs - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (for-each (lambda (prog) - (wrap-program (string-append out "/bin/" prog) - `("PERL5LIB" ":" prefix - (,(string-append (getenv "PERL5LIB") ":" out - "/lib/perl5/site_perl"))))) - '("mimeopen" "mimetype"))) - #t))))) + (list #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'wrap-programs + ;; TODO(staging): Make unconditional. + (lambda* (#:key #$@(if (%current-target-system) + #~(inputs) + #~()) outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (prog) + (wrap-program (string-append out "/bin/" prog) + `("PERL5LIB" ":" prefix + ;; PERL5LIB looks in 'native-inputs', not 'inputs', + ;; whereas the latter is required for + ;; cross-compilation. + #$(if (%current-target-system) + #~,(search-path-as-list + '("lib/perl5/site_perl") + (map cdr (append inputs outputs))) + #~(,(string-append (getenv "PERL5LIB") ":" out + "/lib/perl5/site_perl")))))) + '("mimeopen" "mimetype"))) + #t))))) (home-page "https://metacpan.org/release/File-MimeInfo") (synopsis "Determine file type from the file name") (description -- 2.37.0
guix-patches <at> gnu.org
:bug#56882
; Package guix-patches
.
(Tue, 02 Aug 2022 12:14:02 GMT) Full text and rfc822 format available.Message #14 received at 56882 <at> debbugs.gnu.org (full text, mbox):
From: Maxime Devos <maximedevos <at> telenet.be> To: 56882 <at> debbugs.gnu.org Cc: Maxime Devos <maximedevos <at> telenet.be> Subject: [PATCH 4/4] xdg-utils: Support cross-compilation. Date: Tue, 2 Aug 2022 14:13:29 +0200
"guix style" does not support with-directory-excursion yet, leading to too much spacing, so I have ignored its results. It has been verified that this does not cause rebuilds when compiling natively. The references graph when cross-compiling has also been verified -- glibc-2.33 and the native bash-static-5.1.8 still remains in the graph, but via the cross-compiled inetutils-2.0, ncurses-6.2.20210619 and via gcc-cross-TARGET-10.3.0-lib, which is not related with Perl cross-compilation. * gnu/packages/freedesktop.scm (xdg-utils)[inputs]{bash-minimal,file}: New inputs when cross-compiling. (xdg-utils)[arguments]<#:phases>{locate-catalog-files}: Add 'native-inputs' argument when cross-compiling. Look for docbook-xml and docbook-xsl in native-inputs when cross-compiling. While we are at it, eliminate input labels with search-input-file. (xdg-utils)[arguments]<#:phases>{patch-hardcoded-patch}: Use search-input-file + inputs instead of 'which' when cross-compiling. --- gnu/packages/freedesktop.scm | 58 ++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 2d12567a42..1c984ebca8 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -25,7 +25,7 @@ ;;; Copyright © 2021 pineapples <guixuser6392 <at> protonmail.com> ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev> ;;; Copyright © 2021 Robby Zambito <contact <at> robbyzambito.me> -;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be> +;;; Copyright © 2021, 2022 Maxime Devos <maximedevos <at> telenet.be> ;;; Copyright © 2021 John Kehayias <john.kehayias <at> protonmail.com> ;;; Copyright © 2021, 2021 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2022 Daniel Meißner <daniel.meissner-i4k <at> ruhr-uni-bochum.de> @@ -76,6 +76,7 @@ (define-module (gnu packages freedesktop) #:use-module (gnu packages disk) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) + #:use-module (gnu packages file) #:use-module (gnu packages fontutils) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) @@ -414,7 +415,15 @@ (define-public xdg-utils (list docbook-xsl docbook-xml-4.1.2 libxslt w3m xmlto)) (inputs `(("awk" ,gawk) + ;; TODO(staging): Make this unconditional, to avoid canonical packages, + ;; see <https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00148.html>. + ,@(if (%current-target-system) + `(("bash-minimal" ,bash-minimal)) ; for 'wrap-program' + '()) ("coreutils" ,coreutils) + ,@(if (%current-target-system) + `(("file" ,file)) + '()) ("grep" ,grep) ("inetutils" ,inetutils) ; xdg-screensaver uses `hostname' ("perl-file-mimeinfo" ,perl-file-mimeinfo) ; for mimeopen fallback @@ -428,19 +437,41 @@ (define-public xdg-utils #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-hardcoded-paths - (lambda _ - (substitute* "scripts/xdg-mime.in" - (("/usr/bin/file") (which "file"))) - (substitute* "scripts/xdg-open.in" - (("/usr/bin/printf") (which "printf"))) - #t)) + ;; TODO(staging): make unconditional + (,@(if (%current-target-system) + '(lambda* (#:key inputs #:allow-other-keys)) + '(lambda _)) + (substitute* "scripts/xdg-mime.in" + (("/usr/bin/file") + (,@(if (%current-target-system) + '(search-input-file inputs "bin/file") + '(which "file"))))) + (substitute* "scripts/xdg-open.in" + (("/usr/bin/printf") + (,@(if (%current-target-system) + '(search-input-file inputs "bin/printf") + '(which "printf"))))) + #t)) (add-before 'build 'locate-catalog-files - (lambda* (#:key inputs #:allow-other-keys) - (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml") - "/xml/dtd/docbook")) - (xsldoc (string-append (assoc-ref inputs "docbook-xsl") - "/xml/xsl/docbook-xsl-" - ,(package-version docbook-xsl)))) + ;; TODO(staging): Make unconditional for simplicity. + (lambda* (#:key inputs ,@(if (%current-target-system) + '(native-inputs) + '()) #:allow-other-keys) + ;; TODO(staging): Make unconditional for simplicity and + ;; to avoid dependning on input labels. + (let ,(if (%current-target-system) + `((native-inputs (or native-inputs inputs)) + (xmldoc (search-input-directory native-inputs + "xml/dtd/docbook")) + (xsldoc (search-input-directory + native-inputs + (string-append "xml/xsl/docbook-xsl-" + ,(package-version docbook-xsl))))) + `((xmldoc (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook")) + (xsldoc (string-append (assoc-ref inputs "docbook-xsl") + "/xml/xsl/docbook-xsl-" + ,(package-version docbook-xsl))))) (for-each (lambda (file) (substitute* file (("http://.*/docbookx\\.dtd") @@ -456,6 +487,7 @@ (define-public xdg-utils "/manpages/docbook.xsl man"))) (setenv "STYLESHEET" (string-append xsldoc "/html/docbook.xsl")) + ;; TODO(staging): Might as well remove the #t while we are at it. #t))) (add-after 'install 'wrap-executables (lambda* (#:key inputs outputs #:allow-other-keys) -- 2.37.0
guix-patches <at> gnu.org
:bug#56882
; Package guix-patches
.
(Tue, 02 Aug 2022 12:14:02 GMT) Full text and rfc822 format available.Message #17 received at 56882 <at> debbugs.gnu.org (full text, mbox):
From: Maxime Devos <maximedevos <at> telenet.be> To: 56882 <at> debbugs.gnu.org Cc: Maxime Devos <maximedevos <at> telenet.be> Subject: [PATCH 2/4] gnu: freedesktop: Add 'bash' input for 'wrap-program' Date: Tue, 2 Aug 2022 14:13:27 +0200
It is required for cross-compilation. Cherry-picked from <https://issues.guix.gnu.org/49327#6>. * gnu/packages/freedesktop.scm (udisks)[inputs]: Add 'bash-minimal' when cross-compiling. (perl-file-mimeinfo)[inputs]: Likewise. (udiskie)[inputs]: Likewise. --- gnu/packages/freedesktop.scm | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 4d06235771..577b354f66 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -1319,13 +1319,17 @@ (define-public udisks (propagated-inputs (list glib)) ; required by udisks2.pc (inputs - (list acl - cryptsetup - libatasmart - libblockdev - libgudev - polkit - util-linux)) + `(,acl + ;; TODO(staging): Make unconditional. + ,@(if (%current-target-system) + (list bash-minimal) ; for wrap-program + '()) + ,cryptsetup + ,libatasmart + ,libblockdev + ,libgudev + ,polkit + ,util-linux)) (outputs '("out" "doc")) ;5 MiB of gtk-doc HTML (arguments @@ -1930,6 +1934,11 @@ (define-public perl-file-mimeinfo (base32 "1sh8r6vczyz08zm8vfsjmkg6a165wch54akjdrd1vbifcmwjg5pi")))) (build-system perl-build-system) + (inputs + ;; TODO(staging): Make unconditional. + (if (%current-target-system) + (list bash-minimal) ; for wrap-program + '())) ;; If the tests are fixed, add perl-test-pod, perl-test-pod-coverage, and ;; perl-test-tiny as native-inputs. (propagated-inputs @@ -2026,7 +2035,15 @@ (define-public udiskie ("gettext" ,gettext-minimal) ("gobject-introspection" ,gobject-introspection))) (inputs - (list gobject-introspection gtk+ libappindicator libnotify udisks)) + ;; TODO(staging): Make unconditional. + `(,@(if (%current-target-system) + (list bash-minimal) + '()) + ,gobject-introspection + ,gtk+ + ,libappindicator + ,libnotify + ,udisks)) (propagated-inputs (list python-docopt python-pygobject python-keyutils python-pyxdg python-pyyaml)) -- 2.37.0
Mathieu Othacehe <othacehe <at> gnu.org>
:Maxime Devos <maximedevos <at> telenet.be>
:Message #22 received at 56882-done <at> debbugs.gnu.org (full text, mbox):
From: Mathieu Othacehe <othacehe <at> gnu.org> To: Maxime Devos <maximedevos <at> telenet.be> Cc: 56882-done <at> debbugs.gnu.org Subject: Re: bug#56882: [PATCH 0/4] build-system/perl: Support some cross-compilation, and test with xdg-utils Date: Sat, 06 Aug 2022 18:25:39 +0200
Hello Maxime, > Supporting cross-compilation of xdg-utils opens the way to trying > cross-compilation of Qt things. > > Things like XS are unsupported -- going by > https://arsv.github.io/perl-cross/modules.html and the web page that states > that external modules need to be copied into Perl first (but which I cannot > find anymore), it sounds rather complicated. At least that's a very good start :) I fixed some long lines before pushing. Thanks, Mathieu
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Sun, 04 Sep 2022 11:24:09 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.