1 |
commit: b20e6ef1303c6b04aeb70d281c13a6d3acaed780 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 29 15:04:45 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 15 12:47:21 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b20e6ef1 |
7 |
|
8 |
sys-devel/clang: Re-introduce slotting |
9 |
|
10 |
...-4.0.0_rc1.ebuild => clang-4.0.0_rc1-r1.ebuild} | 76 +++++++++++----------- |
11 |
sys-devel/clang/clang-9999.ebuild | 76 ++++++++++++---------- |
12 |
2 files changed, 79 insertions(+), 73 deletions(-) |
13 |
|
14 |
diff --git a/sys-devel/clang/clang-4.0.0_rc1.ebuild b/sys-devel/clang/clang-4.0.0_rc1-r1.ebuild |
15 |
similarity index 76% |
16 |
rename from sys-devel/clang/clang-4.0.0_rc1.ebuild |
17 |
rename to sys-devel/clang/clang-4.0.0_rc1-r1.ebuild |
18 |
index db09b6754c..0c882c4d7c 100644 |
19 |
--- a/sys-devel/clang/clang-4.0.0_rc1.ebuild |
20 |
+++ b/sys-devel/clang/clang-4.0.0_rc1-r1.ebuild |
21 |
@@ -9,7 +9,7 @@ EAPI=6 |
22 |
CMAKE_MIN_VERSION=3.7.0-r1 |
23 |
PYTHON_COMPAT=( python2_7 ) |
24 |
|
25 |
-inherit check-reqs cmake-utils flag-o-matic multilib-minimal \ |
26 |
+inherit check-reqs cmake-utils flag-o-matic llvm multilib-minimal \ |
27 |
python-single-r1 toolchain-funcs pax-utils versionator |
28 |
|
29 |
DESCRIPTION="C language family frontend for LLVM" |
30 |
@@ -25,16 +25,15 @@ ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
31 |
LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} |
32 |
|
33 |
LICENSE="UoI-NCSA" |
34 |
-SLOT="0/$(get_major_version)" |
35 |
+SLOT="$(get_major_version)" |
36 |
KEYWORDS="~amd64 ~arm64 ~x86" |
37 |
-IUSE="debug default-compiler-rt default-libcxx +doc multitarget python |
38 |
+IUSE="debug default-compiler-rt default-libcxx +doc multitarget |
39 |
+static-analyzer test xml elibc_musl kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}" |
40 |
|
41 |
RDEPEND=" |
42 |
- ~sys-devel/llvm-${PV}:=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}] |
43 |
+ ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}] |
44 |
static-analyzer? ( dev-lang/perl:* ) |
45 |
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
46 |
- !<sys-devel/llvm-${PV} |
47 |
${PYTHON_DEPS}" |
48 |
# configparser-3.2 breaks the build (3.3 or none at all are fine) |
49 |
DEPEND="${RDEPEND} |
50 |
@@ -43,16 +42,20 @@ DEPEND="${RDEPEND} |
51 |
xml? ( virtual/pkgconfig ) |
52 |
!!<dev-python/configparser-3.3.0.2 |
53 |
${PYTHON_DEPS}" |
54 |
+RDEPEND="${RDEPEND} |
55 |
+ !<sys-devel/llvm-4.0.0_rc:0 |
56 |
+ !sys-devel/clang:0" |
57 |
PDEPEND=" |
58 |
~sys-devel/clang-runtime-${PV} |
59 |
- default-compiler-rt? ( sys-libs/compiler-rt ) |
60 |
+ default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* ) |
61 |
default-libcxx? ( sys-libs/libcxx )" |
62 |
|
63 |
REQUIRED_USE="${PYTHON_REQUIRED_USE} |
64 |
|| ( ${ALL_LLVM_TARGETS[*]} ) |
65 |
multitarget? ( ${ALL_LLVM_TARGETS[*]} )" |
66 |
|
67 |
-S=${WORKDIR}/cfe-${PV/_/}.src |
68 |
+# We need extra level of indirection for CLANG_RESOURCE_DIR |
69 |
+S=${WORKDIR}/x/y/cfe-${PV/_/}.src |
70 |
|
71 |
# least intrusive of all |
72 |
CMAKE_BUILD_TYPE=RelWithDebInfo |
73 |
@@ -100,21 +103,24 @@ pkg_pretend() { |
74 |
pkg_setup() { |
75 |
check_space |
76 |
|
77 |
+ LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup |
78 |
python-single-r1_pkg_setup |
79 |
} |
80 |
|
81 |
src_unpack() { |
82 |
+ # create extra parent dirs for CLANG_RESOURCE_DIR |
83 |
+ mkdir -p x/y || die |
84 |
+ cd x/y || die |
85 |
+ |
86 |
default |
87 |
|
88 |
mv clang-tools-extra-* "${S}"/tools/clang-tools-extra || die |
89 |
if use test; then |
90 |
- mv llvm-* llvm || die |
91 |
+ mv llvm-* "${WORKDIR}"/llvm || die |
92 |
fi |
93 |
} |
94 |
|
95 |
src_prepare() { |
96 |
- python_setup |
97 |
- |
98 |
# fix finding compiler-rt libs |
99 |
eapply "${FILESDIR}"/9999/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch |
100 |
|
101 |
@@ -128,11 +134,13 @@ src_prepare() { |
102 |
multilib_src_configure() { |
103 |
local llvm_version=$(llvm-config --version) || die |
104 |
local clang_version=$(get_version_component_range 1-3 "${llvm_version}") |
105 |
+ |
106 |
local mycmakeargs=( |
107 |
# ensure that the correct llvm-config is used |
108 |
- -DLLVM_CONFIG="${EPREFIX}/usr/bin/${CHOST}-llvm-config" |
109 |
+ -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")" |
110 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}" |
111 |
# relative to bindir |
112 |
- -DCLANG_RESOURCE_DIR="../lib/clang/${clang_version}" |
113 |
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}" |
114 |
|
115 |
-DBUILD_SHARED_LIBS=ON |
116 |
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
117 |
@@ -191,8 +199,9 @@ multilib_src_compile() { |
118 |
cmake-utils_src_compile |
119 |
|
120 |
# provide a symlink for tests |
121 |
- if [[ $(get_libdir) != lib ]]; then |
122 |
- ln -s "../$(get_libdir)/clang" lib/clang || die |
123 |
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then |
124 |
+ mkdir -p "${WORKDIR}"/lib || die |
125 |
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die |
126 |
fi |
127 |
} |
128 |
|
129 |
@@ -210,13 +219,15 @@ src_install() { |
130 |
multilib-minimal_src_install |
131 |
|
132 |
# Move runtime headers to /usr/lib/clang, where they belong |
133 |
- dodir /usr/lib |
134 |
- mv "${ED}usr/include/clangrt" "${ED}usr/lib/clang" || die |
135 |
+ mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die |
136 |
+ # move (remaining) wrapped headers back |
137 |
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die |
138 |
|
139 |
# Apply CHOST and version suffix to clang tools |
140 |
# note: we use two version components here (vs 3 in runtime path) |
141 |
local llvm_version=$(llvm-config --version) || die |
142 |
local clang_version=$(get_version_component_range 1-2 "${llvm_version}") |
143 |
+ local clang_full_version=$(get_version_component_range 1-3 "${llvm_version}") |
144 |
local clang_tools=( clang clang++ clang-cl clang-cpp ) |
145 |
local abi i |
146 |
|
147 |
@@ -230,9 +241,9 @@ src_install() { |
148 |
# - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y |
149 |
# also in CHOST variant |
150 |
for i in "${clang_tools[@]:1}"; do |
151 |
- rm "${ED%/}/usr/bin/${i}" || die |
152 |
- dosym "clang-${clang_version}" "/usr/bin/${i}-${clang_version}" |
153 |
- dosym "${i}-${clang_version}" "/usr/bin/${i}" |
154 |
+ rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die |
155 |
+ dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}" |
156 |
+ dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}" |
157 |
done |
158 |
|
159 |
# now create target symlinks for all supported ABIs |
160 |
@@ -240,40 +251,31 @@ src_install() { |
161 |
local abi_chost=$(get_abi_CHOST "${abi}") |
162 |
for i in "${clang_tools[@]}"; do |
163 |
dosym "${i}-${clang_version}" \ |
164 |
- "/usr/bin/${abi_chost}-${i}-${clang_version}" |
165 |
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}" |
166 |
dosym "${abi_chost}-${i}-${clang_version}" \ |
167 |
- "/usr/bin/${abi_chost}-${i}" |
168 |
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}" |
169 |
done |
170 |
done |
171 |
|
172 |
# Remove unnecessary headers on FreeBSD, bug #417171 |
173 |
if use kernel_FreeBSD; then |
174 |
- rm "${ED}"usr/lib/clang/${llvm_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die |
175 |
+ rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die |
176 |
fi |
177 |
} |
178 |
|
179 |
multilib_src_install() { |
180 |
cmake-utils_src_install |
181 |
|
182 |
- # move headers to include/ to get them checked for ABI mismatch |
183 |
- # (then to the correct directory in src_install()) |
184 |
- insinto /usr/include/clangrt |
185 |
- doins -r "${ED}usr/$(get_libdir)/clang"/. |
186 |
- rm -r "${ED}usr/$(get_libdir)/clang" || die |
187 |
+ # move headers to /usr/include for wrapping & ABI mismatch checks |
188 |
+ # (also drop the version suffix from runtime headers) |
189 |
+ rm -rf "${ED%/}"/usr/include || die |
190 |
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die |
191 |
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die |
192 |
} |
193 |
|
194 |
multilib_src_install_all() { |
195 |
- if use python ; then |
196 |
- pushd bindings/python/clang >/dev/null || die |
197 |
- |
198 |
- python_moduleinto clang |
199 |
- python_domodule *.py |
200 |
- |
201 |
- popd >/dev/null || die |
202 |
- fi |
203 |
- |
204 |
python_fix_shebang "${ED}" |
205 |
if use static-analyzer; then |
206 |
- python_optimize "${ED}"usr/share/scan-view |
207 |
+ python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view |
208 |
fi |
209 |
} |
210 |
|
211 |
diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild |
212 |
index 3cad65beaf..f9c6af3584 100644 |
213 |
--- a/sys-devel/clang/clang-9999.ebuild |
214 |
+++ b/sys-devel/clang/clang-9999.ebuild |
215 |
@@ -9,7 +9,7 @@ EAPI=6 |
216 |
CMAKE_MIN_VERSION=3.7.0-r1 |
217 |
PYTHON_COMPAT=( python2_7 ) |
218 |
|
219 |
-inherit check-reqs cmake-utils flag-o-matic git-r3 multilib-minimal \ |
220 |
+inherit check-reqs cmake-utils flag-o-matic git-r3 llvm multilib-minimal \ |
221 |
python-single-r1 toolchain-funcs pax-utils versionator |
222 |
|
223 |
DESCRIPTION="C language family frontend for LLVM" |
224 |
@@ -25,16 +25,15 @@ ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
225 |
LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} |
226 |
|
227 |
LICENSE="UoI-NCSA" |
228 |
-SLOT="0/$(get_major_version)" |
229 |
+SLOT="5" |
230 |
KEYWORDS="" |
231 |
-IUSE="debug default-compiler-rt default-libcxx +doc multitarget python |
232 |
+IUSE="debug default-compiler-rt default-libcxx +doc multitarget |
233 |
+static-analyzer test xml elibc_musl kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}" |
234 |
|
235 |
RDEPEND=" |
236 |
- ~sys-devel/llvm-${PV}:=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}] |
237 |
+ ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}] |
238 |
static-analyzer? ( dev-lang/perl:* ) |
239 |
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) |
240 |
- !<sys-devel/llvm-${PV} |
241 |
${PYTHON_DEPS}" |
242 |
# configparser-3.2 breaks the build (3.3 or none at all are fine) |
243 |
DEPEND="${RDEPEND} |
244 |
@@ -43,15 +42,21 @@ DEPEND="${RDEPEND} |
245 |
xml? ( virtual/pkgconfig ) |
246 |
!!<dev-python/configparser-3.3.0.2 |
247 |
${PYTHON_DEPS}" |
248 |
+RDEPEND="${RDEPEND} |
249 |
+ !<sys-devel/llvm-4.0.0_rc:0 |
250 |
+ !sys-devel/clang:0" |
251 |
PDEPEND=" |
252 |
~sys-devel/clang-runtime-${PV} |
253 |
- default-compiler-rt? ( sys-libs/compiler-rt ) |
254 |
+ default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* ) |
255 |
default-libcxx? ( sys-libs/libcxx )" |
256 |
|
257 |
REQUIRED_USE="${PYTHON_REQUIRED_USE} |
258 |
|| ( ${ALL_LLVM_TARGETS[*]} ) |
259 |
multitarget? ( ${ALL_LLVM_TARGETS[*]} )" |
260 |
|
261 |
+# We need extra level of indirection for CLANG_RESOURCE_DIR |
262 |
+S=${WORKDIR}/x/y/${P} |
263 |
+ |
264 |
# least intrusive of all |
265 |
CMAKE_BUILD_TYPE=RelWithDebInfo |
266 |
|
267 |
@@ -98,10 +103,15 @@ pkg_pretend() { |
268 |
pkg_setup() { |
269 |
check_space |
270 |
|
271 |
+ LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup |
272 |
python-single-r1_pkg_setup |
273 |
} |
274 |
|
275 |
src_unpack() { |
276 |
+ # create extra parent dir for CLANG_RESOURCE_DIR |
277 |
+ mkdir -p x/y || die |
278 |
+ cd x/y || die |
279 |
+ |
280 |
git-r3_fetch "http://llvm.org/git/clang-tools-extra.git |
281 |
https://github.com/llvm-mirror/clang-tools-extra.git" |
282 |
if use test; then |
283 |
@@ -117,12 +127,10 @@ src_unpack() { |
284 |
git-r3_checkout http://llvm.org/git/llvm.git \ |
285 |
"${WORKDIR}"/llvm |
286 |
fi |
287 |
- git-r3_checkout |
288 |
+ git-r3_checkout "${EGIT_REPO_URI}" "${S}" |
289 |
} |
290 |
|
291 |
src_prepare() { |
292 |
- python_setup |
293 |
- |
294 |
# fix finding compiler-rt libs |
295 |
eapply "${FILESDIR}"/9999/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch |
296 |
|
297 |
@@ -136,11 +144,13 @@ src_prepare() { |
298 |
multilib_src_configure() { |
299 |
local llvm_version=$(llvm-config --version) || die |
300 |
local clang_version=$(get_version_component_range 1-3 "${llvm_version}") |
301 |
+ |
302 |
local mycmakeargs=( |
303 |
# ensure that the correct llvm-config is used |
304 |
- -DLLVM_CONFIG="${EPREFIX}/usr/bin/${CHOST}-llvm-config" |
305 |
+ -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")" |
306 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}" |
307 |
# relative to bindir |
308 |
- -DCLANG_RESOURCE_DIR="../lib/clang/${clang_version}" |
309 |
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}" |
310 |
|
311 |
-DBUILD_SHARED_LIBS=ON |
312 |
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
313 |
@@ -199,8 +209,9 @@ multilib_src_compile() { |
314 |
cmake-utils_src_compile |
315 |
|
316 |
# provide a symlink for tests |
317 |
- if [[ $(get_libdir) != lib ]]; then |
318 |
- ln -s "../$(get_libdir)/clang" lib/clang || die |
319 |
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then |
320 |
+ mkdir -p "${WORKDIR}"/lib || die |
321 |
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die |
322 |
fi |
323 |
} |
324 |
|
325 |
@@ -219,13 +230,15 @@ src_install() { |
326 |
multilib-minimal_src_install |
327 |
|
328 |
# Move runtime headers to /usr/lib/clang, where they belong |
329 |
- dodir /usr/lib |
330 |
- mv "${ED}usr/include/clangrt" "${ED}usr/lib/clang" || die |
331 |
+ mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die |
332 |
+ # move (remaining) wrapped headers back |
333 |
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die |
334 |
|
335 |
# Apply CHOST and version suffix to clang tools |
336 |
# note: we use two version components here (vs 3 in runtime path) |
337 |
local llvm_version=$(llvm-config --version) || die |
338 |
local clang_version=$(get_version_component_range 1-2 "${llvm_version}") |
339 |
+ local clang_full_version=$(get_version_component_range 1-3 "${llvm_version}") |
340 |
local clang_tools=( clang clang++ clang-cl clang-cpp ) |
341 |
local abi i |
342 |
|
343 |
@@ -239,9 +252,9 @@ src_install() { |
344 |
# - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y |
345 |
# also in CHOST variant |
346 |
for i in "${clang_tools[@]:1}"; do |
347 |
- rm "${ED%/}/usr/bin/${i}" || die |
348 |
- dosym "clang-${clang_version}" "/usr/bin/${i}-${clang_version}" |
349 |
- dosym "${i}-${clang_version}" "/usr/bin/${i}" |
350 |
+ rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die |
351 |
+ dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}" |
352 |
+ dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}" |
353 |
done |
354 |
|
355 |
# now create target symlinks for all supported ABIs |
356 |
@@ -249,40 +262,31 @@ src_install() { |
357 |
local abi_chost=$(get_abi_CHOST "${abi}") |
358 |
for i in "${clang_tools[@]}"; do |
359 |
dosym "${i}-${clang_version}" \ |
360 |
- "/usr/bin/${abi_chost}-${i}-${clang_version}" |
361 |
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}" |
362 |
dosym "${abi_chost}-${i}-${clang_version}" \ |
363 |
- "/usr/bin/${abi_chost}-${i}" |
364 |
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}" |
365 |
done |
366 |
done |
367 |
|
368 |
# Remove unnecessary headers on FreeBSD, bug #417171 |
369 |
if use kernel_FreeBSD; then |
370 |
- rm "${ED}"usr/lib/clang/${llvm_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die |
371 |
+ rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die |
372 |
fi |
373 |
} |
374 |
|
375 |
multilib_src_install() { |
376 |
cmake-utils_src_install |
377 |
|
378 |
- # move headers to include/ to get them checked for ABI mismatch |
379 |
- # (then to the correct directory in src_install()) |
380 |
- insinto /usr/include/clangrt |
381 |
- doins -r "${ED}usr/$(get_libdir)/clang"/. |
382 |
- rm -r "${ED}usr/$(get_libdir)/clang" || die |
383 |
+ # move headers to /usr/include for wrapping & ABI mismatch checks |
384 |
+ # (also drop the version suffix from runtime headers) |
385 |
+ rm -rf "${ED%/}"/usr/include || die |
386 |
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die |
387 |
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die |
388 |
} |
389 |
|
390 |
multilib_src_install_all() { |
391 |
- if use python ; then |
392 |
- pushd bindings/python/clang >/dev/null || die |
393 |
- |
394 |
- python_moduleinto clang |
395 |
- python_domodule *.py |
396 |
- |
397 |
- popd >/dev/null || die |
398 |
- fi |
399 |
- |
400 |
python_fix_shebang "${ED}" |
401 |
if use static-analyzer; then |
402 |
- python_optimize "${ED}"usr/share/scan-view |
403 |
+ python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view |
404 |
fi |
405 |
} |