Patchwork [2/3] gnu: Add newlib-arm-none-eabi.

login
register
mail settings
Submitter Ricardo Wurmus
Date Sept. 18, 2016, 6:35 a.m.
Message ID <20160918063513.11027-3-rekado@elephly.net>
Download mbox | patch
Permalink /patch/15708/
State New
Headers show

Comments

Ricardo Wurmus - Sept. 18, 2016, 6:35 a.m.
* gnu/packages/embedded.scm (newlib-arm-none-eabi): New variable.
---
 gnu/packages/embedded.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
Ludovic Courtès - Sept. 21, 2016, 8:38 a.m.
Ricardo Wurmus <rekado@elephly.net> skribis:

> * gnu/packages/embedded.scm (newlib-arm-none-eabi): New variable.

[...]

> +       #:configure-flags '("--target=arm-none-eabi"
> +                           "--enable-newlib-io-long-long"
> +                           "--enable-newlib-register-fini"
> +                           "--disable-newlib-supplied-syscalls"
> +                           "--disable-nls")

Maybe a short comment to explain.  :-)

> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'fix-shell-shebangs
> +           (lambda _
> +             (setenv "SHELL" (which "sh"))
> +             (setenv "CONFIG_SHELL" (which "sh"))
> +             (substitute* '("libgloss/arm/configure"
> +                            "libgloss/arm/cpu-init/Makefile.in"
> +                            "libgloss/arm/Makefile.in"
> +                            "libgloss/libnosys/Makefile.in"
> +                            "libgloss/Makefile.in")
> +               (("/bin/sh") (which "sh")))

Are they not taken care of by the ‘patch-shebangs’ phase?

Otherwise LGTM, thanks!

Ludo’.

Patch

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 17ca784..8f484e5 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -119,3 +119,47 @@ 
                              "--with-gnu-as"
                              "--with-gnu-ld")
                        (delete "--disable-multilib" ,flags)))))))))
+
+(define-public newlib-arm-none-eabi
+  (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
+       #:configure-flags '("--target=arm-none-eabi"
+                           "--enable-newlib-io-long-long"
+                           "--enable-newlib-register-fini"
+                           "--disable-newlib-supplied-syscalls"
+                           "--disable-nls")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-shell-shebangs
+           (lambda _
+             (setenv "SHELL" (which "sh"))
+             (setenv "CONFIG_SHELL" (which "sh"))
+             (substitute* '("libgloss/arm/configure"
+                            "libgloss/arm/cpu-init/Makefile.in"
+                            "libgloss/arm/Makefile.in"
+                            "libgloss/libnosys/Makefile.in"
+                            "libgloss/Makefile.in")
+               (("/bin/sh") (which "sh")))
+             #t)))))
+    (native-inputs
+     `(("xbinutils" ,xbinutils-arm-none-eabi)
+       ("xgcc" ,gcc-arm-none-eabi)
+       ("texinfo" ,texinfo)))
+    (home-page "http://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"))))