all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 59237@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#59237] [PATCH 3/3] gnu: Add clang-15.
Date: Sun, 13 Nov 2022 00:02:00 -0500	[thread overview]
Message-ID: <20221113050200.27277-3-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20221113050200.27277-1-maxim.cournoyer@gmail.com>

* gnu/packages/llvm.scm (clang-from-llvm*): New helper.
(clang-15): New variable.
---
 gnu/packages/llvm.scm | 61 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index d7b6207dc4..12e1e642c6 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -422,6 +422,43 @@ (define* (clang-from-llvm llvm clang-runtime
                  license:asl2.0         ;with LLVM exceptions
                  license:ncsa))))
 
+;;; TODO: Integrate into original on core-updates, perhaps with an extra
+;;; option such as #:build-shared-libs? documented as a legacy feature.
+(define* (clang-from-llvm* llvm clang-runtime
+                           #:optional hash
+                           #:key (patches '()) tools-extra
+                           (properties
+                            (append `((release-monitoring-url
+                                       . ,%llvm-release-monitoring-url))
+                                    (clang-properties (package-version llvm)))))
+  "Produce Clang with dependencies on LLVM and CLANG-RUNTIME, and applying the
+given PATCHES.  When TOOLS-EXTRA is given, it must point to the
+'clang-tools-extra' tarball, which contains code for 'clang-tidy', 'pp-trace',
+'modularize', and other tools."
+  (let ((base (clang-from-llvm llvm clang-runtime hash
+                               #:patches patches #:tools-extra tools-extra
+                               #:properties properties)))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases ''%standard-phases)
+          #~(modify-phases #$phases
+              ;; Like the original, sans BUILD_SHARED_LIBS patching.
+              #$@(if tools-extra
+                     #~((replace 'add-tools-extra
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            ;; Unpack the 'clang-tools-extra' tarball under
+                            ;; tools/.
+                            (let ((extra (assoc-ref inputs "clang-tools-extra")))
+                              (invoke "tar" "xf" extra)
+                              (rename-file #$(string-append
+                                              "clang-tools-extra-"
+                                              (string-delete #\- (package-version llvm))
+                                              ".src")
+                                           "tools/extra")))))
+                     #~()))))))))
+
 (define (clang-properties version)
   "Return package properties for Clang VERSION."
   `((compiler-cpu-architectures
@@ -729,6 +766,30 @@ (define-public clang-runtime-14
          ("gcc" ,gcc-11)
          ,@(package-native-inputs template))))))
 
+(define-public clang-15
+  (let ((template
+         (clang-from-llvm*
+          llvm-15 clang-runtime-15
+          #:tools-extra
+          (origin
+            (method url-fetch)
+            (uri (llvm-uri "clang-tools-extra"
+                           (package-version llvm-15)))
+            (sha256
+             (base32
+              "03adxlh84if9p53m6izjsql500rjza9rng8akab2pdqibgrg73rh"))))))
+    (package
+      (inherit template)
+      (arguments
+       (substitute-keyword-arguments (package-arguments template)
+         ((#:configure-flags flags ''())
+          #~(cons "-DCLANG_LINK_CLANG_DYLIB=ON" #$flags))
+         ((#:phases phases '%standard-phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'change-directory
+                (lambda _
+                  (chdir "clang"))))))))))
+
 (define-public clang-14
   (let ((template
          (clang-from-llvm llvm-14 clang-runtime-14
-- 
2.38.1





  parent reply	other threads:[~2022-11-13  5:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13  4:53 [bug#59237] [PATCH 0/3] Add LLVM/Clang 15.0.4 Maxim Cournoyer
2022-11-13  5:01 ` [bug#59237] [PATCH 1/3] gnu: Add llvm-15 Maxim Cournoyer
2022-11-13  5:01   ` [bug#59237] [PATCH 2/3] gnu: Add clang-runtime-15 Maxim Cournoyer
2022-11-13  5:02   ` Maxim Cournoyer [this message]
2022-11-15 10:33     ` [bug#59237] [PATCH 0/3] Add LLVM/Clang 15.0.4 Ludovic Courtès
2022-11-15 10:34     ` Ludovic Courtès
2022-11-15 10:28   ` Ludovic Courtès
2022-11-16 14:18 ` [bug#59237] [PATCH v2 0/5] Add LLVM/Clang 15 Maxim Cournoyer
2022-11-16 14:18   ` [bug#59237] [PATCH v2 1/5] gnu: Add llvm-15 Maxim Cournoyer
2022-11-16 14:18   ` [bug#59237] [PATCH v2 2/5] gnu: Add clang-runtime-15 Maxim Cournoyer
2022-11-16 14:18   ` [bug#59237] [PATCH v2 3/5] gnu: Add clang-15 Maxim Cournoyer
2022-11-16 14:18   ` [bug#59237] [PATCH v2 4/5] gnu: Add libomp-15 Maxim Cournoyer
2022-11-16 14:18   ` [bug#59237] [PATCH v2 5/5] gnu: Add clang-toolchain-15 Maxim Cournoyer
2022-11-16 15:21   ` [bug#59237] [PATCH 0/3] Add LLVM/Clang 15.0.4 Ludovic Courtès
2022-11-16 19:16     ` bug#59237: " Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221113050200.27277-3-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=59237@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.