gnu: gcc-arm-none-eabi-7-2018-q2-update: Use G-expressions.

* gnu/packages/embedded.scm (gcc-arm-none-eabi-7-2018-q2-update)[arguments]:
Use G-expressions, just like the xgcc package; also remove trailing #T from
build phases.
This commit is contained in:
Ricardo Wurmus 2023-04-23 16:18:50 +02:00
parent 1b633a4082
commit 178ce335d6
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -310,54 +310,51 @@ (define-public gcc-arm-none-eabi-7-2018-q2-update
(arguments
(substitute-keyword-arguments (package-arguments xgcc)
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'expand-version-string
(lambda _
(make-file-writable "gcc/DEV-PHASE")
(with-output-to-file "gcc/DEV-PHASE"
(lambda ()
(display "7-2018-q2-update")))
#t))
(add-after 'unpack 'fix-genmultilib
(lambda _
(substitute* "gcc/genmultilib"
(("#!/bin/sh") (string-append "#!" (which "sh"))))
#t))
(add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
(lambda* (#:key inputs #:allow-other-keys)
(let ((gcc (assoc-ref inputs "gcc")))
;; Remove the default compiler from CPLUS_INCLUDE_PATH to
;; prevent header conflict with the GCC from native-inputs.
(setenv "CPLUS_INCLUDE_PATH"
(string-join
(delete (string-append gcc "/include/c++")
(string-split (getenv "CPLUS_INCLUDE_PATH")
#\:))
":"))
(format #t
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
(getenv "CPLUS_INCLUDE_PATH"))
#t)))))
#~(modify-phases #$phases
(add-after 'unpack 'expand-version-string
(lambda _
(make-file-writable "gcc/DEV-PHASE")
(with-output-to-file "gcc/DEV-PHASE"
(lambda ()
(display "7-2018-q2-update")))))
(add-after 'unpack 'fix-genmultilib
(lambda _
(substitute* "gcc/genmultilib"
(("#!/bin/sh") (string-append "#!" (which "sh"))))))
(add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
(lambda* (#:key inputs #:allow-other-keys)
(let ((gcc (assoc-ref inputs "gcc")))
;; Remove the default compiler from CPLUS_INCLUDE_PATH to
;; prevent header conflict with the GCC from native-inputs.
(setenv "CPLUS_INCLUDE_PATH"
(string-join
(delete (string-append gcc "/include/c++")
(string-split (getenv "CPLUS_INCLUDE_PATH")
#\:))
":"))
(format #t
"environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
(getenv "CPLUS_INCLUDE_PATH")))))))
((#:configure-flags flags)
;; The configure flags are largely identical to the flags used by the
;; "GCC ARM embedded" project.
`(append (list "--enable-multilib"
"--with-newlib"
"--with-multilib-list=rmprofile"
"--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
"--enable-plugins"
"--disable-decimal-float"
"--disable-libffi"
"--disable-libgomp"
"--disable-libmudflap"
"--disable-libquadmath"
"--disable-libssp"
"--disable-libstdcxx-pch"
"--disable-nls"
"--disable-shared"
"--disable-threads"
"--disable-tls")
(delete "--disable-multilib" ,flags)))))
#~(append (list "--enable-multilib"
"--with-newlib"
"--with-multilib-list=rmprofile"
"--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
"--enable-plugins"
"--disable-decimal-float"
"--disable-libffi"
"--disable-libgomp"
"--disable-libmudflap"
"--disable-libquadmath"
"--disable-libssp"
"--disable-libstdcxx-pch"
"--disable-nls"
"--disable-shared"
"--disable-threads"
"--disable-tls")
(delete "--disable-multilib" #$flags)))))
(native-search-paths
(list (search-path-specification
(variable "CROSS_C_INCLUDE_PATH")