1 |
Round 3. As per mgorny's additional advice, fix eapply_user as per PMS |
2 |
spec and execute in src_prepare. Support older EAPIs with epatch_user. |
3 |
export src_prepare only for supported EAPI versions. |
4 |
|
5 |
--- |
6 |
eclass/kernel-2.eclass | 35 ++++++++++++++++++++++++++--------- |
7 |
1 file changed, 26 insertions(+), 9 deletions(-) |
8 |
|
9 |
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass |
10 |
index 3f5fb3b..547153c 100644 |
11 |
--- a/eclass/kernel-2.eclass |
12 |
+++ b/eclass/kernel-2.eclass |
13 |
@@ -90,12 +90,18 @@ |
14 |
# If you do change them, there is a chance that we will not fix |
15 |
resulting bugs; |
16 |
# that of course does not mean we're not willing to help. |
17 |
|
18 |
-has "${EAPI:-0}" 0 1 2 3 4 5 || die "kernel-2.eclass is unsupported for |
19 |
EAPI ${EAPI}" |
20 |
- |
21 |
PYTHON_COMPAT=( python{2_6,2_7} ) |
22 |
|
23 |
inherit eutils toolchain-funcs versionator multilib python-any-r1 |
24 |
-EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install |
25 |
pkg_preinst pkg_postinst pkg_postrm |
26 |
+case ${EAPI:-0} in |
27 |
+ 0|1) |
28 |
+ EXPORT_FUNCTIONS src_{unpack,compile,install,test} \ |
29 |
+ pkg_{setup,preinst,postinst,postrm} ;; |
30 |
+ 2|3|4|5) |
31 |
+ EXPORT_FUNCTIONS src_{unpack,prepare,compile,install,test} \ |
32 |
+ pkg_{setup,preinst,postinst,postrm} ;; |
33 |
+ *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; |
34 |
+esac |
35 |
|
36 |
# Added by Daniel Ostrow <dostrow@g.o> |
37 |
# This is an ugly hack to get around an issue with a 32-bit userland on |
38 |
ppc64. |
39 |
@@ -1260,12 +1266,9 @@ kernel-2_src_unpack() { |
40 |
# we run misc `make` functions below |
41 |
[[ $(type -t kernel-2_hook_premake) == "function" ]] && |
42 |
kernel-2_hook_premake |
43 |
|
44 |
- debug-print "Applying any user patches" |
45 |
- # apply any user patches |
46 |
- case ${EAPI:-0} in |
47 |
- 0|1|2|3|4|5) epatch_user ;; |
48 |
- 6) eapply_user ;; |
49 |
- esac |
50 |
+ case ${EAPI:-0} in |
51 |
+ 0|1) kernel-2_src_prepare ;; |
52 |
+ esac |
53 |
|
54 |
debug-print "Doing unpack_set_extraversion" |
55 |
|
56 |
@@ -1305,6 +1308,20 @@ kernel-2_src_unpack() { |
57 |
fi |
58 |
} |
59 |
|
60 |
+# @FUNCTION: kernel-2_src_prepare |
61 |
+# @DESCRIPTION: |
62 |
+# Apply any user patches |
63 |
+kernel-2_src_prepare() { |
64 |
+ |
65 |
+ debug-print "Applying any user patches" |
66 |
+ |
67 |
+ # apply any user patches |
68 |
+ case ${EAPI:-0} in |
69 |
+ 0|1|2|3|4|5) epatch_user ;; |
70 |
+ 6) eapply_user ;; |
71 |
+ esac |
72 |
+} |
73 |
+ |
74 |
kernel-2_src_compile() { |
75 |
cd "${S}" |
76 |
[[ ${ETYPE} == headers ]] && compile_headers |
77 |
-- |
78 |
2.7.3 |