gnu: llvm-12: Use gexps and simplify.
* gnu/packages/llvm.scm (llvm-12)[arguments]: Inherit from llvm-13. Rewrite remaining new phase using gexps. Remove trailing #t from phases. (llvm-9)[arguments]: Adjust accordingly. Change-Id: I7ba4e9954b4e8766e9e072696ab55303c1642315
This commit is contained in:
parent
8cc0687778
commit
15ba54d0e9
1 changed files with 14 additions and 50 deletions
|
@ -7,7 +7,7 @@
|
||||||
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
|
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
|
||||||
;;; Copyright © 2018–2022 Marius Bakke <mbakke@fastmail.com>
|
;;; Copyright © 2018–2022 Marius Bakke <mbakke@fastmail.com>
|
||||||
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
;;; Copyright © 2018, 2021-2023 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2018, 2021-2024 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
|
;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
|
||||||
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
|
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
|
||||||
;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
|
;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
|
||||||
|
@ -913,42 +913,17 @@ Library.")
|
||||||
(base32
|
(base32
|
||||||
"1pzx9zrmd7r3481sbhwvkms68fwhffpp4mmz45dgrkjpyl2q96kx"))))
|
"1pzx9zrmd7r3481sbhwvkms68fwhffpp4mmz45dgrkjpyl2q96kx"))))
|
||||||
(arguments
|
(arguments
|
||||||
;; TODO(core-updates): Unconditionally use quasiquote
|
(substitute-keyword-arguments (package-arguments llvm-13)
|
||||||
`(#:configure-flags
|
((#:phases phases)
|
||||||
,#~(#$(if (%current-target-system)
|
#~(modify-phases #$phases
|
||||||
#~quasiquote
|
#$@(if (assoc "config" (package-native-inputs this-package))
|
||||||
#~quote)
|
#~((add-after 'unpack 'update-config
|
||||||
;; These options are required for cross-compiling LLVM according to
|
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
||||||
;; https://llvm.org/docs/HowToCrossCompileLLVM.html.
|
(let ((config.guess (search-input-file
|
||||||
(#$@(if (%current-target-system)
|
(or inputs native-inputs)
|
||||||
#~(,(string-append "-DLLVM_TABLEGEN="
|
"/bin/config.guess")))
|
||||||
#+(file-append this-package
|
(copy-file config.guess "cmake/config.guess")))))
|
||||||
"/bin/llvm-tblgen"))
|
#~())
|
||||||
#$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE="
|
|
||||||
(%current-target-system))
|
|
||||||
#$(string-append "-DLLVM_TARGET_ARCH="
|
|
||||||
(system->llvm-target-arch))
|
|
||||||
#$(string-append "-DLLVM_TARGETS_TO_BUILD="
|
|
||||||
(system->llvm-target)))
|
|
||||||
#~())
|
|
||||||
"-DCMAKE_SKIP_BUILD_RPATH=FALSE"
|
|
||||||
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
|
|
||||||
"-DBUILD_SHARED_LIBS:BOOL=TRUE"
|
|
||||||
"-DLLVM_ENABLE_FFI:BOOL=TRUE"
|
|
||||||
"-DLLVM_ENABLE_RTTI:BOOL=TRUE" ; For some third-party utilities
|
|
||||||
"-DLLVM_INSTALL_UTILS=ON")) ; Needed for rustc.
|
|
||||||
;; Don't use '-g' during the build, to save space.
|
|
||||||
#:build-type "Release"
|
|
||||||
#:phases
|
|
||||||
(modify-phases %standard-phases
|
|
||||||
,@(if (assoc "config" (package-native-inputs this-package))
|
|
||||||
`((add-after 'unpack 'update-config
|
|
||||||
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
|
||||||
(let ((config.guess (search-input-file
|
|
||||||
(or inputs native-inputs)
|
|
||||||
"/bin/config.guess")))
|
|
||||||
(copy-file config.guess "cmake/config.guess")))))
|
|
||||||
'())
|
|
||||||
(add-before 'build 'shared-lib-workaround
|
(add-before 'build 'shared-lib-workaround
|
||||||
;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
|
;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
|
||||||
;; doesn't seem to get the correct rpath to be able to run
|
;; doesn't seem to get the correct rpath to be able to run
|
||||||
|
@ -956,18 +931,7 @@ Library.")
|
||||||
;; workaround.
|
;; workaround.
|
||||||
(lambda _
|
(lambda _
|
||||||
(setenv "LD_LIBRARY_PATH"
|
(setenv "LD_LIBRARY_PATH"
|
||||||
(string-append (getcwd) "/lib"))
|
(string-append (getcwd) "/lib"))))))))))
|
||||||
#t))
|
|
||||||
(add-after 'install 'install-opt-viewer
|
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
|
||||||
(opt-viewer-out (assoc-ref outputs "opt-viewer"))
|
|
||||||
(opt-viewer-share-dir (string-append opt-viewer-out "/share"))
|
|
||||||
(opt-viewer-dir (string-append opt-viewer-share-dir "/opt-viewer")))
|
|
||||||
(mkdir-p opt-viewer-share-dir)
|
|
||||||
(rename-file (string-append out "/share/opt-viewer")
|
|
||||||
opt-viewer-dir))
|
|
||||||
#t)))))))
|
|
||||||
|
|
||||||
(define-public clang-runtime-12
|
(define-public clang-runtime-12
|
||||||
(clang-runtime-from-llvm
|
(clang-runtime-from-llvm
|
||||||
|
@ -1141,7 +1105,7 @@ Library.")
|
||||||
(if (target-riscv64?)
|
(if (target-riscv64?)
|
||||||
(substitute-keyword-arguments (package-arguments llvm-10)
|
(substitute-keyword-arguments (package-arguments llvm-10)
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
#~(modify-phases #$phases
|
||||||
(add-after 'unpack 'patch-dsymutil-link
|
(add-after 'unpack 'patch-dsymutil-link
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "tools/dsymutil/CMakeLists.txt"
|
(substitute* "tools/dsymutil/CMakeLists.txt"
|
||||||
|
|
Reference in a new issue