1 |
Nearly all the work is just removing uses of autotools-multilib and |
2 |
autotools-utils. The new code should work in EAPI 4 and 5. Don't add |
3 |
support for EAPI 6; that ship has already sailed. |
4 |
--- |
5 |
There are a number of trivial x11 bumps coming up, so I figured I'd try |
6 |
to finally add EAPI=7 support to xorg-2.eclass. This is lightly tested, |
7 |
and I don't feel like an expert at this, so any review and feedback is |
8 |
appreciated. |
9 |
|
10 |
I find the if-multilib ... fi blocks a little odd. Is there a better way |
11 |
to do that? |
12 |
|
13 |
eclass/xorg-2.eclass | 80 ++++++++++++++++++++++++++------------------ |
14 |
1 file changed, 48 insertions(+), 32 deletions(-) |
15 |
|
16 |
diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass |
17 |
index 74660e7f213..eb2aa1594b4 100644 |
18 |
--- a/eclass/xorg-2.eclass |
19 |
+++ b/eclass/xorg-2.eclass |
20 |
@@ -1,4 +1,4 @@ |
21 |
-# Copyright 1999-2017 Gentoo Foundation |
22 |
+# Copyright 1999-2019 Gentoo Authors |
23 |
# Distributed under the terms of the GNU General Public License v2 |
24 |
|
25 |
# @ECLASS: xorg-2.eclass |
26 |
@@ -7,7 +7,7 @@ |
27 |
# @AUTHOR: |
28 |
# Author: Tomáš Chvátal <scarabeus@g.o> |
29 |
# Author: Donnie Berkholz <dberkholz@g.o> |
30 |
-# @SUPPORTED_EAPIS: 4 5 |
31 |
+# @SUPPORTED_EAPIS: 4 5 7 |
32 |
# @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
33 |
# @DESCRIPTION: |
34 |
# This eclass makes trivial X ebuilds possible for apps, fonts, drivers, |
35 |
@@ -44,16 +44,16 @@ fi |
36 |
: ${XORG_MULTILIB:="no"} |
37 |
|
38 |
# we need to inherit autotools first to get the deps |
39 |
-inherit autotools autotools-utils eutils libtool multilib toolchain-funcs \ |
40 |
+inherit autotools eutils libtool multilib toolchain-funcs \ |
41 |
flag-o-matic ${FONT_ECLASS} ${GIT_ECLASS} |
42 |
|
43 |
if [[ ${XORG_MULTILIB} == yes ]]; then |
44 |
- inherit autotools-multilib |
45 |
+ inherit multilib-minimal |
46 |
fi |
47 |
|
48 |
-EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
49 |
+EXPORTED_FUNCTIONS="src_prepare src_configure src_unpack src_compile src_install pkg_postinst pkg_postrm" |
50 |
case "${EAPI:-0}" in |
51 |
- 4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
52 |
+ 4|5|7) ;; |
53 |
*) die "EAPI=${EAPI} is not supported" ;; |
54 |
esac |
55 |
|
56 |
@@ -129,7 +129,16 @@ for arch in ${XORG_EAUTORECONF_ARCHES}; do |
57 |
EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )" |
58 |
done |
59 |
DEPEND+=" ${EAUTORECONF_DEPENDS}" |
60 |
-[[ ${XORG_EAUTORECONF} != no ]] && DEPEND+=" ${EAUTORECONF_DEPEND}" |
61 |
+if [[ ${XORG_EAUTORECONF} != no ]] ; then |
62 |
+ case "${EAPI:-0}" in |
63 |
+ 4|5) |
64 |
+ DEPEND+=" ${EAUTORECONF_DEPEND}" |
65 |
+ ;; |
66 |
+ 7) |
67 |
+ BDEPEND+=" ${EAUTORECONF_DEPEND}" |
68 |
+ ;; |
69 |
+ esac |
70 |
+fi |
71 |
unset EAUTORECONF_DEPENDS |
72 |
unset EAUTORECONF_DEPEND |
73 |
|
74 |
@@ -311,20 +320,6 @@ xorg-2_src_unpack() { |
75 |
[[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
76 |
} |
77 |
|
78 |
-# @FUNCTION: xorg-2_patch_source |
79 |
-# @DESCRIPTION: |
80 |
-# Apply all patches |
81 |
-xorg-2_patch_source() { |
82 |
- debug-print-function ${FUNCNAME} "$@" |
83 |
- |
84 |
- # Use standardized names and locations with bulk patching |
85 |
- # Patch directory is ${WORKDIR}/patch |
86 |
- # See epatch() in eutils.eclass for more documentation |
87 |
- EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
88 |
- |
89 |
- [[ -d "${EPATCH_SOURCE}" ]] && epatch |
90 |
-} |
91 |
- |
92 |
# @FUNCTION: xorg-2_reconf_source |
93 |
# @DESCRIPTION: |
94 |
# Run eautoreconf if necessary, and run elibtoolize. |
95 |
@@ -335,14 +330,17 @@ xorg-2_reconf_source() { |
96 |
*-aix* | *-winnt*) |
97 |
# some hosts need full eautoreconf |
98 |
[[ -e "./configure.ac" || -e "./configure.in" ]] \ |
99 |
- && AUTOTOOLS_AUTORECONF=1 |
100 |
+ && XORG_EAUTORECONF=yes |
101 |
;; |
102 |
*) |
103 |
# elibtoolize required for BSD |
104 |
[[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] \ |
105 |
- && AUTOTOOLS_AUTORECONF=1 |
106 |
+ && XORG_EAUTORECONF=yes |
107 |
;; |
108 |
esac |
109 |
+ |
110 |
+ [[ ${XORG_EAUTORECONF} != no ]] && eautoreconf |
111 |
+ elibtoolize --patch-only |
112 |
} |
113 |
|
114 |
# @FUNCTION: xorg-2_src_prepare |
115 |
@@ -351,9 +349,10 @@ xorg-2_reconf_source() { |
116 |
xorg-2_src_prepare() { |
117 |
debug-print-function ${FUNCNAME} "$@" |
118 |
|
119 |
- xorg-2_patch_source |
120 |
+ default |
121 |
xorg-2_reconf_source |
122 |
- autotools-utils_src_prepare "$@" |
123 |
+ |
124 |
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" |
125 |
} |
126 |
|
127 |
# @FUNCTION: xorg-2_font_configure |
128 |
@@ -447,17 +446,28 @@ xorg-2_src_configure() { |
129 |
local selective_werror="--disable-selective-werror" |
130 |
fi |
131 |
|
132 |
- local myeconfargs=( |
133 |
+ local econfargs=( |
134 |
${dep_track} |
135 |
${selective_werror} |
136 |
${FONT_OPTIONS} |
137 |
"${xorgconfadd[@]}" |
138 |
) |
139 |
|
140 |
+ # Handle static-libs found in IUSE, disable them by default |
141 |
+ if in_iuse static-libs; then |
142 |
+ econfargs+=( |
143 |
+ --enable-shared |
144 |
+ $(use_enable static-libs static) |
145 |
+ ) |
146 |
+ fi |
147 |
+ |
148 |
if [[ ${XORG_MULTILIB} == yes ]]; then |
149 |
- autotools-multilib_src_configure "$@" |
150 |
+ multilib_src_configure() { |
151 |
+ ECONF_SOURCE="${S}" econf "${econfargs[@]}" |
152 |
+ } |
153 |
+ multilib-minimal_src_configure "$@" |
154 |
else |
155 |
- autotools-utils_src_configure "$@" |
156 |
+ econf "${econfargs[@]}" "$@" |
157 |
fi |
158 |
} |
159 |
|
160 |
@@ -468,9 +478,12 @@ xorg-2_src_compile() { |
161 |
debug-print-function ${FUNCNAME} "$@" |
162 |
|
163 |
if [[ ${XORG_MULTILIB} == yes ]]; then |
164 |
- autotools-multilib_src_compile "$@" |
165 |
+ multilib_src_compile() { |
166 |
+ emake "$@" || die 'emake failed' |
167 |
+ } |
168 |
+ multilib-minimal_src_compile "$@" |
169 |
else |
170 |
- autotools-utils_src_compile "$@" |
171 |
+ emake "$@" || die 'emake failed' |
172 |
fi |
173 |
} |
174 |
|
175 |
@@ -484,9 +497,12 @@ xorg-2_src_install() { |
176 |
local install_args=( docdir="${EPREFIX}/usr/share/doc/${PF}" ) |
177 |
|
178 |
if [[ ${XORG_MULTILIB} == yes ]]; then |
179 |
- autotools-multilib_src_install "${install_args[@]}" |
180 |
+ multilib_src_install() { |
181 |
+ emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed" |
182 |
+ } |
183 |
+ multilib-minimal_src_install "$@" |
184 |
else |
185 |
- autotools-utils_src_install "${install_args[@]}" |
186 |
+ emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed" |
187 |
fi |
188 |
|
189 |
if [[ -n ${GIT_ECLASS} ]]; then |
190 |
-- |
191 |
2.19.2 |