[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/10: gnu: Add llvm-for-mesa.
From: |
guix-commits |
Subject: |
09/10: gnu: Add llvm-for-mesa. |
Date: |
Mon, 30 Jan 2023 13:10:33 -0500 (EST) |
efraim pushed a commit to branch core-updates
in repository guix.
commit 572d7e6ce546e999997ca556ba39ee6340f91ead
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Thu Jan 19 15:02:53 2023 +0200
gnu: Add llvm-for-mesa.
* gnu/packages/llvm.scm (llvm-for-mesa): New variable.
---
gnu/packages/llvm.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 4b9e0930a9..b30a82aa07 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -2070,6 +2070,52 @@ using @code{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)
+ (name "llvm-for-mesa")
+ (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")
+ ;; Skipping tools and utils decreases 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$"))))
+ ;; llvm-config is how mesa and others find the various
+ ;; libraries and headers they use.
+ (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 (getcwd) "/build/lib"))
+ (string-append out "/lib")))
+ (invoke "make" "llvm-config")
+ (install-file "bin/llvm-config"
+ (string-append out "/bin"))))))))))))
+
(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.
- branch core-updates updated (edb8c09add -> a59936e10a), guix-commits, 2023/01/30
- 01/10: Merge remote-tracking branch 'origin/master' into core-updates, guix-commits, 2023/01/30
- 02/10: Revert "gnu: Remove rust-test-generator-0.3.", guix-commits, 2023/01/30
- 03/10: Revert "gnu: Remove rust-yeslogic-fontconfig-sys-2.", guix-commits, 2023/01/30
- 04/10: gnu: guile-3.0: Update to 3.0.9., guix-commits, 2023/01/30
- 07/10: gnu: texlive-fancyvrb: Use over deprecated texlive-latex-fancyvrb., guix-commits, 2023/01/30
- 06/10: gnu: texlive-fancyhdr: Use over deprecated texlive-latex-fancyhdr., guix-commits, 2023/01/30
- 08/10: gnu: r-with-tests: Don't use deprecated texlive-latex-tools., guix-commits, 2023/01/30
- 05/10: gnu: texlive-graphics: Use over deprecated texlive-latex-graphics., guix-commits, 2023/01/30
- 09/10: gnu: Add llvm-for-mesa.,
guix-commits <=
- 10/10: gnu: mesa: Use llvm-for-mesa., guix-commits, 2023/01/30