[PATCH]: Use 'cc-for-target'.

  • Done
  • quality assurance status badge
Details
3 participants
  • Maxime Devos
  • Tobias Geerinckx-Rice
  • Mathieu Othacehe
Owner
unassigned
Submitted by
Maxime Devos
Severity
normal
M
M
Maxime Devos wrote on 10 Apr 2021 20:03
(address . guix-patches@gnu.org)
951b5d9f5c46625e1a06fc925454d11678d4e55e.camel@telenet.be
Hi Guix,

This patch series addressed some warnings generated by the linter defined
in #47676. There will (presumably) be more patches along these lines
later.

These patches do *not* cause any rebuilds (except when cross-compiling),
as (string-append "CC=" (cc-for-target)) evaluates to "CC=gcc" when not
cross-compiling (this is evaluated from within Guix, not from in the build
container, so this doesn't cause a derivation change).

An exception is xssproxy, which needs to be rebuilt, due to nested usage of
quasiquote / unquote. It can probably be worked-around but I don't think
it's worth it for a single package.

./pre-inst-env guix build guix still succeeds, and the derivation for guix
isn't even changed:

$./pre-inst-env guix weather guix
Toggle quote (6 lines)
> computing 1 package derivations for x86_64-linux...
> looking for 1 store items on https://ci.guix.gnu.org...
> https://ci.guix.gnu.org
> 100.0% substitutes available (1 out of 1)
> [...]

Now running "./pre-inst-env guix pull --url=$PWD --profile=tmp-prof --disable-authentication --allow-downgrades --banch=BRANCH";
I'll let you know if this fails.

Greetings,
Maxime
From 49ac49daca37f975527f2c2f756f719bd55d47ff Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sat, 10 Apr 2021 19:36:43 +0200
Subject: [PATCH 16/16] gnu: emacs-xyz: Use 'cc-for-target'.

* gnu/packages/emacs-xyz.scm
(emacs-emacsql, emacs-telega)[arguments]<#:phases>:
Use 'cc-for-target'.
---
gnu/packages/emacs-xyz.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index ca1daaeb82..5e7dff1247 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -15484,7 +15484,7 @@ object has been freed.")
(setenv "SHELL" "sh")))
(add-after 'setenv-shell 'build-emacsql-sqlite
(lambda _
- (invoke "make" "binary" "CC=gcc")))
+ (invoke "make" "binary" ,(string-append "CC=" (cc-for-target)))))
(add-after 'build-emacsql-sqlite 'install-emacsql-sqlite
;; This build phase installs emacs-emacsql binary.
(lambda* (#:key outputs #:allow-other-keys)
@@ -25106,7 +25106,7 @@ other @code{helm-type-file} sources such as @code{helm-locate}.")
(lambda _
(substitute* "server/Makefile"
(("CC=cc")
- "CC=gcc")
+ ,(string-append "CC=" (cc-for-target)))
(("INSTALL_PREFIX=\\$\\(HOME\\)/.telega")
(string-append "INSTALL_PREFIX=" (assoc-ref %outputs "out")
"/bin"))
--
2.31.1
From 2b6a5782507910a9f8204e30ce2b2bc6bfb7a03c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sat, 10 Apr 2021 19:34:31 +0200
Subject: [PATCH 15/16] gnu: endlessh: Use 'cc-for-target'.

* gnu/packages/ssh.scm (endlessh)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/ssh.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index fae10d0e16..e022175918 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -878,8 +878,8 @@ of existing remote shell facilities such as SSH.")
(base32 "0ziwr8j1frsp3dajr8h5glkm1dn5cci404kazz5w1jfrp0736x68"))))
(build-system gnu-build-system)
(arguments
- '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
- "CC=gcc")
+ `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+ ,(string-append "CC=" (cc-for-target)))
#:tests? #f ; no test target
#:phases
(modify-phases %standard-phases
--
2.31.1
From 38e4ba37e6804facffbe0c0a23c022d0e12f79df Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sat, 10 Apr 2021 19:32:14 +0200
Subject: [PATCH 14/16] gnu: miniupnpc: Use 'cc-for-target'.

* gnu/packages/upnp.scm (miniupnpc)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/upnp.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/upnp.scm b/gnu/packages/upnp.scm
index 2743ba456d..79e47671ab 100644
--- a/gnu/packages/upnp.scm
+++ b/gnu/packages/upnp.scm
@@ -61,11 +61,11 @@
;; The build system does not use a configure script but depends on
;; `make'. Hence we should pass parameters to `make' instead and remove
;; the configure phase.
- '(#:make-flags
+ `(#:make-flags
(list
(string-append "SH=" (assoc-ref %build-inputs "bash") "/bin/sh")
(string-append "INSTALLPREFIX=" (assoc-ref %outputs "out"))
- "CC=gcc"
+ ,(string-append "CC=" (cc-for-target))
;; Allow executables to find libminiupnpc.so.
(string-append "LDFLAGS=-Wl,-rpath="
--
2.31.1
From 6ef5f6ddfcaf28b686e7e666e6a34c9e8b496cbd Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sat, 10 Apr 2021 19:28:54 +0200
Subject: [PATCH 13/16] gnu: nyancat: Use 'cc-for-target'.

* gnu/packages/toys.scm
(nyancat)[arguments]<#:make-flags>: Use 'cc-for-target'.
---
gnu/packages/toys.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/toys.scm b/gnu/packages/toys.scm
index f88ea68436..bbd5753841 100644
--- a/gnu/packages/toys.scm
+++ b/gnu/packages/toys.scm
@@ -219,7 +219,7 @@ and various scenery elements.")
"1mg8nm5xzcq1xr8cvx24ym2vmafkw53rijllwcdm9miiz0p5ky9k"))))
(build-system gnu-build-system)
(arguments
- '(#:make-flags '("CC=gcc")
+ `(#:make-flags '(,(string-append "CC=" (cc-for-target)))
#:phases
(modify-phases %standard-phases
(delete 'configure) ; no configure script
--
2.31.1
From 8b375ad6ea6e151ad3a8fa5f77c5851668ec0a4a Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sat, 10 Apr 2021 19:25:04 +0200
Subject: [PATCH 12/16] gnu: image: Use 'cc-for-target'.

* gnu/packages/image.scm
(libjxr, giflib, freeimage)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/image.scm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Toggle diff (44 lines)
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index d04a247976..2047fe1e0f 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -457,8 +457,8 @@ lossless JPEG manipulations such as rotation, scaling or cropping:
"libjxr-fix-typos.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:make-flags
- (list "CC=gcc"
+ `(#:make-flags
+ (list ,(string-append "CC=" (cc-for-target))
;; A substitute* procedure call would be enough to add the -fPIC
;; flag if there was no file decoding error.
;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
@@ -890,7 +890,7 @@ JPEG 2000 Reference Software.")
(outputs '("bin" ; utility programs
"out")) ; library
(arguments
- '(#:make-flags (list "CC=gcc"
+ `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX="
(assoc-ref %outputs "out"))
(string-append "BINDIR="
@@ -1114,7 +1114,7 @@ supplies a generic doubly-linked list and some string functions.")
"0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
;; According to Fedora these files depend on private headers, but their
;; presence is required for building, so we replace them with empty files.
@@ -1138,7 +1138,7 @@ supplies a generic doubly-linked list and some string functions.")
(("-o root -g root") ""))
#t)))
#:make-flags
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
;; We need '-fpermissive' for Source/FreeImage.h.
;; libjxr doesn't have a pkg-config file.
(string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
--
2.31.1
From c0777a1a0fba6f8591ffadc3a8bb977350bbbbbe Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sat, 10 Apr 2021 13:52:07 +0200
Subject: [PATCH 10/16] gnu: image-viewers: Use 'cc-for-target'.

* gnu/packages/image-viewers.scm
(feh, imv)[arguments]<#:make-flags>: Use 'cc-for-target'.
---
gnu/packages/image-viewers.scm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
index b7c1ebc829..c7dd358ad4 100644
--- a/gnu/packages/image-viewers.scm
+++ b/gnu/packages/image-viewers.scm
@@ -89,10 +89,11 @@
"1d13x8hmvpdc5f5rj4l29ha7iz7wvqxjlvh6il04wq8igzrj0x23"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases (delete 'configure))
+ `(#:phases (modify-phases %standard-phases (delete 'configure))
#:test-target "test"
#:make-flags
- (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
+ (list ,(string-append "CC=" (cc-for-target))
+ (string-append "PREFIX=" (assoc-ref %outputs "out"))
"exif=1"
"inotify=1")))
(native-inputs
@@ -579,7 +580,7 @@ displayed in a terminal.")
(file-name (git-file-name name version))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(delete 'configure)
(add-after 'install 'record-absolute-file-names
@@ -593,7 +594,7 @@ displayed in a terminal.")
(string-append bin "/imv-")))
#t))))
#:make-flags
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" (assoc-ref %outputs "out"))
(string-append "CONFIGPREFIX="
(assoc-ref %outputs "out") "/etc"))))
--
2.31.1
From cce294f8c7c48584d7658ba20db02cac5e01d300 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Sat, 10 Apr 2021 13:47:52 +0200
Subject: [PATCH 09/16] gnu: cbatticon: Use 'cc-for-target'.

* gnu/packages/admin.scm (cbatticon)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/admin.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 06fc6baa46..2f362d1648 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -3003,7 +3003,7 @@ produce uniform output across heterogeneous networks.")
`(#:tests? #f ; no tests
#:make-flags
(list (string-append "PREFIX=" (assoc-ref %outputs "out"))
- "CC=gcc")
+ ,(string-append "CC=" (cc-for-target)))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure script
--
2.31.1
From 4be68610c9f2ff1773f7e409ee8f2bf02fb4ebf9 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 22:22:43 +0200
Subject: [PATCH 08/16] gnu: xdisorg: Use 'cc-for-target'.

* gnu/packages/xdisorg.scm
(bemenu, xbanish, sxhkd, xcape, xssproxy, xrandr-invert-colors)
(hsetroot)[arguments]<#:make-flags>: Use 'cc-for-target'.
(xsettingsd)[arguments]<#:scons-flags>: Likewise.
---
gnu/packages/xdisorg.scm | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

Toggle diff (80 lines)
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 725ea0afd6..3706d2026d 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -269,8 +269,8 @@ used to further tweak the behaviour of the different profiles.")
(base32 "1fjcs9d3533ay3nz79cx3c0lmy2chgragr2lhsy0xl2ckr0iins0"))))
(build-system gnu-build-system)
(arguments
- '(#:tests? #f
- #:make-flags (list "CC=gcc"
+ `(#:tests? #f
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
"CFLAGS=-O2 -fPIC"
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out") "/lib")
@@ -892,7 +892,7 @@ to find buttons, etc, on the screen to click on.")
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no tests
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" (assoc-ref %outputs "out")))
#:phases (modify-phases %standard-phases
(delete 'configure)))) ; no configure script
@@ -1071,7 +1071,7 @@ Guile will work for XBindKeys.")
`(#:phases (modify-phases %standard-phases (delete 'configure))
#:tests? #f ; no check target
#:make-flags
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" %output)
;; Keep the documentation where the build system installs LICENSE.
(string-append "DOCPREFIX=" %output
@@ -1184,7 +1184,7 @@ within a single process.")
#:phases (modify-phases %standard-phases (delete 'configure))
#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
"MANDIR=/share/man/man1"
- "CC=gcc")))
+ ,(string-append "CC=" (cc-for-target)))))
(inputs
`(("libxtst" ,libxtst)
("libx11" ,libx11)))
@@ -1553,7 +1553,7 @@ demos. It also acts as a nice screen locker.")
(arguments `(#:make-flags `("bindir=/bin"
"man1dir=/share/man/man1"
,(string-append "DESTDIR=" (assoc-ref %outputs "out"))
- "CC=gcc")
+ ,,(string-append "CC=" (cc-for-target)))
#:phases (modify-phases %standard-phases
(delete 'configure)
(delete 'check))))
@@ -2102,7 +2102,7 @@ to automatically turn it on on login.")
"1br3x9vr6xm4ika06n8cfxx1b3wdchdqvyzjl4y1chmivrml8x9h"))))
(build-system gnu-build-system)
(arguments
- `(#:make-flags (list "CC=gcc")
+ `(#:make-flags (list ,(string-append "CC=" (cc-for-target)))
#:tests? #f ; there are none
#:phases
(modify-phases %standard-phases
@@ -2413,7 +2413,7 @@ Xwrits hides itself until you should take another break.")
(arguments
`(#:scons ,scons-python2
#:scons-flags
- (list "CC=gcc")
+ (list ,(string-append "CC=" (cc-for-target)))
#:phases
(modify-phases %standard-phases
(add-before 'build 'patch-sconstruct
@@ -2768,7 +2768,7 @@ and execute @file{.desktop} files of the Application type.")
`(#:tests? #f
#:make-flags
(list
- "CC=gcc"
+ ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" (assoc-ref %outputs "out")))
#:phases
(modify-phases %standard-phases
--
2.31.1
From f4f07ed5b969cb0407917f86e8f1fd5ddbfb6f3c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 22:08:21 +0200
Subject: [PATCH 07/16] gnu: pgpdump: Use 'cc-for-target'.

* gnu/packages/gnupg.scm
(pgpdump)[arguments]<#:make-flags>: Use 'cc-for-target'.
---
gnu/packages/gnupg.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index bb611bdb89..fefa1e01f1 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -72,6 +72,7 @@
#:use-module (gnu packages xml)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix utils)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system perl)
@@ -996,7 +997,7 @@ them to transform your existing public key into a secret key.")
(arguments
`(#:tests? #f ; no make check
#:configure-flags (list "--prefix=/")
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "DESTDIR=" (assoc-ref %outputs "out")))))
(inputs
`(("zlib" ,zlib)))
--
2.31.1
From ef4eab5e17d8fb1d2d325a1c2e48942db965c9ad Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 22:06:00 +0200
Subject: [PATCH 06/16] gnu: fbida: Use 'cc-for-target'.

* gnu/packages/pdf.scm
(fbida)[arguments]<#:make-flags>: Use 'cc-for-target'.
---
gnu/packages/pdf.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index cbbdf68f5b..2e07fda595 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -1135,7 +1135,7 @@ information for every pixel as the input.")
"0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-FHS-file-names
(lambda _
@@ -1144,7 +1144,7 @@ information for every pixel as the input.")
(("/sbin/ldconfig -p") "echo lib")) #t))
(delete 'configure))
#:tests? #f
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "prefix=" (assoc-ref %outputs "out")))))
(inputs `(("libjpeg" ,libjpeg-turbo)
("curl" ,curl)
--
2.31.1
From c3c52cfa145db74af86cb0f274b81a0ec7b7a586 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 22:04:29 +0200
Subject: [PATCH 05/16] gnu: cd-discid: Use 'cc-for-target'.

* gnu/packages/cdrom.scm
(cd-discid)[arguments]<#:make-flags>: Use 'cc-for-target'.
---
gnu/packages/cdrom.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (18 lines)
diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm
index d93c673ac2..17833f4a48 100644
--- a/gnu/packages/cdrom.scm
+++ b/gnu/packages/cdrom.scm
@@ -599,9 +599,9 @@ the data.")
#t))))
(build-system gnu-build-system)
(arguments
- '(#:tests? #f
+ `(#:tests? #f
#:phases (modify-phases %standard-phases (delete 'configure))
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX="
(assoc-ref %outputs "out")))))
(synopsis "Get CDDB discid information from an audio CD")
--
2.31.1
From 68585d807387da7596420044d0d0a66234c5f6ec Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 21:58:24 +0200
Subject: [PATCH 04/16] gnu: lua: Use 'cc-for-target'.

* gnu/packages/lua.scm
(make-lua-expat, make-lua-ossl, make-lua-sec, make-lua-cqueues)
(make-lua-lgi, lua-resty-signal)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/lua.scm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Toggle diff (60 lines)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 0a1ca19a6f..98f774c428 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -215,7 +215,7 @@ some projects.")))
`(#:make-flags
(let ((out (assoc-ref %outputs "out"))
(lua-version ,(version-major+minor (package-version lua))))
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
(string-append "LUA_LDIR=" out "/share/lua/" lua-version)
(string-append "LUA_CDIR=" out "/lib/lua/" lua-version)))
#:phases
@@ -356,7 +356,7 @@ directory structure and file attributes.")
`(#:make-flags
(let ((out (assoc-ref %outputs "out"))
(lua-api-version ,(version-major+minor (package-version lua))))
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
"CFLAGS='-D HAVE_SYS_SYSCTL_H=0'" ; sys/sysctl.h is deprecated
(string-append "prefix=" out)
(string-append "LUA_APIS=" lua-api-version)))
@@ -417,7 +417,7 @@ binds OpenSSL's bignum, message digest, HMAC, cipher, and CSPRNG interfaces.")
(let ((out (assoc-ref %outputs "out"))
(lua-version ,(version-major+minor (package-version lua))))
(list "linux"
- "CC=gcc"
+ ,(string-append "CC=" (cc-for-target))
"LD=gcc"
(string-append "LUAPATH=" out "/share/lua/" lua-version)
(string-append "LUACPATH=" out "/lib/lua/" lua-version)))
@@ -465,7 +465,7 @@ secure session between the peers.")
#:make-flags
(let ((out (assoc-ref %outputs "out"))
(lua-api-version ,(version-major+minor (package-version lua))))
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
(string-append "LUA_APIS=" lua-api-version)))
#:phases
(modify-phases %standard-phases
@@ -657,7 +657,7 @@ describing the commented declarations and functions.")
(build-system gnu-build-system)
(arguments
`(#:make-flags
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" (assoc-ref %outputs "out")))
#:phases
(modify-phases %standard-phases
@@ -1014,7 +1014,7 @@ on numbers.")
(build-system gnu-build-system)
(arguments
`(#:tests? #f ;TODO: Run the test suite.
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
--
2.31.1
From 4fe4950da0373cd1ef87420eb651f11f70a1d5b8 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 21:54:58 +0200
Subject: [PATCH 03/16] gnu: crypto: Use 'cc-for-target'.

* gnu/packages/crypto.scm
(signify, keyutils, ssss, libscrypt, enchive)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/crypto.scm | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

Toggle diff (54 lines)
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 57d417de80..1c9677ff94 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -214,7 +214,7 @@ communication, encryption, decryption, signatures, etc.")
;; like OpenBSD's pledge().
(arguments
`(#:make-flags
- (list "CC=gcc"
+ (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" (assoc-ref %outputs "out")))
#:phases
(modify-phases %standard-phases
@@ -376,7 +376,7 @@ the wrong hands.")
(arguments
`(#:phases (modify-phases %standard-phases
(delete 'configure)) ; no configure script
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
"RPATH=-Wl,-rpath,$(DESTDIR)$(LIBDIR)"
(string-append "DESTDIR="
(assoc-ref %outputs "out"))
@@ -469,7 +469,7 @@ no man page, refer to the home page for usage details.")
(arguments
`(#:tests? #f ; No test suite
#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
- "CC=gcc")
+ ,(string-append "CC=" (cc-for-target)))
#:phases
(modify-phases %standard-phases
(delete 'configure) ; no configuration to be done
@@ -629,7 +629,7 @@ attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
(outputs (list "out" "static"))
(arguments
`(#:make-flags (list (string-append "PREFIX=" %output)
- "CC=gcc")
+ ,(string-append "CC=" (cc-for-target)))
#:phases
(modify-phases %standard-phases
(delete 'configure) ; no configure script
@@ -1069,8 +1069,9 @@ cannot sign messages in OpenBSD format yet.")
(file-name (git-file-name name version))))
(build-system gnu-build-system)
(arguments
- '(#:tests? #f ; no check target '
- #:make-flags (list "CC=gcc" "PREFIX=$(out)")
+ `(#:tests? #f ; no check target '
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
+ "PREFIX=$(out)")
#:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'install 'post-install
--
2.31.1
From 3871a829e43f74c71be1dddb3ada7f8020cda90c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 21:51:48 +0200
Subject: [PATCH 02/16] gnu: dev86: Use 'cc-for-target'.

* gnu/packages/assembly.scm (dev86)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/assembly.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/assembly.scm b/gnu/packages/assembly.scm
index dbed33bb3d..51c0572674 100644
--- a/gnu/packages/assembly.scm
+++ b/gnu/packages/assembly.scm
@@ -228,7 +228,7 @@ It has macro abilities and focuses on operating system portability.")
(build-system gnu-build-system)
(arguments
`(#:parallel-build? #f ; They use submakes wrong
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX="
(assoc-ref %outputs "out")))
#:system "i686-linux" ; Standalone ld86 had problems otherwise
--
2.31.1
From 688ac40430952dc34bfb239ddf29da366b74b3bc Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Fri, 9 Apr 2021 21:46:24 +0200
Subject: [PATCH 01/16] gnu: irc: Use 'cc-for-target'.

As replacing "CC=gcc" with ,(string-append "CC=" (cc-for-target))
does not change the derivation, this patch will not cause any
rebuilds, except when cross-compiling (but cross-compiling wass
broken anyway). Likewise for the other patches in this series.

* gnu/packages/irc.scm (ii, sic)[arguments]<#:make-flags>:
Use 'cc-for-target'.
---
gnu/packages/irc.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index 5fba72b576..12f50cc523 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -30,6 +30,7 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix build-system cmake)
#:use-module (guix build-system glib-or-gtk)
@@ -341,7 +342,7 @@ for the IRCv3 protocol.")
(arguments
`(#:tests? #f ; no tests
#:make-flags (list (string-append "PREFIX=" %output)
- "CC=gcc")
+ ,(string-append "CC=" (cc-for-target)))
#:phases
(modify-phases %standard-phases
(delete 'configure)))) ; no configure
@@ -365,7 +366,7 @@ for the IRCv3 protocol.")
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no tests
- #:make-flags (list "CC=gcc"
+ #:make-flags (list ,(string-append "CC=" (cc-for-target))
(string-append "PREFIX=" %output))
#:phases
(modify-phases %standard-phases
--
2.31.1
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHHofRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lWzAQC4ECWaq4gI2vOKp3+DFv8vgwf8
LE+JxVAFPhO5oh5xuQEAkJVc+32AUs8wYnMTLp2p9/YAudCFYH/k7xdVM560fg8=
=rhWZ
-----END PGP SIGNATURE-----


T
T
Tobias Geerinckx-Rice wrote on 22 Apr 2021 01:40
(address . 47693@debbugs.gnu.org)
875z0f5hr2.fsf@nckx
Maxime,

Thanks for this series!

I applied it by downloading from the first top-right ‘Download’
link and using ‘git am --patch-format mbox /tmp/47693-0.mbox’. It
works to apply all changes, but combines them all into a single
commit.

If anyone knows how to apply whole mboxes from the archives, as
separate commits, please let me know. I'll push it as soon as I
learn how!

One very minor correction:

Toggle quote (3 lines)
> An exception is xssproxy, which needs to be rebuilt,
> due to nested usage ofquasiquote / unquote.

There are two: ‘nethogs’ is the other.

Both are cheap (C <3 U) leaf packages. I don't think it worth
working around either.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYIC34Q0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW156OEBAL7AiSF7OWqe/rSnxbTPj+SwNpAg8m8I/mqb4+Zm
Pm4/AQDBnhSjL1UWc7gHiA2IAEwVncG8Tr2A+sGTxY+/ZW6QDg==
=uH7J
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 22 Apr 2021 18:44
d11f4ca5ca3b268867a85a62206b97287023390f.camel@telenet.be
Tobias Geerinckx-Rice via Guix-patches via schreef op do 22-04-2021 om 01:40 [+0200]:
Toggle quote (9 lines)
> Maxime,
>
> Thanks for this series!
>
> I applied it by downloading from the first top-right ‘Download’
> link and using ‘git am --patch-format mbox /tmp/47693-0.mbox’. It
> works to apply all changes, but combines them all into a single
> commit.

Can you download each patch separately, say as

download-dir/0001-first.patch
download-dir/0001-second.patch
...

and run "git am download-dir/*.patch"?
Ideally, "git am --patch-format mbox ..." would ‘just work’ though ...

Toggle quote (4 lines)
> If anyone knows how to apply whole mboxes from the archives, as
> separate commits, please let me know. I'll push it as soon as I
> learn how!

Alternatively, you could fetch from my public repo
(branch: cc-for-target, current latest commit: 49ac49daca37f975527f2c2f756f719bd55d47ff,
url: https://notabug.org/mdevos/guix). (You'll need to rebase and sign the commits
yourself instead of doing a mergo, I am not in .guix-authorizations.)

IIRC, I have not yet sent the latest commits to the latest mailing list though,
and it also contains a separate commit ‘lint: Add 'compiler-for-target' checker.’.

Toggle quote (6 lines)
> One very minor correction:
>
> > An exception is xssproxy, which needs to be rebuilt,
> > due to nested usage ofquasiquote / unquote.
>
> There are two: ‘nethogs’ is the other.
Ok.

Toggle quote (2 lines)
> Both are cheap (C <3 U) leaf packages. I don't think it worth
> working around either.
Agreed.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYIGn6xccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pZRAP0cFF5Sj0nSfBqmp7I7PJE3eDSZ
wjsDkSd9C3Id0q4NwgD/VwNXKyJ94CBnTapxQ1geSqM6I51162HT8EQvhkYWGQE=
=9rHW
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 22 Apr 2021 18:51
e691ca6e5873922898055bc64baeea512fe98471.camel@telenet.be
Toggle quote (4 lines)
> Alternatively, you could fetch from my public repo
> (branch: cc-for-target, current latest commit: 49ac49daca37f975527f2c2f756f719bd55d47ff,
> url: https://notabug.org/mdevos/guix).

Oops this should have been
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYIGplhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7g/vAQDYCnWruxl1YN7WbV81mSwCcdqg
bEmn0xa9DlleKi+Z6AEAkn7oLNfZLwJQbTtd6w9fHMUlZzGdY3JHOSsvRpSauQg=
=SHtv
-----END PGP SIGNATURE-----


M
M
Mathieu Othacehe wrote on 8 Jul 2021 16:34
Re: bug#47693: [PATCH]: Use 'cc-for-target'.
(name . Maxime Devos)(address . maximedevos@telenet.be)
871r88x4aq.fsf_-_@gnu.org
Hey,

It appears that this has been pushed, so closing.

Thanks,

Mathieu
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 47693@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 47693
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch