From: Efraim Flashner <efraim@flashner.co.il>
To: 60934@debbugs.gnu.org
Cc: "John Kehayias" <john.kehayias@protonmail.com>,
"Ludovic Courtès" <ludo@gnu.org>,
"Efraim Flashner" <efraim@flashner.co.il>
Subject: [bug#60934] [PATCH v2 1/2] gnu: Add llvm-for-mesa.
Date: Thu, 19 Jan 2023 15:56:03 +0200 [thread overview]
Message-ID: <37a43bcd770f26694343af3ae0534208dc052055.1674136307.git.efraim@flashner.co.il> (raw)
In-Reply-To: <cover.1674136307.git.efraim@flashner.co.il>
* gnu/packages/llvm.scm (llvm-for-mesa): New variable.
---
gnu/packages/llvm.scm | 49 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 58bd91d7be..8379b23fa5 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -2070,6 +2070,55 @@ (define-public emacs-clang-rename
;;; LLVM variants.
;;;
+(define-public llvm-for-mesa
+ ;; Note: update the 'clang' input of mesa-opencl when bumping this.
+ (let ((base-llvm llvm-15))
+ (package
+ (inherit base-llvm)
+ (arguments
+ (substitute-keyword-arguments (package-arguments base-llvm)
+ ((#:modules modules '((guix build cmake-build-system)
+ (guix build utils)))
+ `((ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-26)
+ ,@modules))
+ ((#:configure-flags cf ''())
+ #~(cons*
+ ;; AMDGPU is needed by the vulkan drivers.
+ #$(string-append "-DLLVM_TARGETS_TO_BUILD="
+ (system->llvm-target) ";AMDGPU")
+ ;; Tools and utils decrease the output by ~100 MiB.
+ "-DLLVM_BUILD_TOOLS=NO"
+ (remove (cut string-match
+ "-DLLVM_(TARGETS_TO_BUILD|INSTALL_UTILS).*" <>)
+ #$cf)))
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'delete-static-libraries
+ ;; If these are just relocated then llvm-config can't find them.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (for-each delete-file
+ (find-files (string-append
+ (assoc-ref outputs "out") "/lib")
+ "\\.a$"))))
+ (add-after 'install 'build-and-install-llvm-config
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute*
+ "tools/llvm-config/CMakeFiles/llvm-config.dir/link.txt"
+ (((string-append "/tmp/guix-build-llvm-"
+ #$(package-version base-llvm)
+ ".drv-0/build/lib"))
+ (string-append out "/lib")))
+ (invoke "make" "llvm-config")
+ (install-file "bin/llvm-config"
+ (string-append out "/bin")))))))))
+ ;; We don't override the name so we hide it so we don't have package
+ ;; ambiguities from the CLI.
+ (properties `((hidden? . #t)
+ ,@(package-properties base-llvm))))))
+
(define make-ocaml-llvm
;; Make it a memoizing procedure so its callers below don't end up defining
;; two equal-but-not-eq "ocaml-llvm" packages for the default LLVM.
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
next prev parent reply other threads:[~2023-01-19 13:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 14:49 [bug#60934] [CORE-UPDATES PATCH] gnu: mesa: Use smaller llvm backend Efraim Flashner
2023-01-19 3:14 ` John Kehayias via Guix-patches via
2023-01-19 7:23 ` Efraim Flashner
2023-01-19 13:56 ` [bug#60934] [PATCH v2 0/2] llvm-for-mesa patch Efraim Flashner
2023-01-19 13:56 ` Efraim Flashner [this message]
2023-01-23 10:35 ` [bug#60934] [PATCH v2 1/2] gnu: Add llvm-for-mesa Ludovic Courtès
2023-01-23 11:57 ` Efraim Flashner
2023-01-30 18:12 ` bug#60934: " Efraim Flashner
2023-01-19 13:56 ` [bug#60934] [PATCH v2 2/2] HELPER PATCH Efraim Flashner
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37a43bcd770f26694343af3ae0534208dc052055.1674136307.git.efraim@flashner.co.il \
--to=efraim@flashner.co.il \
--cc=60934@debbugs.gnu.org \
--cc=john.kehayias@protonmail.com \
--cc=ludo@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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).