all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#48767] [PATCH 2/6] gnu: Add gcc-msp430.
       [not found] <20210926145155.966-1-Morgan.J.Smith@outlook.com>
@ 2021-09-26 14:51 ` Morgan.J.Smith
  2021-09-26 15:51   ` Maxime Devos
  2021-09-26 14:51 ` [bug#48767] [PATCH 3/6] gnu: Add newlib-msp430 Morgan.J.Smith
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Morgan.J.Smith @ 2021-09-26 14:51 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/embedded.scm (gcc-msp430): New variable.
---
 gnu/packages/bootstrap.scm |  1 +
 gnu/packages/embedded.scm  | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index c598cedc0a..54a028e977 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -311,6 +311,7 @@ or false to signal an error."
         ((string=? system "arm-eabi") "no-ld.so")
         ((string=? system "xtensa-elf") "no-ld.so")
         ((string=? system "avr") "no-ld.so")
+        ((string=? system "msp430-elf") "no-ld.so")
         ((string=? system "propeller-elf") "no-ld.so")
         ((string=? system "i686-mingw") "no-ld.so")
         ((string=? system "x86_64-mingw") "no-ld.so")
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index f1f17e83a7..7073168b57 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -530,6 +530,39 @@ languages are C and C++.")
      `(("unzip" ,unzip)))
     (license license:bsd-3)))
 
