Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/
Date: Fri, 30 Sep 2022 15:52:58
Message-Id: 1664553170.70bf3a8996b9a14b0e28d7e367275a20f6d0cffc.mgorny@gentoo
1 commit: 70bf3a8996b9a14b0e28d7e367275a20f6d0cffc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 30 13:49:51 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 30 15:52:50 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70bf3a89
7
8 sys-devel/llvm: Add zstd support in 16.x
9
10 Bug: https://bugs.gentoo.org/873526
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 sys-devel/llvm/llvm-16.0.0.9999.ebuild | 22 +++++++++++++++++++---
14 sys-devel/llvm/llvm-16.0.0_pre20220930.ebuild | 22 +++++++++++++++++++---
15 2 files changed, 38 insertions(+), 6 deletions(-)
16
17 diff --git a/sys-devel/llvm/llvm-16.0.0.9999.ebuild b/sys-devel/llvm/llvm-16.0.0.9999.ebuild
18 index 9171387473ba..d0153e31a64d 100644
19 --- a/sys-devel/llvm/llvm-16.0.0.9999.ebuild
20 +++ b/sys-devel/llvm/llvm-16.0.0.9999.ebuild
21 @@ -4,8 +4,8 @@
22 EAPI=8
23
24 PYTHON_COMPAT=( python3_{8..11} )
25 -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
26 - toolchain-funcs
27 +inherit cmake llvm.org multilib multilib-minimal pax-utils \
28 + python-any-r1 toolchain-funcs
29
30 DESCRIPTION="Low Level Virtual Machine"
31 HOMEPAGE="https://llvm.org/"
32 @@ -19,7 +19,10 @@ HOMEPAGE="https://llvm.org/"
33 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
34 SLOT="$(ver_cut 1)"
35 KEYWORDS=""
36 -IUSE="+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar xml z3"
37 +IUSE="
38 + +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
39 + xml z3 zstd
40 +"
41 RESTRICT="!test? ( test )"
42
43 RDEPEND="
44 @@ -32,6 +35,7 @@ RDEPEND="
45 xar? ( app-arch/xar )
46 xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
47 z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
48 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
49 "
50 DEPEND="
51 ${RDEPEND}
52 @@ -337,6 +341,13 @@ multilib_src_configure() {
53 ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
54 ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
55 fi
56 + if use zstd; then
57 + cat > "${BUILD_DIR}"/zstdConfig.cmake <<-EOF || die
58 + add_library(zstd::libzstd_shared SHARED IMPORTED)
59 + set_target_properties(zstd::libzstd_shared PROPERTIES
60 + IMPORTED_LOCATION "${EPREFIX}/usr/$(get_libdir)/libzstd$(get_libname)")
61 + EOF
62 + fi
63
64 local libdir=$(get_libdir)
65 local mycmakeargs=(
66 @@ -366,6 +377,7 @@ multilib_src_configure() {
67 -DLLVM_ENABLE_EH=ON
68 -DLLVM_ENABLE_RTTI=ON
69 -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
70 + -DLLVM_ENABLE_ZSTD=$(usex zstd)
71
72 -DLLVM_HOST_TRIPLE="${CHOST}"
73
74 @@ -374,6 +386,10 @@ multilib_src_configure() {
75 # used only for llvm-objdump tool
76 -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
77
78 + # workaround llvm requiring cmake files from zstd
79 + -Dzstd_DIR="${BUILD_DIR}"
80 + -DLLVM_PREFER_STATIC_ZSTD=FALSE
81 +
82 -DPython3_EXECUTABLE="${PYTHON}"
83
84 # disable OCaml bindings (now in dev-ml/llvm-ocaml)
85
86 diff --git a/sys-devel/llvm/llvm-16.0.0_pre20220930.ebuild b/sys-devel/llvm/llvm-16.0.0_pre20220930.ebuild
87 index 9171387473ba..d0153e31a64d 100644
88 --- a/sys-devel/llvm/llvm-16.0.0_pre20220930.ebuild
89 +++ b/sys-devel/llvm/llvm-16.0.0_pre20220930.ebuild
90 @@ -4,8 +4,8 @@
91 EAPI=8
92
93 PYTHON_COMPAT=( python3_{8..11} )
94 -inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
95 - toolchain-funcs
96 +inherit cmake llvm.org multilib multilib-minimal pax-utils \
97 + python-any-r1 toolchain-funcs
98
99 DESCRIPTION="Low Level Virtual Machine"
100 HOMEPAGE="https://llvm.org/"
101 @@ -19,7 +19,10 @@ HOMEPAGE="https://llvm.org/"
102 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
103 SLOT="$(ver_cut 1)"
104 KEYWORDS=""
105 -IUSE="+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar xml z3"
106 +IUSE="
107 + +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
108 + xml z3 zstd
109 +"
110 RESTRICT="!test? ( test )"
111
112 RDEPEND="
113 @@ -32,6 +35,7 @@ RDEPEND="
114 xar? ( app-arch/xar )
115 xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
116 z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
117 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
118 "
119 DEPEND="
120 ${RDEPEND}
121 @@ -337,6 +341,13 @@ multilib_src_configure() {
122 ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
123 ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
124 fi
125 + if use zstd; then
126 + cat > "${BUILD_DIR}"/zstdConfig.cmake <<-EOF || die
127 + add_library(zstd::libzstd_shared SHARED IMPORTED)
128 + set_target_properties(zstd::libzstd_shared PROPERTIES
129 + IMPORTED_LOCATION "${EPREFIX}/usr/$(get_libdir)/libzstd$(get_libname)")
130 + EOF
131 + fi
132
133 local libdir=$(get_libdir)
134 local mycmakeargs=(
135 @@ -366,6 +377,7 @@ multilib_src_configure() {
136 -DLLVM_ENABLE_EH=ON
137 -DLLVM_ENABLE_RTTI=ON
138 -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
139 + -DLLVM_ENABLE_ZSTD=$(usex zstd)
140
141 -DLLVM_HOST_TRIPLE="${CHOST}"
142
143 @@ -374,6 +386,10 @@ multilib_src_configure() {
144 # used only for llvm-objdump tool
145 -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
146
147 + # workaround llvm requiring cmake files from zstd
148 + -Dzstd_DIR="${BUILD_DIR}"
149 + -DLLVM_PREFER_STATIC_ZSTD=FALSE
150 +
151 -DPython3_EXECUTABLE="${PYTHON}"
152
153 # disable OCaml bindings (now in dev-ml/llvm-ocaml)