gnu: Add arm-none-eabi-toolchain variants.

* gnu/packages/embedded.scm (arm-none-eabi-toolchain): New procedure.
(arm-none-eabi-toolchain-4.9, arm-none-eabi-nano-toolchain-4.9,
arm-none-eabi-toolchain-6, arm-none-eabi-nano-toolchain-6): New
variables.

Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
This commit is contained in:
Theodoros Foradis 2016-10-16 11:27:21 +02:00 committed by Ricardo Wurmus
parent dbc3c34ea0
commit 569f601649
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 47 additions and 0 deletions

View File

@ -25,6 +25,8 @@
#: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)
@ -176,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))