[PATCH] gnu: fcode-utils: Fix cross-compilation.

  • Done
  • quality assurance status badge
Details
4 participants
  • Zheng Junjie
  • Maxime Devos
  • Mathieu Othacehe
  • Vagrant Cascadian
Owner
unassigned
Submitted by
Zheng Junjie
Severity
normal
Z
Z
Zheng Junjie wrote on 25 Jul 2023 09:45
(address . guix-patches@gnu.org)
tencent_A089532DFC26692A4696DF9FA64E52B95106@qq.com
* gnu/packages/firmware.scm (fcode-utils)
[arguments]: add remove-makefile-strip phase.
---
gnu/packages/firmware.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 35d3100ac6..01565ed18a 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -387,7 +388,14 @@ (define-public fcode-utils
(string-append "DESTDIR=" #$output))
#:phases
#~(modify-phases %standard-phases
- (delete 'configure)))) ; No configure script.
+ (delete 'configure) ; No configure script.
+ (add-after 'unpack 'remove-makefile-strip
+ (lambda _
+ (substitute* '("detok/Makefile"
+ "romheaders/Makefile"
+ "toke/Makefile")
+ (("\\$\\(STRIP\\).*")
+ "")))))))
(native-inputs
(list tcsh))
(home-page "https://www.openfirmware.info/FCODE_suite")

base-commit: 76e041f9eef85bb039c5251d3350c62ee2066883
--
2.41.0
V
V
Vagrant Cascadian wrote on 25 Jul 2023 19:11
87edkvgbm8.fsf@wireframe
On 2023-07-25, Zheng Junjie wrote:
Toggle quote (32 lines)
> * gnu/packages/firmware.scm (fcode-utils)
> [arguments]: add remove-makefile-strip phase.
> ---
> gnu/packages/firmware.scm | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
> index 35d3100ac6..01565ed18a 100644
> --- a/gnu/packages/firmware.scm
> +++ b/gnu/packages/firmware.scm
> @@ -9,6 +9,7 @@
> ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
> ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
> ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
> +;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -387,7 +388,14 @@ (define-public fcode-utils
> (string-append "DESTDIR=" #$output))
> #:phases
> #~(modify-phases %standard-phases
> - (delete 'configure)))) ; No configure script.
> + (delete 'configure) ; No configure script.
> + (add-after 'unpack 'remove-makefile-strip
> + (lambda _
> + (substitute* '("detok/Makefile"
> + "romheaders/Makefile"
> + "toke/Makefile")
> + (("\\$\\(STRIP\\).*")
> + "")))))))

Can you include a brief comment? That is a bit easier than rummaging
around through git history commit messages... :)

Toggle quote (8 lines)
> (native-inputs
> (list tcsh))
> (home-page "https://www.openfirmware.info/FCODE_suite")
>
> base-commit: 76e041f9eef85bb039c5251d3350c62ee2066883
> --
> 2.41.0

live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCZMACLwAKCRDcUY/If5cW
quDMAP900Wys15C654BbSUci6BFh4Kk6S2/naVI0xiwPkpvQ8QD+Mm9IyuEwsQ5M
IazJt4NDHNMf2riqIh636yGTp3gcZw0=
=/0jG
-----END PGP SIGNATURE-----

