diff mbox series

[bug#48767,4/6] gnu: Add msp430-toolchain.

Message ID SN6PR05MB40319CAAE61EBCBA14998A00C5A69@SN6PR05MB4031.namprd05.prod.outlook.com
State New
Headers show
Series [bug#48767,1/6] gnu: Add gcc-msp430-support-files. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Morgan Smith Sept. 26, 2021, 2:51 p.m. UTC
From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/embedded.scm (msp430-toolchain): New variable.
---
 gnu/packages/embedded.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

Comments

M Sept. 26, 2021, 4:08 p.m. UTC | #1
Morgan.J.Smith@outlook.com schreef op zo 26-09-2021 om 10:51 [-0400]:
> From: Morgan Smith <Morgan.J.Smith@outlook.com>
> 
> * gnu/packages/embedded.scm (msp430-toolchain): New variable.
> ---
>  gnu/packages/embedded.scm | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
> index 49f3eda5fb..8401f68542 100644
> --- a/gnu/packages/embedded.scm
> +++ b/gnu/packages/embedded.scm
> @@ -598,6 +598,44 @@ usable on embedded products.")
>      (license (license:non-copyleft
>                "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
>  
> +(define (make-msp430-toolchain xgcc newlib)
> +  "Produce a cross-compiler toolchain package with the compiler XGCC and the C
> +library variant NEWLIB." [...]

There appears to be some duplication with arm-none-eabi-toolchain.
Perhaps arm-none-eabi-toolchain could be extended to support both arm
and msp430?

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 49f3eda5fb..8401f68542 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -598,6 +598,44 @@  usable on embedded products.")
     (license (license:non-copyleft
               "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
 
+(define (make-msp430-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 "msp430-toolchain")
+      (version (package-version xgcc))
+      (source #f)
+      (build-system trivial-build-system)
+      (arguments
+       '(#:modules ((guix build union))
+         #:builder
+         (begin
+           (use-modules (ice-9 match)
+                        (guix build union))
+           (match %build-inputs
+             (((names . directories) ...)
+              (union-build (assoc-ref %outputs "out")
+                           directories)
+              #t)))))
+      (propagated-inputs
+       `(("binutils" ,(cross-binutils "msp430-elf"))
+         ("gcc" ,xgcc)
+         ("gcc-msp430-support-files" ,gcc-msp430-support-files)
+         ("newlib" ,newlib-with-xgcc)))
+      (synopsis "Complete GCC tool chain for MSP430")
+      (description "This package provides a complete GCC tool chain for MSP430.
+This includes the GCC msp430-elf cross compiler and newlib as the C library.
+The supported programming language is C.")
+      (home-page (package-home-page xgcc))
+      (license (package-license xgcc)))))
+
+(define-public msp430-toolchain
+  (make-msp430-toolchain gcc-msp430 newlib-msp430))
+
 (define-public libjaylink
   (package
     (name "libjaylink")