gnu: magic-wormhole-transit-relay: Update to 0.2.1.
[jackhill/guix/guix.git] / gnu / packages / embedded.scm
index 429eac3..131a928 100644 (file)
@@ -2,9 +2,9 @@
 ;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
-;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,8 +30,9 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
-  #:use-module (guix build utils)
+  #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module ((gnu packages base) #:prefix base:)
@@ -47,6 +48,7 @@
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages xorg)
      `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
        ("xgcc" ,gcc-arm-none-eabi-4.9)
        ("texinfo" ,texinfo)))
-    (home-page "http://www.sourceware.org/newlib/")
+    (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
@@ -205,6 +207,124 @@ usable on embedded products.")
            "--disable-nls"))))
     (synopsis "Newlib variant for small systems with limited memory")))
 
+\f
+;;; The following definitions are for the "7-2018-q2-update" variant of the
+;;; ARM cross toolchain as offered on https://developer.arm.com
+(define-public gcc-arm-none-eabi-7-2018-q2-update
+  (let ((xgcc (cross-gcc "arm-none-eabi"
+                         #:xgcc gcc-7
+                         #:xbinutils (cross-binutils "arm-none-eabi")))
+        (revision "1")
+        (svn-revision 261907))
+    (package (inherit xgcc)
+      (version (string-append "7-2018-q2-update-"
+                              revision "." (number->string svn-revision)))
+      (source
+       (origin
+         (method svn-fetch)
+         (uri (svn-reference
+               (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch/")
+               (revision svn-revision)))
+         (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
+         (sha256
+          (base32
+           "192ggs63bixf3irpijgfkjks73yx1r3a4i6grk1y0i0iny76pmx5"))
+         (patches
+          (append
+           (origin-patches (package-source gcc-7))
+           (search-patches "gcc-7-cross-environment-variables.patch")))))
+      (native-inputs
+       `(("gcc" ,gcc-5)
+         ("flex" ,flex)
+         ("isl" ,isl-0.18)
+         ,@(alist-delete "isl" (package-native-inputs xgcc))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments xgcc)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-after 'unpack 'expand-version-string
+               (lambda _
+                 (make-file-writable "gcc/DEV-PHASE")
+                 (with-output-to-file "gcc/DEV-PHASE"
+                   (lambda ()
+                     (display "7-2018-q2-update")))
+                 #t))
+             (add-after 'unpack 'fix-genmultilib
+               (lambda _
+                 (substitute* "gcc/genmultilib"
+                   (("#!/bin/sh") (string-append "#!" (which "sh"))))
+                 #t))))
+         ((#:configure-flags flags)
+          ;; The configure flags are largely identical to the flags used by the
+          ;; "GCC ARM embedded" project.
+          `(append (list "--enable-multilib"
+                         "--with-newlib"
+                         "--with-multilib-list=rmprofile"
+                         "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
+                         "--enable-plugins"
+                         "--disable-decimal-float"
+                         "--disable-libffi"
+                         "--disable-libgomp"
+                         "--disable-libmudflap"
+                         "--disable-libquadmath"
+                         "--disable-libssp"
+                         "--disable-libstdcxx-pch"
+                         "--disable-nls"
+                         "--disable-shared"
+                         "--disable-threads"
+                         "--disable-tls")
+                   (delete "--disable-multilib" ,flags)))))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "CROSS_C_INCLUDE_PATH")
+              (files '("arm-none-eabi/include")))
+             (search-path-specification
+              (variable "CROSS_CPLUS_INCLUDE_PATH")
+              (files '("arm-none-eabi/include")))
+             (search-path-specification
+              (variable "CROSS_LIBRARY_PATH")
+              (files '("arm-none-eabi/lib"))))))))
+
+(define-public newlib-arm-none-eabi-7-2018-q2-update
+  ;; This is the same commit as used for the 7-2018-q2-update release
+  ;; according to the release.txt.
+  (let ((commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4")
+        (revision "0"))
+    (package
+      (inherit newlib-arm-none-eabi)
+      (version (git-version "3.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "http://sourceware.org/git/newlib-cygwin.git")
+               (commit commit)))
+         (file-name (git-file-name "newlib" commit))
+         (sha256
+          (base32
+           "1dq23fqrk75g1a4v7569fvnnw5q440zawbxi3w0g05n8jlqsmvcy"))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi)
+         ;; The configure flags are identical to the flags used by the "GCC ARM
+         ;; embedded" project.
+         ((#:configure-flags flags)
+          `(cons* "--enable-newlib-io-c99-formats"
+                  "--enable-newlib-retargetable-locking"
+                  "--with-headers=yes"
+                  ,flags))))
+      (native-inputs
+       `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
+         ("xgcc" ,gcc-arm-none-eabi-7-2018-q2-update)
+         ("texinfo" ,texinfo))))))
+
+(define-public newlib-nano-arm-none-eabi-7-2018-q2-update
+  (package (inherit newlib-arm-none-eabi-7-2018-q2-update)
+    (name "newlib-nano")
+    (arguments
+     (package-arguments newlib-nano-arm-none-eabi))
+    (synopsis "Newlib variant for small systems with limited memory")))
+
+\f
 (define (make-libstdc++-arm-none-eabi xgcc newlib)
   (let ((libstdc++ (make-libstdc++ xgcc)))
     (package (inherit libstdc++)
@@ -285,6 +405,14 @@ languages are C and C++.")
   (arm-none-eabi-toolchain gcc-arm-none-eabi-6
                            newlib-nano-arm-none-eabi))
 
+(define-public arm-none-eabi-toolchain-7-2018-q2-update
+  (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
+                           newlib-arm-none-eabi-7-2018-q2-update))
+
+(define-public arm-none-eabi-nano-toolchain-7-2018-q2-update
+  (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
+                           newlib-nano-arm-none-eabi-7-2018-q2-update))
+
 (define-public gdb-arm-none-eabi
   (package
     (inherit gdb)
@@ -322,7 +450,7 @@ languages are C and C++.")
          ("pkg-config" ,pkg-config)))
       (inputs
        `(("libusb" ,libusb)))
-      (home-page "http://repo.or.cz/w/libjaylink.git")
+      (home-page "https://repo.or.cz/w/libjaylink.git")
       (synopsis "Library to interface Segger J-Link devices")
       (description "libjaylink is a shared library written in C to access
 SEGGER J-Link and compatible devices.")
@@ -331,16 +459,16 @@ SEGGER J-Link and compatible devices.")
 (define-public jimtcl
   (package
     (name "jimtcl")
-    (version "0.77")
+    (version "0.79")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/msteveb/jimtcl"
-                    "/archive/" version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/msteveb/jimtcl")
+                     (commit version)))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "1cmk3qscqckg70chjyimzxa2qcka4qac0j4wq908kiijp45cax08"))))
+                "1k88hz0v3bi19xdvlp0i9nsx38imzwpjh632w7326zwbv2wldf0h"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -351,7 +479,7 @@ SEGGER J-Link and compatible devices.")
              (let ((out (assoc-ref outputs "out")))
                (invoke "./configure"
                        (string-append "--prefix=" out))))))))
