1 |
commit: 460260affe1c3ac55992d94581672a49abdb2fcf |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 1 12:09:04 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 1 12:22:28 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=460260af |
7 |
|
8 |
sys-devel/llvm: Add target obsolescence check |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-devel/llvm/llvm-10.0.0.9999.ebuild | 35 ++++++++++++++++++++++++++++++++++ |
13 |
1 file changed, 35 insertions(+) |
14 |
|
15 |
diff --git a/sys-devel/llvm/llvm-10.0.0.9999.ebuild b/sys-devel/llvm/llvm-10.0.0.9999.ebuild |
16 |
index a58ed35b541..6bfea01a739 100644 |
17 |
--- a/sys-devel/llvm/llvm-10.0.0.9999.ebuild |
18 |
+++ b/sys-devel/llvm/llvm-10.0.0.9999.ebuild |
19 |
@@ -90,6 +90,38 @@ python_check_deps() { |
20 |
has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" |
21 |
} |
22 |
|
23 |
+check_live_ebuild() { |
24 |
+ local prod_targets=( |
25 |
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \ |
26 |
+ | tail -n +2 | head -n -1) |
27 |
+ ) |
28 |
+ local all_targets=( |
29 |
+ lib/Target/*/ |
30 |
+ ) |
31 |
+ all_targets=( "${all_targets[@]#lib/Target/}" ) |
32 |
+ all_targets=( "${all_targets[@]%/}" ) |
33 |
+ |
34 |
+ local exp_targets=() i |
35 |
+ for i in "${all_targets[@]}"; do |
36 |
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" ) |
37 |
+ done |
38 |
+ # reorder |
39 |
+ all_targets=( "${prod_targets[@]}" "${exp_targets[@]}" ) |
40 |
+ |
41 |
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then |
42 |
+ ewarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!" |
43 |
+ ewarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}" |
44 |
+ ewarn "Expected: ${exp_targets[*]}" |
45 |
+ ewarn |
46 |
+ fi |
47 |
+ |
48 |
+ if [[ ${all_targets[*]} != ${ALL_LLVM_TARGETS[*]#llvm_targets_} ]]; then |
49 |
+ ewarn "ALL_LLVM_TARGETS is outdated!" |
50 |
+ ewarn " Have: ${ALL_LLVM_TARGETS[*]#llvm_targets_}" |
51 |
+ ewarn "Expected: ${all_targets[*]}" |
52 |
+ fi |
53 |
+} |
54 |
+ |
55 |
src_prepare() { |
56 |
# Fix llvm-config for shared linking and sane flags |
57 |
# https://bugs.gentoo.org/show_bug.cgi?id=565358 |
58 |
@@ -100,6 +132,9 @@ src_prepare() { |
59 |
|
60 |
# User patches + QA |
61 |
cmake-utils_src_prepare |
62 |
+ |
63 |
+ # Verify that the live ebuild is up-to-date |
64 |
+ check_live_ebuild |
65 |
} |
66 |
|
67 |
# Is LLVM being linked against libc++? |