From 51b8385acd6f7de668a994fe0523b3861240cd1a Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 6 Apr 2023 19:11:33 +0200 Subject: [PATCH] gnu: avr-gcc: Use G-expression. This is necessary because the GCC package uses G-expressions, so any inheriting package that modifies build phases must also use them. * gnu/packages/avr.scm (avr-gcc)[arguments]: Replace quasiquoting with G-expression; remove trailing #T from build phases. --- gnu/packages/avr.scm | 55 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm index a741f183d7..44d6e0ebbb 100644 --- a/gnu/packages/avr.scm +++ b/gnu/packages/avr.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2016 Manolis Fragkiskos Ragkousis -;;; Copyright © 2015, 2017 Ricardo Wurmus +;;; Copyright © 2015, 2017, 2023 Ricardo Wurmus ;;; Copyright © 2016 David Thompson ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice @@ -24,6 +24,7 @@ (define-module (gnu packages avr) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix gexp) #:use-module (guix utils) #:use-module (guix download) #:use-module (guix git-download) @@ -52,34 +53,32 @@ (arguments (substitute-keyword-arguments (package-arguments xgcc) ((#:phases phases) - `(modify-phases ,phases - (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))) - ;; Without a working multilib build, the resulting GCC lacks - ;; support for nearly every AVR chip. - (add-after 'unpack 'fix-genmultilib - (lambda _ - ;; patch-shebang doesn't work here because there are actually - ;; several scripts inside this script, each with a #!/bin/sh - ;; that needs patching. - (substitute* "gcc/genmultilib" - (("#!/bin/sh") (string-append "#!" (which "sh")))) - #t)))) + #~(modify-phases #$phases + (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"))))) + ;; Without a working multilib build, the resulting GCC lacks + ;; support for nearly every AVR chip. + (add-after 'unpack 'fix-genmultilib + (lambda _ + ;; patch-shebang doesn't work here because there are actually + ;; several scripts inside this script, each with a #!/bin/sh + ;; that needs patching. + (substitute* "gcc/genmultilib" + (("#!/bin/sh") (string-append "#!" (which "sh")))))))) ((#:configure-flags flags) - `(delete "--disable-multilib" ,flags)))) + #~(delete "--disable-multilib" #$flags)))) (native-search-paths (list (search-path-specification (variable "CROSS_C_INCLUDE_PATH")