-    (home-page "http://jim.tcl.tk")
+    (home-page "http://jim.tcl.tk/index.html")
     (synopsis "Small footprint Tcl implementation")
     (description "Jim is a small footprint implementation of the Tcl programming
 language.")
@@ -625,13 +753,14 @@ Propeller micro-controller development.")
     (name "openspin")
     (version "1.00.78")
     (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/parallaxinc/"
-                                  "OpenSpin/archive/" version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/parallaxinc/OpenSpin")
+                     (commit version)))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "1k2dbz1v604g4r2d9qhckg2m8dnhiya760mbsqfsg4waxal87yb7"))))
+                "0ghk8hj4717ydhqzx2pfs6737s1cxng6sgg2xgbkwvcfclxdbrd0"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f ; no tests
@@ -698,13 +827,14 @@ upload binaries to a Parallax Propeller micro-controller.")
     (name "spin2cpp")
     (version "3.6.4")
     (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/totalspectrum/spin2cpp/"
-                                  "archive/v" version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/totalspectrum/spin2cpp")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "05qak187sn0xg7vhrxw27b19xhmid1b8ab8kax3gv0faavzablfw"))))
+                "0wznqvsckzzz4hdy2rpvj6jqpxw4yn7i0c7zxfm6i46k8gg9327b"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f ;; The tests assume that a micro-controller is connected.
@@ -995,7 +1125,7 @@ SPI, I2C, JTAG.")
          (delete 'configure))))
     (synopsis "Programs Microchip's PIC microcontrollers")
     (description "This program programs Microchip's PIC microcontrollers.")
-    (home-page "http://hyvatti.iki.fi/~jaakko/pic/picprog.html")
+    (home-page "https://hyvatti.iki.fi/~jaakko/pic/picprog.html")
     (license license:gpl3+)))
 
 (define-public fc-host-tools
@@ -1132,13 +1262,14 @@ and displaying decoded target responses.
     (version "1.5.1")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/texane/stlink/archive/v"
-                           version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/texane/stlink")
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "01z1cz1a5xbbhd163qrqcgp4bi1k145pb80jmwdz50g7sfzmy570"))))
+         "1d5gxiqpsm8fc105cxlp27af9fk339fap5h6nay21x5a7n61jgyc"))))
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f                      ;no tests
@@ -1162,3 +1293,31 @@ raw USB commands.")
     ;; The flashloaders/stm32l0x.s and flashloaders/stm32lx.s source files are
     ;; licensed under the GPLv2+.
     (license (list license:bsd-3 license:gpl2+))))
+
+(define-public west
+  (package
+    (name "west")
+    (version "0.6.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "west" version))
+       (sha256
+        (base32
+         "0ql6ij1hrj2ir5wkxm96zgig5qwvfwa75w77wh2y13w6b9cqcr4b"))))
+    (propagated-inputs
+     `(("python-colorama" ,python-colorama)
+       ("python-configobj" ,python-configobj)
+       ("python-pykwalify" ,python-pykwalify)
+       ("python-pyyaml" ,python-pyyaml)))
+    (build-system python-build-system)
+    (home-page "https://github.com/zephyrproject-rtos/west")
+    (synopsis "Zephyr RTOS Project meta-tool")
+    (description "West is the swiss-army knife command line tool of the Zephyr
+project.  Its built-in commands provide a multiple repository management
+system with features inspired by Google’s Repo tool and Git submodules.  West
+simplifies configuration and is also pluggable: you can write your own west
+\"extension commands\" which add additional features to west.  Zephyr uses
+this feature to provide conveniences for building applications, flashing and
+debugging them, and more.")
+    (license license:expat)))