unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#57857] [PATCH] gnu: busybox: fix the cross build.
@ 2022-09-16 12:35 路辉
  2022-09-16 15:08 ` Maxime Devos
  0 siblings, 1 reply; 5+ messages in thread
From: 路辉 @ 2022-09-16 12:35 UTC (permalink / raw)
  To: 57857

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-gnu-busybox-fix-the-cross-build.patch --]
[-- Type: text/x-patch, Size: 2739 bytes --]

From 17b77a70781dc5f0e2f54516748081e51da36a14 Mon Sep 17 00:00:00 2001
From: Lu Hui <luhux76@gmail.com>
Date: Fri, 16 Sep 2022 18:34:59 +0800
Subject: [PATCH] gnu: busybox: fix the cross build.

* gnu/packages/busybox.scm (busybox): fix cross build
---
 gnu/packages/busybox.scm | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/busybox.scm b/gnu/packages/busybox.scm
index 4468d71088..600e94f5b4 100644
--- a/gnu/packages/busybox.scm
+++ b/gnu/packages/busybox.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2022 LuHui <luhux76@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -45,8 +46,14 @@ (define-public busybox
                 "0jfm9fik7nv4w21zqdg830pddgkdjmplmna9yjn9ck1lwn4vsps1"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
+     `(#:tests? (if ,(%current-target-system) #f #t)
+       #:make-flags
+       (let ((target ,(%current-target-system)))
+         (if target
+             (list (string-append "CROSS_COMPILE=" target "-"))
+             (list)))
+      #:phases
+      (modify-phases %standard-phases
          (add-before 'configure 'disable-timestamps
            (lambda _
              (setenv "KCONFIG_NOTIMESTAMP" "1")))
@@ -65,7 +72,7 @@ (define-public busybox
                (("# CONFIG_INSTALL_NO_USR is not set")
                 "CONFIG_INSTALL_NO_USR=y"))))
          (replace 'check
-           (lambda* (#:key make-flags #:allow-other-keys)
+           (lambda* (#:key tests? make-flags #:allow-other-keys)
              (substitute* '("testsuite/du/du-s-works"
                             "testsuite/du/du-works")
                (("/bin") "/etc"))  ; there is no /bin but there is a /etc
@@ -93,11 +100,13 @@ (define-public busybox
              (delete-file "testsuite/which/which-uses-default-path")
              (rmdir "testsuite/which")
 
-             (apply invoke "make"
-                     ;; "V=1"
-                     "SKIP_KNOWN_BUGS=1"
-                     "SKIP_INTERNET_TESTS=1"
-                     "check" make-flags)))
+             (if tests?
+                 (apply invoke "make"
+                        ;; "V=1"
+                        "SKIP_KNOWN_BUGS=1"
+                        "SKIP_INTERNET_TESTS=1"
+                        "check" make-flags)
+                 #t)))
          (replace 'install
            (lambda* (#:key outputs make-flags #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#57857] [PATCH] gnu: busybox: fix the cross build.
  2022-09-16 12:35 [bug#57857] [PATCH] gnu: busybox: fix the cross build 路辉
@ 2022-09-16 15:08 ` Maxime Devos
  2022-09-16 15:53   ` 路辉
  0 siblings, 1 reply; 5+ messages in thread
From: Maxime Devos @ 2022-09-16 15:08 UTC (permalink / raw)
  To: 路辉, 57857


[-- Attachment #1.1.1: Type: text/plain, Size: 1225 bytes --]



On 16-09-2022 14:35, 路辉 wrote:
> 


+             (if tests?
+                 (apply invoke "make"
+                        ;; "V=1"
+                        "SKIP_KNOWN_BUGS=1"
+                        "SKIP_INTERNET_TESTS=1"
+                        "check" make-flags)
+                 #t)))

Can be simplified to

(when tests?
   (apply invoke "make"
           ;; "V=1"
           "SKIP_KNOWN_BUGS=1"
           "SKIP_INTERNET_TESTS=1"
           "check" make-flags))


+     `(#:tests? (if ,(%current-target-system) #f #t)

That's the default, no need to mention it again here.

+       #:make-flags
+       (let ((target ,(%current-target-system)))
+         (if target
+             (list (string-append "CROSS_COMPILE=" target "-"))
+             (list)))

Can be simplified:

#:make-flags
,(let ((target ,(%current-target-system)))
    (if target
        #~(list (string-append "CROSS_COMPILE=" ,target))
        #~'()))

(the #~ makes the phasing more explicit, if you go for that, I recommend 
turning the arguments into (arguments (list #:phases #~(modify-phases 
...) #:make-flags ...)), instead of using ` / , , to remain consistent.)

Greetings,
Maxime

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#57857] [PATCH] gnu: busybox: fix the cross build.
  2022-09-16 15:08 ` Maxime Devos
@ 2022-09-16 15:53   ` 路辉
  2022-09-25 17:55     ` Maxime Devos
  2022-09-26 21:27     ` bug#57857: " Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: 路辉 @ 2022-09-16 15:53 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 57857

[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]

2022-09-16 15:08 GMT, Maxime Devos <maximedevos@telenet.be>:
>
>
> On 16-09-2022 14:35, 路辉 wrote:
>>
>
>
> +             (if tests?
> +                 (apply invoke "make"
> +                        ;; "V=1"
> +                        "SKIP_KNOWN_BUGS=1"
> +                        "SKIP_INTERNET_TESTS=1"
> +                        "check" make-flags)
> +                 #t)))
>
> Can be simplified to
>
> (when tests?
>    (apply invoke "make"
>            ;; "V=1"
>            "SKIP_KNOWN_BUGS=1"
>            "SKIP_INTERNET_TESTS=1"
>            "check" make-flags))
>
>
> +     `(#:tests? (if ,(%current-target-system) #f #t)
>
> That's the default, no need to mention it again here.
>
> +       #:make-flags
> +       (let ((target ,(%current-target-system)))
> +         (if target
> +             (list (string-append "CROSS_COMPILE=" target "-"))
> +             (list)))
>
> Can be simplified:
>
> #:make-flags
> ,(let ((target ,(%current-target-system)))
>     (if target
>         #~(list (string-append "CROSS_COMPILE=" ,target))
>         #~'()))
>
> (the #~ makes the phasing more explicit, if you go for that, I recommend
> turning the arguments into (arguments (list #:phases #~(modify-phases
> ...) #:make-flags ...)), instead of using ` / , , to remain consistent.)
>
> Greetings,
> Maxime
>

new patch vvvv

[-- Attachment #2: 0001-gnu-busybox-fix-the-cross-build.patch --]
[-- Type: text/x-patch, Size: 3063 bytes --]

From abb215e6dbee73fefc32dbfd13cf153b028bcf93 Mon Sep 17 00:00:00 2001
From: Lu Hui <luhux76@gmail.com>
Date: Fri, 16 Sep 2022 18:34:59 +0800
Subject: [PATCH] gnu: busybox: fix the cross build.

* gnu/packages/busybox.scm (busybox): fix cross build
---
 gnu/packages/busybox.scm | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/busybox.scm b/gnu/packages/busybox.scm
index 4468d71088..4601205f8b 100644
--- a/gnu/packages/busybox.scm
+++ b/gnu/packages/busybox.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2022 LuHui <luhux76@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -45,8 +46,9 @@ (define-public busybox
                 "0jfm9fik7nv4w21zqdg830pddgkdjmplmna9yjn9ck1lwn4vsps1"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
+     (list
+      #:phases
+       #~(modify-phases %standard-phases
          (add-before 'configure 'disable-timestamps
            (lambda _
              (setenv "KCONFIG_NOTIMESTAMP" "1")))
@@ -65,7 +67,7 @@ (define-public busybox
                (("# CONFIG_INSTALL_NO_USR is not set")
                 "CONFIG_INSTALL_NO_USR=y"))))
          (replace 'check
-           (lambda* (#:key make-flags #:allow-other-keys)
+           (lambda* (#:key tests? make-flags #:allow-other-keys)
              (substitute* '("testsuite/du/du-s-works"
                             "testsuite/du/du-works")
                (("/bin") "/etc"))  ; there is no /bin but there is a /etc
@@ -93,17 +95,23 @@ (define-public busybox
              (delete-file "testsuite/which/which-uses-default-path")
              (rmdir "testsuite/which")
 
-             (apply invoke "make"
-                     ;; "V=1"
-                     "SKIP_KNOWN_BUGS=1"
-                     "SKIP_INTERNET_TESTS=1"
-                     "check" make-flags)))
+             (when tests?
+                 (apply invoke "make"
+                        ;; "V=1"
+                        "SKIP_KNOWN_BUGS=1"
+                        "SKIP_INTERNET_TESTS=1"
+                        "check" make-flags))))
          (replace 'install
            (lambda* (#:key outputs make-flags #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (apply invoke "make"
                        (string-append "CONFIG_PREFIX=" out)
-                       "install" make-flags)))))))
+                       "install" make-flags)))))
+      #:make-flags
+      #~(let ((target #$(%current-target-system)))
+          (if target
+              (list (string-append "CROSS_COMPILE=" target "-"))
+              '()))))
     (native-inputs (list perl ; needed to generate the man pages (pod2man)
                          ;; The following are needed by the tests.
                          inetutils
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#57857] [PATCH] gnu: busybox: fix the cross build.
  2022-09-16 15:53   ` 路辉
@ 2022-09-25 17:55     ` Maxime Devos
  2022-09-26 21:27     ` bug#57857: " Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Maxime Devos @ 2022-09-25 17:55 UTC (permalink / raw)
  To: 路辉; +Cc: 57857


[-- Attachment #1.1.1: Type: text/plain, Size: 838 bytes --]



On 16-09-2022 17:53, 路辉 wrote:
>> Can be simplified:
>>
>> #:make-flags
>> ,(let ((target ,(%current-target-system)))

Oops the , before (%current-target-system) shouldn't be there

>>      (if target
>>          #~(list (string-append "CROSS_COMPILE=" ,target))

OOps, ,target -> #$target

>>          #~'()))
>>
>> (the #~ makes the phasing more explicit, if you go for that, I recommend
>> turning the arguments into (arguments (list #:phases #~(modify-phases
>> ...) #:make-flags ...)), instead of using ` / , , to remain consistent.)
>>
>> Greetings,
>> Maxime
>>
> 
> new patch vvvv

The #:make-flags simplification is missing (it can help with avoiding 
rebuilds (e.g. if a particular architecture needs some different 
#:make-flags than usual), but otherwise looks good.

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#57857: [PATCH] gnu: busybox: fix the cross build.
  2022-09-16 15:53   ` 路辉
  2022-09-25 17:55     ` Maxime Devos
@ 2022-09-26 21:27     ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2022-09-26 21:27 UTC (permalink / raw)
  To: 路辉; +Cc: 57857-done, Maxime Devos

Hi,

路辉 <luhux76@gmail.com> skribis:

> * gnu/packages/busybox.scm (busybox): fix cross build

Applied!  Thank you and thanks Maxime for reviewing.

Ludo’.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-26 21:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 12:35 [bug#57857] [PATCH] gnu: busybox: fix the cross build 路辉
2022-09-16 15:08 ` Maxime Devos
2022-09-16 15:53   ` 路辉
2022-09-25 17:55     ` Maxime Devos
2022-09-26 21:27     ` bug#57857: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).