Paste number 313285: wip-avr

Paste number 313285: wip-avr
Pasted by: phant0mas
When:5 years, 7 months ago
Share:Tweet this! | http://paste.lisp.org/+6PQD
Channel:None
Paste contents:
Raw Source | XML | Display As
diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index d59816b..e039807 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -23,10 +23,46 @@
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
+  #:use-module (guix utils)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages vim)
   #:use-module (gnu packages zip))
 
+(define-public avr-binutils
+  (package
+    (inherit (cross-binutils "avr"))
+    (name "avr-binutils")
+    (arguments
+     '(#:configure-flags '("--target=avr"
+                           "--disable-nls")))))
+
+(define-public avr-gcc
+  (package
+    (inherit (cross-gcc "avr" avr-binutils))
+    (name "avr-gcc")
+    (arguments
+     `(,@(substitute-keyword-arguments (package-arguments (cross-gcc "avr" avr-binutils))
+           ((#:phases phases)
+            `(modify-phases ,phases
+               (add-after 'unpack 'fix-genmultilib
+                 (lambda _
+                   (substitute* "gcc/genmultilib"
+                     (("#!/bin/sh") (string-append "#!" (which "sh"))))
+                   #t))))
+           ((#:configure-flags flags)
+            `(cons* "--target=avr"
+                    "--enable-languages=c,c++"
+                    "--disable-nls"
+                    "--with-dwarf2"
+                    (delete "--disable-multilib" ,flags))))))
+    (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")
@@ -44,8 +80,9 @@
      `(#:out-of-source? #t
        #:configure-flags '("--host=avr")))
 
-    (native-inputs `(("cross-binutils" ,(cross-binutils "avr"))
-                     ("cross-gcc" ,xgcc-avr)))
+    (native-inputs `(("avr-binutils" ,avr-binutils)
+                     ("avr-gcc" ,avr-gcc)
+                     ("libc" ,(cross-libc "i686-linux"))))
     (home-page "http://www.nongnu.org/avr-libc/")
     (synopsis "The AVR C Library")
     (description
-- 
2.8.0

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.