1 |
commit: 2eba65b97fdae4de9930322fbb24662335dfbb36 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 22 10:26:14 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 22 11:21:36 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2eba65b9 |
7 |
|
8 |
llvm.org.eclass: Support Gentoo patchsets |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
eclass/llvm.org.eclass | 26 ++++++++++++++++++++++++++ |
13 |
1 file changed, 26 insertions(+) |
14 |
|
15 |
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass |
16 |
index e532c953cb7..394df33df04 100644 |
17 |
--- a/eclass/llvm.org.eclass |
18 |
+++ b/eclass/llvm.org.eclass |
19 |
@@ -89,6 +89,11 @@ inherit multiprocessing |
20 |
# the manpages. If set to 'pregenerated', fetch and install |
21 |
# pregenerated manpages from the archive. |
22 |
|
23 |
+# @ECLASS-VARIABLE: LLVM_PATCHSET |
24 |
+# @DEFAULT_UNSET |
25 |
+# @DESCRIPTION: |
26 |
+# LLVM patchset version. No patchset is used if unset. |
27 |
+ |
28 |
|
29 |
# == global scope logic == |
30 |
|
31 |
@@ -145,6 +150,11 @@ llvm.org_set_globals() { |
32 |
die "Invalid LLVM_MANPAGES=${LLVM_MANPAGES}" |
33 |
esac |
34 |
|
35 |
+ if [[ -n ${LLVM_PATCHSET} ]]; then |
36 |
+ SRC_URI+=" |
37 |
+ https://dev.gentoo.org/~mgorny/dist/llvm/llvm-gentoo-patchset-${LLVM_PATCHSET}.tar.xz" |
38 |
+ fi |
39 |
+ |
40 |
# === useful defaults for cmake-based packages === |
41 |
|
42 |
# least intrusive of all |
43 |
@@ -192,6 +202,15 @@ llvm.org_src_unpack() { |
44 |
[[ ${x} != ${archive} ]] && unpack "${x}" |
45 |
done |
46 |
fi |
47 |
+ |
48 |
+ if [[ -n ${LLVM_PATCHSET} ]]; then |
49 |
+ # strip patches that don't match current components |
50 |
+ local IFS='|' |
51 |
+ grep -E -r -L "^Gentoo-Component:.*(${components[*]})" \ |
52 |
+ "${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET}" | |
53 |
+ xargs rm |
54 |
+ assert |
55 |
+ fi |
56 |
} |
57 |
|
58 |
# @FUNCTION: llvm.org_src_prepare |
59 |
@@ -201,6 +220,13 @@ llvm.org_src_unpack() { |
60 |
# ${WORKDIR}, so that patches straight from llvm-project repository |
61 |
# work correctly with -p1. |
62 |
llvm.org_src_prepare() { |
63 |
+ if [[ -n ${LLVM_PATCHSET} ]]; then |
64 |
+ local PATCHES=( |
65 |
+ "${PATCHES[@]}" |
66 |
+ "${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET}" |
67 |
+ ) |
68 |
+ fi |
69 |
+ |
70 |
if declare -f cmake_src_prepare >/dev/null; then |
71 |
# cmake eclasses force ${S} for default_src_prepare |
72 |
# but use ${CMAKE_USE_DIR} for everything else |