+(define-public gcc-msp430
+  (let ((xgcc (cross-gcc "msp430-elf"
+                         #:xgcc gcc-9
+                         #:xbinutils (cross-binutils "msp430-elf"))))
+    (package
+      (inherit xgcc)
+      (name "gcc-msp430")
+      (arguments
+       (substitute-keyword-arguments (package-arguments xgcc)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
+               (lambda* (#:key inputs #:allow-other-keys)
+                 (let ((gcc (assoc-ref inputs  "gcc")))
+                   ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
+                   ;; prevent header conflict with the GCC from native-inputs.
+                   (setenv "CPLUS_INCLUDE_PATH"
+                           (string-join
+                            (delete (string-append gcc "/include/c++")
+                                    (string-split (getenv "CPLUS_INCLUDE_PATH")
+                                                  #\:))
+                            ":"))
+                   (format #t
+                           "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+                           (getenv "CPLUS_INCLUDE_PATH")))))))))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "CROSS_C_INCLUDE_PATH")
+              (files '("msp430-elf/include")))
+             (search-path-specification
+              (variable "CROSS_LIBRARY_PATH")
+              (files '("msp430-elf/lib"))))))))
+
 (define-public libjaylink
   (package
     (name "libjaylink")
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 3/6] gnu: Add newlib-msp430.
       [not found] <20210926145155.966-1-Morgan.J.Smith@outlook.com>
  2021-09-26 14:51 ` [bug#48767] [PATCH 2/6] gnu: Add gcc-msp430 Morgan.J.Smith
@ 2021-09-26 14:51 ` Morgan.J.Smith
  2021-09-26 16:04   ` Maxime Devos
  2021-09-26 14:51 ` [bug#48767] [PATCH 4/6] gnu: Add msp430-toolchain Morgan.J.Smith
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Morgan.J.Smith @ 2021-09-26 14:51 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

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

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 7073168b57..49f3eda5fb 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -563,6 +563,41 @@ languages are C and C++.")
               (variable "CROSS_LIBRARY_PATH")
               (files '("msp430-elf/lib"))))))))
 
+(define-public newlib-msp430
+  (package
+    (name "newlib")
+    (version "2.4.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "ftp://sourceware.org/pub/newlib/newlib-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "01i7qllwicf05vsvh39qj7qp5fdifpvvky0x95hjq39mbqiksnsl"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:out-of-source? #t
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-references-to-/bin/sh
+           (lambda _
+             (substitute* '("libgloss/msp430/Makefile.in"
+                            "libgloss/libnosys/Makefile.in"
+                            "libgloss/Makefile.in")
+               (("/bin/sh") (which "sh"))))))
+       #:configure-flags '("--target=msp430-elf")))
+    (native-inputs
+     `(("xbinutils" ,(cross-binutils "msp430-elf"))
+       ("xgcc" ,gcc-msp430)
+       ("texinfo" ,texinfo)))
+    (home-page "https://www.sourceware.org/newlib/")
+    (synopsis "C library for use on embedded systems")
+    (description "Newlib is a C library intended for use on embedded
+systems.  It is a conglomeration of several library parts that are easily
+usable on embedded products.")
+    (license (license:non-copyleft
+              "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
+
 (define-public libjaylink
   (package
     (name "libjaylink")
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 4/6] gnu: Add msp430-toolchain.
       [not found] <20210926145155.966-1-Morgan.J.Smith@outlook.com>
  2021-09-26 14:51 ` [bug#48767] [PATCH 2/6] gnu: Add gcc-msp430 Morgan.J.Smith
  2021-09-26 14:51 ` [bug#48767] [PATCH 3/6] gnu: Add newlib-msp430 Morgan.J.Smith
@ 2021-09-26 14:51 ` Morgan.J.Smith
  2021-09-26 16:08   ` Maxime Devos
  2021-09-26 14:51 ` [bug#48767] [PATCH 5/6] gnu: Add gdb-msp430 Morgan.J.Smith
  2021-09-26 14:51 ` [bug#48767] [PATCH 6/6] gnu: Add msp430lib Morgan.J.Smith
  4 siblings, 1 reply; 10+ messages in thread
From: Morgan.J.Smith @ 2021-09-26 14:51 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

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."
+  (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")
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 5/6] gnu: Add gdb-msp430.
       [not found] <20210926145155.966-1-Morgan.J.Smith@outlook.com>
                   ` (2 preceding siblings ...)
  2021-09-26 14:51 ` [bug#48767] [PATCH 4/6] gnu: Add msp430-toolchain Morgan.J.Smith
@ 2021-09-26 14:51 ` Morgan.J.Smith
  2021-09-26 16:16   ` Maxime Devos
  2021-09-26 14:51 ` [bug#48767] [PATCH 6/6] gnu: Add msp430lib Morgan.J.Smith
  4 siblings, 1 reply; 10+ messages in thread
From: Morgan.J.Smith @ 2021-09-26 14:51 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

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

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 8401f68542..f79092de72 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -636,6 +636,17 @@ The supported programming language is C.")
 (define-public msp430-toolchain
   (make-msp430-toolchain gcc-msp430 newlib-msp430))
 
+(define-public gdb-msp430
+  (package
+    (inherit gdb)
+    (name "gdb-msp430")
+    (arguments
+     `(#:configure-flags '("--target=msp430-elf"
+                           "--enable-languages=c,c++"
+                           "--disable-nls"
+                           "--enable-initfini-array")
+       ,@(package-arguments gdb)))))
+
 (define-public libjaylink
   (package
     (name "libjaylink")
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 6/6] gnu: Add msp430lib.
       [not found] <20210926145155.966-1-Morgan.J.Smith@outlook.com>
                   ` (3 preceding siblings ...)
  2021-09-26 14:51 ` [bug#48767] [PATCH 5/6] gnu: Add gdb-msp430 Morgan.J.Smith
@ 2021-09-26 14:51 ` Morgan.J.Smith
  2021-09-26 16:31   ` Maxime Devos
  4 siblings, 1 reply; 10+ messages in thread
From: Morgan.J.Smith @ 2021-09-26 14:51 UTC (permalink / raw)
  To: 48767; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/debug.scm (msp430lib): New variable.
---
 gnu/packages/debug.scm | 57 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
index 7363d45c43..263a72e5ce 100644
--- a/gnu/packages/debug.scm
+++ b/gnu/packages/debug.scm
@@ -36,6 +36,7 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
@@ -789,3 +790,59 @@ debugger with support for programming, disassembly and reverse
 engineering.")
     (home-page "https://github.com/dlbeer/mspdebug")
     (license license:gpl2+)))
+
+(define (version-with-underscores version)
+  (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))
+
+(define-public msp430lib
+  (package
+    (name "msp430lib")
+    (version "3.15.1.1")
+    (source (origin
+              (method url-fetch/zipbomb)
+              (uri (string-append
+                    "https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPDS/"
+                    (version-with-underscores (version-major+minor+point version))
+                    "_001/export/MSPDebugStack_OS_Package_"
+                    (version-with-underscores version) ".zip"))
+              (sha256
+               (base32
+                "1j5sljqwc20zrb50mrji4mnmw5i680qc7n0lb0pakrrxqjc9m9g3"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (list
+        (string-append "BOOST_DIR=" (assoc-ref %build-inputs "boost"))
+        (string-append "HIDOBJ=-I" (assoc-ref %build-inputs "hidapi") "/include/hidapi"
+                       " -lhidapi-libusb"))
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before 'build 'fix-hidapi-includes
+           (lambda _
+             (substitute*
+                 '("ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.h"
+                   "DLL430_v3/src/TI/DLL430/HidUpdateManager.cpp")
+               (("hidapi.h") "hidapi/hidapi.h"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "libmsp430.so"
+                           (string-append (assoc-ref outputs "out") "/lib")))))))
+    (inputs
+     `(("boost" ,boost)
+       ("hidapi" ,hidapi)
+       ("libusb" ,libusb)))
+    (native-search-paths
+     (list (search-path-specification
+            ;; Used by mspdebug. mspdebug has a few different drivers it can
+            ;; use to interact with MSP430's so this is an optional dependency
+            (variable "MSPDEBUG_TILIB_PATH")
+            (files '("lib")))))
+    (home-page "https://www.ti.com/tool/MSPDS")
+    (synopsis "Library used to program and debug MSP430 microcontrollers")
+    (description "This library facilitates communication between a host computer and certain
+MSP430 debuggers.  It is also know as @acronym{MSPDS, MSP430 Debug Stack}.
+This is an optional dependency of mspdebug (which calls this library
+@code{tilib})")
+    (license license:bsd-3)))
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 2/6] gnu: Add gcc-msp430.
  2021-09-26 14:51 ` [bug#48767] [PATCH 2/6] gnu: Add gcc-msp430 Morgan.J.Smith
@ 2021-09-26 15:51   ` Maxime Devos
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Devos @ 2021-09-26 15:51 UTC (permalink / raw)
  To: Morgan.J.Smith, 48767

[-- Attachment #1: Type: text/plain, Size: 3180 bytes --]

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 (gcc-msp430): New variable.
> ---
>  gnu/packages/bootstrap.scm |  1 +
>  gnu/packages/embedded.scm  | 33 +++++++++++++++++++++++++++++++++
>  2 files changed, 34 insertions(+)
> 
> diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
> index c598cedc0a..54a028e977 100644
> --- a/gnu/packages/bootstrap.scm
> +++ b/gnu/packages/bootstrap.scm
> @@ -311,6 +311,7 @@ or false to signal an error."
>          ((string=? system "arm-eabi") "no-ld.so")
>          ((string=? system "xtensa-elf") "no-ld.so")
>          ((string=? system "avr") "no-ld.so")
> +        ((string=? system "msp430-elf") "no-ld.so")
>          ((string=? system "propeller-elf") "no-ld.so")
>          ((string=? system "i686-mingw") "no-ld.so")
>          ((string=? system "x86_64-mingw") "no-ld.so")
> diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
> index f1f17e83a7..7073168b57 100644
> --- a/gnu/packages/embedded.scm
> +++ b/gnu/packages/embedded.scm
> @@ -530,6 +530,39 @@ languages are C and C++.")
>       `(("unzip" ,unzip)))
>      (license license:bsd-3)))
>  
> +(define-public gcc-msp430
> +  (let ((xgcc (cross-gcc "msp430-elf"
> +                         #:xgcc gcc-9
> +                         #:xbinutils (cross-binutils "msp430-elf"))))
> +    (package
> +      (inherit xgcc)
> +      (name "gcc-msp430")
> +      (arguments
> +       (substitute-keyword-arguments (package-arguments xgcc)
> +         ((#:phases phases)
> +          `(modify-phases ,phases
> +             (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
> +               (lambda* (#:key inputs #:allow-other-keys)
> +                 (let ((gcc (assoc-ref inputs  "gcc")))
> +                   ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
> +                   ;; prevent header conflict with the GCC from native-inputs.
> +                   (setenv "CPLUS_INCLUDE_PATH"
> +                           (string-join
> +                            (delete (string-append gcc "/include/c++")
> +                                    (string-split (getenv "CPLUS_INCLUDE_PATH")
> +                                                  #\:))
> +                            ":"))
> +                   (format #t
> +                           "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
> +                           (getenv "CPLUS_INCLUDE_PATH")))))))))
> +      (native-search-paths

Shouldn't these be 'search-paths' instead of 'native-search-paths',
as "gcc-msp430" is a cross-compiler?  (I know other GCC cross-compiler
packages in (gnu packages embedded) are using native-search-paths as well,
but I don't understand why.)

> +       (list (search-path-specification
> +              (variable "CROSS_C_INCLUDE_PATH")
> +              (files '("msp430-elf/include")))
> +             (search-path-specification
> +              (variable "CROSS_LIBRARY_PATH")
> +              (files '("msp430-elf/lib"))))))))

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 3/6] gnu: Add newlib-msp430.
  2021-09-26 14:51 ` [bug#48767] [PATCH 3/6] gnu: Add newlib-msp430 Morgan.J.Smith
@ 2021-09-26 16:04   ` Maxime Devos
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Devos @ 2021-09-26 16:04 UTC (permalink / raw)
  To: Morgan.J.Smith, 48767

[-- Attachment #1: Type: text/plain, Size: 2439 bytes --]

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 (newlib-msp430): New variable.
> ---
>  gnu/packages/embedded.scm | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
> index 7073168b57..49f3eda5fb 100644
> --- a/gnu/packages/embedded.scm
> +++ b/gnu/packages/embedded.scm
> @@ -563,6 +563,41 @@ languages are C and C++.")
>                (variable "CROSS_LIBRARY_PATH")
>                (files '("msp430-elf/lib"))))))))
>  
> +(define-public newlib-msp430
> +  (package
> +    (name "newlib")
> +    (version "2.4.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "ftp://sourceware.org/pub/newlib/newlib-"
> +                                  version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "01i7qllwicf05vsvh39qj7qp5fdifpvvky0x95hjq39mbqiksnsl"))))
> +    (build-system gnu-build-system)

There already is a newlib package: newlib-arm-none-eabi.
Could you use (package (inherit "newlib-msp430") ...) to reduce duplication?
Also, could you
  
   (a) change the name to, say, "newlib-msp430"
or (b) instead of defining a new "newlib" package, keep a single newlib package
and make the architecture-dependent tweaks depend on (%current-target-system)?

such that "newlib@2.4.0" is an unambigious specification (or, at least, not
more ambigious than it was before), usable for "specification->package"?

> +    (arguments
> +     `(#:out-of-source? #t
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'fix-references-to-/bin/sh
> +           (lambda _
> +             (substitute* '("libgloss/msp430/Makefile.in"
> +                            "libgloss/libnosys/Makefile.in"
> +                            "libgloss/Makefile.in")
> +               (("/bin/sh") (which "sh"))))))

This duplication can be removed by inheriting from 'newlib-arm-none-eabi'.

> +       #:configure-flags '("--target=msp430-elf")))

I'd suggest adding #:target "msp430-elf" to 'arguments' instead
of setting #:configure-flags directly.  That way, guix knows we are
cross-compiling and won't try to run tests and won't try to
run 'ldconfig'.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 4/6] gnu: Add msp430-toolchain.
  2021-09-26 14:51 ` [bug#48767] [PATCH 4/6] gnu: Add msp430-toolchain Morgan.J.Smith
@ 2021-09-26 16:08   ` Maxime Devos
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Devos @ 2021-09-26 16:08 UTC (permalink / raw)
  To: Morgan.J.Smith, 48767

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 5/6] gnu: Add gdb-msp430.
  2021-09-26 14:51 ` [bug#48767] [PATCH 5/6] gnu: Add gdb-msp430 Morgan.J.Smith
@ 2021-09-26 16:16   ` Maxime Devos
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Devos @ 2021-09-26 16:16 UTC (permalink / raw)
  To: Morgan.J.Smith, 48767

[-- Attachment #1: Type: text/plain, Size: 1824 bytes --]

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 (gdb-msp430): New variable.
> ---
>  gnu/packages/embedded.scm | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
> index 8401f68542..f79092de72 100644
> --- a/gnu/packages/embedded.scm
> +++ b/gnu/packages/embedded.scm
> @@ -636,6 +636,17 @@ The supported programming language is C.")
>  (define-public msp430-toolchain
>    (make-msp430-toolchain gcc-msp430 newlib-msp430))
>  
> +(define-public gdb-msp430
> +  (package
> +    (inherit gdb)
> +    (name "gdb-msp430")
> +    (arguments
> +     `(#:configure-flags '("--target=msp430-elf"
> +                           "--enable-languages=c,c++"
> +                           "--disable-nls"
> +                           "--enable-initfini-array")
> +       ,@(package-arguments gdb)))))

It would be more future-proof to use 'substitute-keyword-arguments' here,
as possibly a future package definition of 'gdb' could set #:configure-flags.

It would also be nice to adjust the description and synopsis a bit.
Maybe something like

 (synopsis "The GNU debugger for remotely debugging msp430 systems")
 (description "This is the GNU debugger, configured for debugging msp430 systems
from a system of another architecture.")

and add to the description of 'gdb' something like

 "This variant of the GNU debugger only supports debugging programs compiled for
the same architecture as the GNU debugger runs on.  For remote debugging, the
variants @code{gdb-msp430} or @code{gdb-arm-none-eabi} may be required."

(Assuming that's correct.)  (These descriptions could be improved.)

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [bug#48767] [PATCH 6/6] gnu: Add msp430lib.
  2021-09-26 14:51 ` [bug#48767] [PATCH 6/6] gnu: Add msp430lib Morgan.J.Smith
@ 2021-09-26 16:31   ` Maxime Devos
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Devos @ 2021-09-26 16:31 UTC (permalink / raw)
  To: Morgan.J.Smith, 48767

[-- Attachment #1: Type: text/plain, Size: 4433 bytes --]

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/debug.scm (msp430lib): New variable.
> ---
>  gnu/packages/debug.scm | 57 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
> 
> diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm
> index 7363d45c43..263a72e5ce 100644
> --- a/gnu/packages/debug.scm
> +++ b/gnu/packages/debug.scm
> @@ -36,6 +36,7 @@
>    #:use-module (gnu packages autotools)
>    #:use-module (gnu packages base)
>    #:use-module (gnu packages bash)
> +  #:use-module (gnu packages boost)
>    #:use-module (gnu packages bison)
>    #:use-module (gnu packages c)
>    #:use-module (gnu packages check)
> @@ -789,3 +790,59 @@ debugger with support for programming, disassembly and reverse
>  engineering.")
>      (home-page "https://github.com/dlbeer/mspdebug")
>      (license license:gpl2+)))
> +
> +(define (version-with-underscores version)
> +  (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))
> +
> +(define-public msp430lib
> +  (package
> +    (name "msp430lib")
> +    (version "3.15.1.1")
> +    (source (origin
> +              (method url-fetch/zipbomb)
> +              (uri (string-append
> +                    "https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPDS/"
> +                    (version-with-underscores (version-major+minor+point version))
> +                    "_001/export/MSPDebugStack_OS_Package_"
> +                    (version-with-underscores version) ".zip"))
> +              (sha256
> +               (base32
> +                "1j5sljqwc20zrb50mrji4mnmw5i680qc7n0lb0pakrrxqjc9m9g3"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:make-flags
> +       (list
> +        (string-append "BOOST_DIR=" (assoc-ref %build-inputs "boost"))
> +        (string-append "HIDOBJ=-I" (assoc-ref %build-inputs "hidapi") "/include/hidapi"
> +                       " -lhidapi-libusb"))
> +       #:tests? #f
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (add-before 'build 'fix-hidapi-includes
> +           (lambda _
> +             (substitute*
> +                 '("ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceUSB.h"
> +                   "DLL430_v3/src/TI/DLL430/HidUpdateManager.cpp")
> +               (("hidapi.h") "hidapi/hidapi.h"))))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (install-file "libmsp430.so"
> +                           (string-append (assoc-ref outputs "out") "/lib")))))))
> +    (inputs
> +     `(("boost" ,boost)
> +       ("hidapi" ,hidapi)
> +       ("libusb" ,libusb)))
> +    (native-search-paths
> +     (list (search-path-specification
> +            ;; Used by mspdebug. mspdebug has a few different drivers it can
> +            ;; use to interact with MSP430's so this is an optional dependency
> +            (variable "MSPDEBUG_TILIB_PATH")
> +            (files '("lib")))))
> +    (home-page "https://www.ti.com/tool/MSPDS")
> +    (synopsis "Library used to program and debug MSP430 microcontrollers")
> +    (description "This library facilitates communication between a host computer and certain
> +MSP430 debuggers.  It is also know as @acronym{MSPDS, MSP430 Debug Stack}.
> +This is an optional dependency of mspdebug (which calls this library
> +@code{tilib})")
> +    (license license:bsd-3)))

I downloaded the ZIP and opened MSPDebugStackOpenSourcePackage_manifest.html, and noted:

[...] No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any [...]

which isn't BSD-3, and isn't free software.  I also see BSD-3 in that file.
We would need to carefully check what conditions apply to the parts of MSPDS that
are used here, and remove the non-free components.

I noticed PLATFORM := $(shell uname -s) and ifeq ($(PLATFORM),Linux) in a Makefile.
I expect that won't work on the Hurd.  Maybe make that unconditional.  I also noticed
CXX:=g++.  Possibly some substitutions or (setenv "CXX" (cxx-for-target)) are required
to make the package cross-compilable.

There is a blob in Bios/include/UifBiosCore.h.  Possibly it can simply be removed.

Greetings,
Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-09-26 16:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210926145155.966-1-Morgan.J.Smith@outlook.com>
2021-09-26 14:51 ` [bug#48767] [PATCH 2/6] gnu: Add gcc-msp430 Morgan.J.Smith
2021-09-26 15:51   ` Maxime Devos
2021-09-26 14:51 ` [bug#48767] [PATCH 3/6] gnu: Add newlib-msp430 Morgan.J.Smith
2021-09-26 16:04   ` Maxime Devos
2021-09-26 14:51 ` [bug#48767] [PATCH 4/6] gnu: Add msp430-toolchain Morgan.J.Smith
2021-09-26 16:08   ` Maxime Devos
2021-09-26 14:51 ` [bug#48767] [PATCH 5/6] gnu: Add gdb-msp430 Morgan.J.Smith
2021-09-26 16:16   ` Maxime Devos
2021-09-26 14:51 ` [bug#48767] [PATCH 6/6] gnu: Add msp430lib Morgan.J.Smith
2021-09-26 16:31   ` Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.