summary refs log tree commit diff
path: root/gnu/packages/embedded.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-10-17 16:47:12 -0400
committerMark H Weaver <mhw@netris.org>2016-10-17 16:47:12 -0400
commitdcaf70897a0bad38a4638a2905aaa3c46b1f1402 (patch)
tree439c42bf27972a628ebc0fef11a63b9130ca19a5 /gnu/packages/embedded.scm
parentbf62b8ff79f9d60136996b8251b6475965cf4994 (diff)
parent040b6299d505c034b4960c335434a500ae2f8187 (diff)
downloadguix-dcaf70897a0bad38a4638a2905aaa3c46b1f1402.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/embedded.scm')
-rw-r--r--gnu/packages/embedded.scm60
1 files changed, 60 insertions, 0 deletions
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 24eeef9fa7..a7af69f609 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,9 +25,12 @@
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
+  #:use-module (guix build utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages texinfo))
 
@@ -97,6 +101,17 @@
               (variable "CROSS_LIBRARY_PATH")
               (files '("arm-none-eabi/lib"))))))))
 
+(define-public gcc-arm-none-eabi-6
+  (package
+    (inherit gcc-arm-none-eabi-4.9)
+    (version (package-version gcc-6))
+    (source (origin (inherit (package-source gcc-6))
+                    (patches
+                     (append
+                      (origin-patches (package-source gcc-6))
+                      (search-patches "gcc-6-cross-environment-variables.patch"
+                                      "gcc-6-arm-none-eabi-multilib.patch")))))))
+
 (define-public newlib-arm-none-eabi
   (package
     (name "newlib")
@@ -163,3 +178,48 @@ usable on embedded products.")
            "--enable-newlib-nano-formatted-io"
            "--disable-nls"))))
     (synopsis "Newlib variant for small systems with limited memory")))
+
+(define (arm-none-eabi-toolchain xgcc newlib)
+  "Produce a cross-compiler toolchain package with the compiler XGCC and the C
+library variant NEWLIB."
+  (let ((newlib-with-xgcc (package (inherit newlib)
+                            (native-inputs
+                             (alist-replace "xgcc" (list xgcc)
+                                            (package-native-inputs newlib))))))
+    (package
+      (name (string-append "arm-none-eabi"
+                           (if (string=? (package-name newlib-with-xgcc)
+                                         "newlib-nano")
+                               "-nano" "")
+                           "-toolchain"))
+      (version (package-version xgcc))
+      (source #f)
+      (build-system trivial-build-system)
+      (arguments '(#:builder (mkdir %output)))
+      (propagated-inputs
+       `(("binutils" ,(cross-binutils "arm-none-eabi"))
+         ("gcc" ,xgcc)
+         ("newlib" ,newlib-with-xgcc)))
+      (synopsis "Complete GCC tool chain for ARM bare metal development")
+      (description "This package provides a complete GCC tool chain for ARM
+bare metal development.  This includes the GCC arm-none-eabi cross compiler
+and newlib (or newlib-nano) as the C library.  The supported programming
+languages are C and C++.")
+      (home-page (package-home-page xgcc))
+      (license (package-license xgcc)))))
+
+(define-public arm-none-eabi-toolchain-4.9
+  (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
+                           newlib-arm-none-eabi))
+
+(define-public arm-none-eabi-nano-toolchain-4.9
+  (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
+                           newlib-nano-arm-none-eabi))
+
+(define-public arm-none-eabi-toolchain-6
+  (arm-none-eabi-toolchain gcc-arm-none-eabi-6
+                           newlib-arm-none-eabi))
+
+(define-public arm-none-eabi-nano-toolchain-6
+  (arm-none-eabi-toolchain gcc-arm-none-eabi-6
+                           newlib-nano-arm-none-eabi))