me
/
guix
Archived
1
0
Fork 0

gnu: llvm: split scripts to a separate output.

This reduces the closure size by almost 80 MiB.

* gnu/packages/llvm.scm (llvm-8): Add "opt-viewer" output.
master
Julien Lepiller 2019-12-12 12:09:13 +01:00
parent e8cbebb476
commit 50b61ec223
No known key found for this signature in database
GPG Key ID: 43111F4520086A0C
1 changed files with 22 additions and 10 deletions

View File

@ -88,6 +88,7 @@ as \"x86_64-linux\"."
(base32
"0k124sxkfhfi1rca6kzkdraf4axhx99x3cw2rk55056628dvwwl8"))))
(build-system cmake-build-system)
(outputs '("out" "opt-viewer"))
(native-inputs
`(("python" ,python-2) ;bytes->str conversion in clang>=3.7 needs python-2
("perl" ,perl)))
@ -105,16 +106,27 @@ as \"x86_64-linux\"."
;; Don't use '-g' during the build, to save space.
#:build-type "Release"
#:phases (modify-phases %standard-phases
(add-before 'build 'shared-lib-workaround
;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
;; doesn't seem to get the correct rpath to be able to run
;; from the build directory. Set LD_LIBRARY_PATH as a
;; workaround.
(lambda _
(setenv "LD_LIBRARY_PATH"
(string-append (getcwd) "/lib"))
#t)))))
#:phases
(modify-phases %standard-phases
(add-before 'build 'shared-lib-workaround
;; Even with CMAKE_SKIP_BUILD_RPATH=FALSE, llvm-tblgen
;; doesn't seem to get the correct rpath to be able to run
;; from the build directory. Set LD_LIBRARY_PATH as a
;; workaround.
(lambda _
(setenv "LD_LIBRARY_PATH"
(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)))))
(home-page "https://www.llvm.org")
(synopsis "Optimizing compiler infrastructure")
(description