summary refs log tree commit diff
path: root/gnu/packages/avr.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2016-04-14 08:43:56 -0400
committerDavid Thompson <dthompson2@worcester.edu>2016-05-30 13:45:21 -0400
commit09b05fc7e9bdcdcfd2690777e0cd94c2ecd3afab (patch)
treebf27b7995e3e1c25640685310c6a345d636dcce4 /gnu/packages/avr.scm
parentcdc5cfdc4a50c5fda9ec50bfd9477838b8013203 (diff)
downloadguix-09b05fc7e9bdcdcfd2690777e0cd94c2ecd3afab.tar.gz
gnu: Add avr-gcc.
* gnu/packages/avr.scm (avr-gcc): New variable.
Diffstat (limited to 'gnu/packages/avr.scm')
-rw-r--r--gnu/packages/avr.scm30
1 files changed, 30 insertions, 0 deletions
diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index 3276de765b..fd51f074f2 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")