all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant.
@ 2024-09-15 19:03 manolis837
  2024-09-15 19:03 ` [bug#73278] [PATCH 2/2] gnu: Add ps1 homebrew development kit manolis837
  2024-09-16 12:00 ` [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant Jean-Pierre De Jesus Diaz
  0 siblings, 2 replies; 4+ messages in thread
From: manolis837 @ 2024-09-15 19:03 UTC (permalink / raw)
  To: 73277; +Cc: Manolis Ragkousis

From: Manolis Ragkousis <manolis837@gmail.com>

* gnu/packages/embedded.scm (make-mipsel-none-elf-toolchain-ps1): New procedure.
  (make-gcc-mipsel-none-elf, make-mipsel-none-elf-toolchain): New variables.

Change-Id: I8d4e1f5601bf255703750f95862d9427013e38e7
---
 gnu/packages/embedded.scm | 86 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 85 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index bee65663b6..8779cc5e71 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2024 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -101,7 +102,9 @@ (define-module (gnu packages embedded)
             make-propeller-gcc-4
             make-propeller-gcc-6
             make-propeller-toolchain
-            make-propeller-development-suite))
+            make-propeller-development-suite
+
+            make-mipsel-none-elf-toolchain-ps1))
 
 ;;; Commentary:
 ;;;
@@ -1859,3 +1862,84 @@ (define-public ts4900-utils
 @item tssilomon
 @end itemize")
       (license license:bsd-2))))
+
+(define make-gcc-mipsel-none-elf
+  (mlambda ()
+    (let ((xgcc (cross-gcc "mipsel-none-elf"
+                           #:xgcc gcc
+                           #:xbinutils (cross-binutils "mipsel-none-elf"))))
+      (package
+        (inherit xgcc)
+        (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")))))
+                (add-after 'unpack 'fix-genmultilib
+                  (lambda _
+                    (substitute* "gcc/genmultilib"
+                      (("#!/bin/sh") (string-append "#!" (which "sh"))))))))
+           ((#:configure-flags flags)
+            #~(append (list "--target=mipsel-none-elf"
+                            "--disable-docs"
+                            "--disable-nls"
+                            "--disable-werror"
+                            "--disable-libada"
+                            "--disable-libssp"
+                            "--disable-libquadmath"
+                            "--disable-threads"
+                            "--disable-libgomp"
+                            "--disable-libstdcxx-pch"
+                            "--disable-hosted-libstdcxx"
+                            "--enable-languages=c,c++"
+                            "--without-isl"
+                            "--without-headers"
+                            "--with-float=soft"
+                            "--with-gnu-as"
+                            "--with-gnu-ld")
+                      #$flags))))))))
+
+(define make-mipsel-none-elf-toolchain
+  (mlambda (xgcc)
+    "Produce a cross-compiler toolchain package with the compiler XGCC."
+    (let ()
+      (package
+        (name "mipsel-none-elf-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))))))
+        (propagated-inputs
+         `(("binutils" ,(cross-binutils "mipsel-none-elf"))
+           ("gcc" ,xgcc)))
+        (synopsis "")
+        (description "")
+        (home-page (package-home-page xgcc))
+        (license (package-license xgcc))))))
+
+(define make-mipsel-none-elf-toolchain-ps1
+  (mlambda () 
+    (make-mipsel-none-elf-toolchain (make-gcc-mipsel-none-elf))))

base-commit: 61b6c7ceb1e2c3baf9cdfbd05e6ad4f6d2dc2a3c
-- 
2.46.0





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

end of thread, other threads:[~2024-09-16 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-15 19:03 [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant manolis837
2024-09-15 19:03 ` [bug#73278] [PATCH 2/2] gnu: Add ps1 homebrew development kit manolis837
2024-09-15 19:09   ` Liliana Marie Prikler
2024-09-16 12:00 ` [bug#73277] [PATCH 1/2] gnu: Add mipsel-none-elf-toolchain variant Jean-Pierre De Jesus Diaz

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.