guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#54239] [PATCH v3 06/10] gnu: libcxx: Allow cross-compilation.


From: Julien Lepiller
Subject: [bug#54239] [PATCH v3 06/10] gnu: libcxx: Allow cross-compilation.
Date: Sat, 16 Jul 2022 21:48:03 +0200

* gnu/packages/llvm.scm (libcxx)[native-inputs]: Move llvm to...
[inputs]: ...here.
[arguments]: adjust CROSS_INCLUDE_PATH when cross-compiling.
(libcxx-6)[native-inputs]: Move llvm to...
[inputs]: ...here.
---
 gnu/packages/llvm.scm | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 560a64840a..96620f1c3c 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1640,8 +1640,9 @@ (define-public libcxx
      `(#:phases
        (modify-phases (@ (guix build cmake-build-system) %standard-phases)
          (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((gcc (assoc-ref inputs  "gcc")))
+           (lambda* (#:key inputs native-inputs #:allow-other-keys)
+             (let ((gcc (or (assoc-ref (or native-inputs inputs) "gcc")))
+                   (cross-gcc (assoc-ref native-inputs "cross-gcc")))
                ;; Hide GCC's C++ headers so that they do not interfere with
                ;; the ones we are attempting to build.
                (setenv "CPLUS_INCLUDE_PATH"
@@ -1649,12 +1650,19 @@ (define-public libcxx
                                             (string-split (getenv 
"CPLUS_INCLUDE_PATH")
                                                           #\:))
                                     ":"))
+               (when cross-gcc
+                 (setenv "CROSS_CPLUS_INCLUDE_PATH"
+                         (string-join (delete (string-append cross-gcc 
"/include/c++")
+                                              (string-split (getenv 
"CROSS_CPLUS_INCLUDE_PATH")
+                                                            #\:))
+                                      ":"))
+                 (format #t
+                         "environment variable `CROSS_CPLUS_INCLUDE_PATH' 
changed to ~a~%"
+                         (getenv "CROSS_CPLUS_INCLUDE_PATH")))
                (format #t
                        "environment variable `CPLUS_INCLUDE_PATH' changed to 
~a~%"
-                       (getenv "CPLUS_INCLUDE_PATH"))
-               #t))))))
-    (native-inputs
-     (list clang llvm))
+                       (getenv "CPLUS_INCLUDE_PATH"))))))))
+    (inputs (list llvm-9))
     (home-page "https://libcxx.llvm.org";)
     (synopsis "C++ standard library")
     (description
@@ -1675,8 +1683,7 @@ (define-public libcxx-6
        (sha256
         (base32
          "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
-    (native-inputs
-     (list clang-6 llvm-6))))
+    (inputs (list llvm-6))))
 
 (define-public libcxxabi-6
   (package
-- 
2.37.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]