From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: [PATCH 2/5] gnu: Add avr-gcc. Date: Thu, 14 Apr 2016 09:17:01 -0400 Message-ID: <1460639824-9976-3-git-send-email-dthompson2@worcester.edu> References: <1460639824-9976-1-git-send-email-dthompson2@worcester.edu> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqh90-0000RZ-8z for guix-devel@gnu.org; Thu, 14 Apr 2016 09:17:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqh8x-0001rn-3P for guix-devel@gnu.org; Thu, 14 Apr 2016 09:17:14 -0400 Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:33729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqh8w-0001ri-VH for guix-devel@gnu.org; Thu, 14 Apr 2016 09:17:11 -0400 Received: by mail-qk0-x236.google.com with SMTP id n63so17708815qkf.0 for ; Thu, 14 Apr 2016 06:17:10 -0700 (PDT) In-Reply-To: <1460639824-9976-1-git-send-email-dthompson2@worcester.edu> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/avr.scm (avr-gcc): New variable. --- gnu/packages/avr.scm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm index b30c64e..0ec115e 100644 --- a/gnu/packages/avr.scm +++ b/gnu/packages/avr.scm @@ -20,6 +20,7 @@ (define-module (gnu packages avr) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) #:use-module (guix download) #:use-module (guix packages) #:use-module (guix build-system gnu) @@ -36,6 +37,36 @@ '(#:configure-flags '("--target=avr" "--disable-nls"))))) +(define-public avr-gcc + (let ((xgcc (cross-gcc "avr" avr-binutils))) + (package + (inherit xgcc) + (name "avr-gcc") + (arguments + (substitute-keyword-arguments (package-arguments xgcc) + ((#:phases phases) + `(modify-phases ,phases + ;; Without a working multilib build, the resulting GCC lacks + ;; support for nearly every AVR chip. + (add-after 'unpack 'fix-genmultilib + (lambda _ + (substitute* "gcc/genmultilib" + (("#!/bin/sh") (string-append "#!" (which "sh")))) + #t)))) + ((#:configure-flags flags) + '(list "--target=avr" + "--enable-languages=c,c++" + "--disable-nls" + "--disable-libssp" + "--with-dwarf2")))) + (native-search-paths + (list (search-path-specification + (variable "CROSS_CPATH") + (files '("avr/include"))) + (search-path-specification + (variable "CROSS_LIBRARY_PATH") + (files '("avr/lib")))))))) + (define-public avr-libc (package (name "avr-libc") -- 2.7.3