Z
Z
Zheng Junjie wrote on 26 Jul 2023 08:03
[PATCH v2] gnu: fcode-utils: Fix cross-compilation.
(address . 64845@debbugs.gnu.org)
tencent_F2DA87CDCA54B02CC1BF301DF0728D92DF07@qq.com
* gnu/packages/firmware.scm (fcode-utils)
[arguments]: add remove-makefile-strip phase.
---
gnu/packages/firmware.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 35d3100ac6..ba8d462af9 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -387,7 +388,16 @@ (define-public fcode-utils
(string-append "DESTDIR=" #$output))
#:phases
#~(modify-phases %standard-phases
- (delete 'configure)))) ; No configure script.
+ (delete 'configure) ; No configure script.
+ ;; makefile will invoke `strip', it break cross-compile,
+ ;; and we have 'strip phase handled it , so remove it from makefile.
+ (add-after 'unpack 'remove-makefile-strip
+ (lambda _
+ (substitute* '("detok/Makefile"
+ "romheaders/Makefile"
+ "toke/Makefile")
+ (("\\$\\(STRIP\\).*")
+ "")))))))
(native-inputs
(list tcsh))
(home-page "https://www.openfirmware.info/FCODE_suite")

base-commit: 76e041f9eef85bb039c5251d3350c62ee2066883
--
2.41.0
M
M
Maxime Devos wrote on 26 Jul 2023 14:34
Re: [PATCH] gnu: fcode-utils: Fix cross-compilation.
74457061-f7af-f7c4-e06e-1b14f3893fa7@telenet.be
I happened upon this patch ...
setting STRIP to (strip-for-target) in #:make-flags (like done for CC)
would fix this in a simpler way.
Also, that (string-append "DESTDIR=" #$output)) is bogus; it's a bug (*)
in the Makefiles that it used $(DESTIDIR) instead of $(DESTDIR)$(PREFIX).
install:
mkdir -p $(DESTDIR)/bin
cp $(PROGRAM) $(DESTDIR)/bin/$(PROGRAM)
(*)
Attachment: OpenPGP_signature
Z
Z
Zheng Junjie wrote on 28 Jul 2023 15:33
[PATCH v3 1/2] utils: Add 'strip-for-target'.
(address . 64845@debbugs.gnu.org)
tencent_75E7D498ACA3BF5C9DF0728792E2DAEE4D07@qq.com
* guix/utils.scm (strip-for-target): New procedure.
---
guix/utils.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (36 lines)
diff --git a/guix/utils.scm b/guix/utils.scm
index e9af33bdeb..7a42b49df2 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
;;; Copyright © 2023 Philip McGrath <philip@philipmcgrath.com>
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -111,6 +112,7 @@ (define-module (guix utils)
cxx-for-target
ld-for-target
pkg-config-for-target
+ strip-for-target
version-compare
version>?
@@ -784,6 +786,11 @@ (define* (pkg-config-for-target #:optional (target (%current-target-system)))
(string-append target "-pkg-config")
"pkg-config"))
+(define* (strip-for-target #:optional (target (%current-target-system)))
+ (if target
+ (string-append target "-strip")
+ "strip"))
+
(define version-compare
(let ((strverscmp
(let ((sym (or (dynamic-func "strverscmp" (dynamic-link))

base-commit: 35c8d631d2bd63c64e863b5509f29fdcb7f856e6
--
2.41.0
Z
Z
Zheng Junjie wrote on 28 Jul 2023 15:33
[PATCH v3 2/2] gnu: fcode-utils: Fix cross-compilation.
(address . 64845@debbugs.gnu.org)
tencent_4112DB5AA14D92549DAC9D3F0A9DA872DC07@qq.com
* gnu/packages/firmware.scm (fcode-utils)
[arguments]: use STRIP-FOR-TARGET.
---
gnu/packages/firmware.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (22 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index ff5afbcbe1..70c43a6ad0 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -384,6 +385,7 @@ (define-public fcode-utils
#:test-target "tests"
#:make-flags
#~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "STRIP=" #$(strip-for-target))
(string-append "DESTDIR=" #$output))
#:phases
#~(modify-phases %standard-phases
--
2.41.0
M
M
Mathieu Othacehe wrote on 26 Oct 2023 14:41
(name . Zheng Junjie)(address . 873216071@qq.com)
87sf5xk13m.fsf@gnu.org
Toggle quote (3 lines)
> * gnu/packages/firmware.scm (fcode-utils)
> [arguments]: use STRIP-FOR-TARGET.

Applied both patches, thanks,

Mathieu
Closed
?