Subject: bug#58394: closed (Re: [PATCH 1/4] gnu: libcxx: Use G-expressions.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 05 Nov 2022 23:39:02 +0000

Your bug report

#58394: [PATCH]: gnu: libcxx: Update to 14.0.6.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
58394: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58394
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH 1/4] gnu: libcxx: Use G-expressions.
From: Ludovic Courtès <[email-masked]>
To: Zhu Zihao <[email-masked]>
Cc: [email-masked]
Date: Sun, 06 Nov 2022 00:38:11 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Finally applied, thanks!

  a60dc46c2b gnu: libcxx+libcxxabi: Use G-expressions.
  1bb3a3ea4e gnu: libcxxabi: Use G-expressions.
  8501932f36 gnu: libcxx: Update to 14.0.6.
  86af794215 gnu: libcxx: Use G-expressions.

Ludo’.

Subject: [PATCH]: gnu: libcxx: Update to 14.0.6.
From: Zhu Zihao <[email-masked]>
To: guix-patches <[email-masked]>
Date: Sun, 09 Oct 2022 22:59:58 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

>From 41b6beb2ee5770f791984fb7411a69ba77544681 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <[email-masked]>
Date: Fri, 7 Oct 2022 11:14:26 +0800
Subject: [PATCH 1/2] gnu: libcxx: Use G-expressions.

* gnu/packages/llvm.scm (libcxx)[arguments]: Use G-expressions.
(libcxx-6)[arguments]: Use G-expressions.
---
 gnu/packages/llvm.scm | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 49eb25db1f..00918bfb90 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2022 Greg Hogan <[email-masked]>
 ;;; Copyright © 2022 John Kehayias <[email-masked]>
 ;;; Copyright © 2022 Clément Lassieur <[email-masked]>
+;;; Copyright © 2022 Zhu Zihao <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1540,22 +1541,23 @@ (define-public libcxx
          "0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089"))))
     (build-system cmake-build-system)
     (arguments
-     `(#: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")))
-               ;; Hide GCC's C++ headers so that they do not interfere with
-               ;; the ones we are attempting to build.
-               (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"))
-               #t))))))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((gcc (assoc-ref inputs  "gcc")))
+                ;; Hide GCC's C++ headers so that they do not interfere with
+                ;; the ones we are attempting to build.
+                (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"))
+                #t))))))
     (native-inputs
      (list clang llvm))
     (home-page "https://libcxx.llvm.org")
@@ -1578,6 +1580,11 @@ (define-public libcxx-6
        (sha256
         (base32
          "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments libcxx)
+       ((#:phases p)
+        #~(modify-phases #$p
+            (delete 'enter-subdirectory)))))
     (native-inputs
      (list clang-6 llvm-6))))
 
-- 
2.37.3

>From b70e093e1ce01de0f607d70911e1539462c17a40 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <[email-masked]>
Date: Sat, 8 Oct 2022 16:26:44 +0800
Subject: [PATCH 2/2] gnu: libcxx: Update to 14.0.6.

* gnu/packages/llvm.scm(libcxx)[source]: Use "llvm-monorepo".
[arguments]<#:configure-flags>: Use clang & clang++, skip RPATH_CHANGE in CMake.
<#:phases>: Add phase "enter-subdirectory".
[native-inputs]: Add Python 3 for lit.

(libcxx-6)[arguments]: Don't inherit from libcxx.
---
 gnu/packages/llvm.scm | 47 +++++++++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 00918bfb90..ad0cb088be 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1531,19 +1531,27 @@ (define-public lldb
 (define-public libcxx
   (package
     (name "libcxx")
-    (version "9.0.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (llvm-uri "libcxx" version))
-       (sha256
-        (base32
-         "0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089"))))
+    (version "14.0.6")
+    (source (llvm-monorepo version))
     (build-system cmake-build-system)
     (arguments
      (list
+      #:tests? #f
+      #:configure-flags
+      #~(list "-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi"
+              "-DCMAKE_C_COMPILER=clang"
+              "-DCMAKE_CXX_COMPILER=clang++"
+              ;; libc++.so is actually a GNU ld style linker script, however,
+              ;; CMake still tries to fix the RUNPATH of it during the install
+              ;; step. This argument tells CMake to use the install directory
+              ;; as RUNPATH and don't attempt to patch it.
+              ;; See also: https://gitlab.kitware.com/cmake/cmake/-/issues/22963
+              "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
       #:phases
       #~(modify-phases %standard-phases
+          (add-after 'unpack 'enter-subdirectory
+            (lambda _
+              (chdir "runtimes")))
           (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
             (lambda* (#:key inputs #:allow-other-keys)
               (let ((gcc (assoc-ref inputs  "gcc")))
@@ -1559,7 +1567,7 @@ (define-public libcxx
                         (getenv "CPLUS_INCLUDE_PATH"))
                 #t))))))
     (native-inputs
-     (list clang llvm))
+     (list clang llvm python))
     (home-page "https://libcxx.llvm.org")
     (synopsis "C++ standard library")
     (description
@@ -1581,10 +1589,23 @@ (define-public libcxx-6
         (base32
          "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
     (arguments
-     (substitute-keyword-arguments (package-arguments libcxx)
-       ((#:phases p)
-        #~(modify-phases #$p
-            (delete 'enter-subdirectory)))))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((gcc (assoc-ref inputs  "gcc")))
+                ;; Hide GCC's C++ headers so that they do not interfere with
+                ;; the ones we are attempting to build.
+                (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"))
+                #t))))))
     (native-inputs
      (list clang-6 llvm-6))))
 
-- 
2.37.3

-- 
Retrieve my PGP public key:

  gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC

Zihao