1 |
On Sun, 2017-02-19 at 09:26 +0100, Michał Górny wrote: |
2 |
> W dniu 19.02.2017, nie o godzinie 09∶03 +0100, użytkownik Hans de |
3 |
> Graaff |
4 |
> napisał: |
5 |
> > |
6 |
> > This also removes the need for inheriting eutils in EAPI 6. |
7 |
> > |
8 |
> Wouldn't EAPI 6 be a good opportunity to kill this dualism and just |
9 |
> require people to say FILESDIR explicitly? |
10 |
|
11 |
Which made me think: why have RUBY_PATCHES at all. I think we added |
12 |
that at the time to allow bash arrays as input. So I've changed this |
13 |
patch to use the default phase in EAPI 6 instead, removing the need for |
14 |
explicit eapply_user and PATCHES support. |
15 |
|
16 |
Hans |
17 |
|
18 |
1b2b8abde99a59e72fbcc0bc8f9e835dcaee2176 |
19 |
Author: Hans de Graaff <graaff@g.o> |
20 |
AuthorDate: Sun Feb 19 08:42:31 2017 +0100 |
21 |
Commit: Hans de Graaff <graaff@g.o> |
22 |
CommitDate: Tue Feb 21 20:18:17 2017 +0100 |
23 |
|
24 |
Parent: 1d36503 ruby-ng.eclass: add support for EAPI=6 |
25 |
Merged: eapi6 master |
26 |
Containing: eapi6 |
27 |
|
28 |
ruby-ng.eclass: use the default src_prepare in EAPI 6 |
29 |
|
30 |
This removes the need for inheriting eutils in EAPI 6. It also use |
31 |
the standard PATCHES support instead of RUBY_PATCHES, which was |
32 |
introduced to handle arrays on patches at the time. |
33 |
|
34 |
The default phase also handles eapply_user to handle user patches. |
35 |
|
36 |
1 file changed, 30 insertions(+), 13 deletions(-) |
37 |
eclass/ruby-ng.eclass | 43 ++++++++++++++++++++++++++++++------------- |
38 |
|
39 |
modified eclass/ruby-ng.eclass |
40 |
@@ -73,7 +73,14 @@ |
41 |
# (e.g. selenium's firefox driver extension). When set this argument |
42 |
is |
43 |
# passed to "grep -E" to remove reporting of these shared objects. |
44 |
|
45 |
-inherit eutils java-utils-2 multilib toolchain-funcs ruby-utils |
46 |
+local inherits="" |
47 |
+case ${EAPI} in |
48 |
+ 2|3|4|5) |
49 |
+ inherits="eutils" |
50 |
+ ;; |
51 |
+esac |
52 |
+ |
53 |
+inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils |
54 |
|
55 |
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile |
56 |
src_test src_install pkg_setup |
57 |
|
58 |
@@ -399,15 +406,24 @@ ruby-ng_src_unpack() { |
59 |
} |
60 |
|
61 |
_ruby_apply_patches() { |
62 |
- for patch in "${RUBY_PATCHES[@]}"; do |
63 |
- if [ -f "${patch}" ]; then |
64 |
- epatch "${patch}" |
65 |
- elif [ -f "${FILESDIR}/${patch}" ]; then |
66 |
- epatch "${FILESDIR}/${patch}" |
67 |
- else |
68 |
- die "Cannot find patch ${patch}" |
69 |
- fi |
70 |
- done |
71 |
+ case ${EAPI} in |
72 |
+ 2|3|4|5) |
73 |
+ for patch in "${RUBY_PATCHES[@]}"; do |
74 |
+ if [ -f "${patch}" ]; then |
75 |
+ epatch "${patch}" |
76 |
+ elif [ -f "${FILESDIR}/${patch}" ]; |
77 |
then |
78 |
+ epatch "${FILESDIR}/${patch}" |
79 |
+ else |
80 |
+ die "Cannot find patch |
81 |
${patch}" |
82 |
+ fi |
83 |
+ done |
84 |
+ ;; |
85 |
+ 6) |
86 |
+ if [[ -n ${RUBY_PATCHES[@]} ]]; then |
87 |
+ eqawarn "RUBY_PATCHES is no longer |
88 |
supported, use PATCHES instead" |
89 |
+ fi |
90 |
+ ;; |
91 |
+ esac |
92 |
|
93 |
# This is a special case: instead of executing just in the |
94 |
special |
95 |
# "all" environment, this will actually copy the effects on |
96 |
_all_ |
97 |
@@ -432,14 +448,15 @@ ruby-ng_src_prepare() { |
98 |
# almost every other ebuild. |
99 |
find . -name '._*' -delete |
100 |
|
101 |
- _ruby_invoke_environment all _ruby_apply_patches |
102 |
- |
103 |
+ # Handle PATCHES and user supplied patches via the default |
104 |
phase |
105 |
case ${EAPI} in |
106 |
6) |
107 |
- eapply_user |
108 |
+ _ruby_invoke_environment all default |
109 |
;; |
110 |
esac |
111 |
|
112 |
+ _ruby_invoke_environment all _ruby_apply_patches |
113 |
+ |
114 |
_PHASE="source copy" \ |
115 |
_ruby_each_implementation _ruby_source_copy |
116 |
|