guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/07: gnu: Add avr-gcc.


From: David Thompson
Subject: 02/07: gnu: Add avr-gcc.
Date: Mon, 30 May 2016 17:46:43 +0000 (UTC)

davexunit pushed a commit to branch master
in repository guix.

commit 09b05fc7e9bdcdcfd2690777e0cd94c2ecd3afab
Author: David Thompson <address@hidden>
Date:   Thu Apr 14 08:43:56 2016 -0400

    gnu: Add avr-gcc.
    
    * gnu/packages/avr.scm (avr-gcc): New variable.
---
 gnu/packages/avr.scm |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index 3276de7..fd51f07 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)
@@ -33,6 +34,35 @@
     (inherit (cross-binutils "avr"))
     (name "avr-binutils")))
 
+(define-public avr-gcc-4.9
+  (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 _
+                 ;; 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))))
+         ((#:configure-flags flags)
+          `(delete "--disable-multilib" ,flags))))
+      (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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]