Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: gentoo-dev@l.g.o
Cc: x11@g.o
Subject: [gentoo-dev] [PATCH 1/7] xorg-2.eclass: drop autotools-utils
Date: Sun, 17 Apr 2016 14:14:48
Message-Id: 1460902427-5759-2-git-send-email-floppym@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/7] Dropping autotools-utils from xorg-2 by Mike Gilbert
1 ---
2 eclass/xorg-2.eclass | 73 +++++++++++++++++++++++++++++++++++-----------------
3 1 file changed, 49 insertions(+), 24 deletions(-)
4
5 diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass
6 index 437265a..f6cf1f9 100644
7 --- a/eclass/xorg-2.eclass
8 +++ b/eclass/xorg-2.eclass
9 @@ -43,12 +43,14 @@ fi
10 # before inheriting this eclass.
11 : ${XORG_MULTILIB:="no"}
12
13 -# we need to inherit autotools first to get the deps
14 -inherit autotools autotools-utils eutils libtool multilib toolchain-funcs \
15 +# Manage AUTOTOOLS_DEPEND ourselves
16 +: ${AUTOTOOLS_AUTO_DEPEND:="no"}
17 +
18 +inherit autotools eutils libtool multilib toolchain-funcs \
19 flag-o-matic ${FONT_ECLASS} ${GIT_ECLASS}
20
21 if [[ ${XORG_MULTILIB} == yes ]]; then
22 - inherit autotools-multilib
23 + inherit multilib-minimal
24 fi
25
26 EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm"
27 @@ -124,13 +126,11 @@ if [[ ${PN} != util-macros ]] ; then
28 # Required even by xorg-server
29 [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0"
30 fi
31 -WANT_AUTOCONF="latest"
32 -WANT_AUTOMAKE="latest"
33 for arch in ${XORG_EAUTORECONF_ARCHES}; do
34 - EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )"
35 + EAUTORECONF_DEPENDS+=" ${arch}? ( ${AUTOTOOLS_DEPEND} ${EAUTORECONF_DEPEND} )"
36 done
37 DEPEND+=" ${EAUTORECONF_DEPENDS}"
38 -[[ ${XORG_EAUTORECONF} != no ]] && DEPEND+=" ${EAUTORECONF_DEPEND}"
39 +[[ ${XORG_EAUTORECONF} != no ]] && DEPEND+=" ${AUTOTOOLS_DEPEND} ${EAUTORECONF_DEPEND}"
40 unset EAUTORECONF_DEPENDS
41 unset EAUTORECONF_DEPEND
42
43 @@ -350,6 +350,14 @@ xorg-2_patch_source() {
44 EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch}
45
46 [[ -d "${EPATCH_SOURCE}" ]] && epatch
47 +
48 + if [[ "$(declare -p PATCHES 2>/dev/null)" == "declare -a"* ]]; then
49 + epatch "${PATCHES[@]}"
50 + elif [[ -n ${PATCHES} ]]; then
51 + epatch ${PATCHES}
52 + fi
53 +
54 + epatch_user
55 }
56
57 # @FUNCTION: xorg-2_reconf_source
58 @@ -358,18 +366,15 @@ xorg-2_patch_source() {
59 xorg-2_reconf_source() {
60 debug-print-function ${FUNCNAME} "$@"
61
62 + [[ -e configure.ac || -e configure.in ]] || return 0
63 +
64 + local run_ea=${XORG_EAUTORECONF}
65 +
66 case ${CHOST} in
67 - *-interix* | *-aix* | *-winnt*)
68 - # some hosts need full eautoreconf
69 - [[ -e "./configure.ac" || -e "./configure.in" ]] \
70 - && AUTOTOOLS_AUTORECONF=1
71 - ;;
72 - *)
73 - # elibtoolize required for BSD
74 - [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] \
75 - && AUTOTOOLS_AUTORECONF=1
76 - ;;
77 + *-interix* | *-aix* | *-winnt*) run_ea=yes ;;
78 esac
79 +
80 + [[ ${run_ea} == no ]] || eautoreconf
81 }
82
83 # @FUNCTION: xorg-2_src_prepare
84 @@ -380,7 +385,6 @@ xorg-2_src_prepare() {
85
86 xorg-2_patch_source
87 xorg-2_reconf_source
88 - autotools-utils_src_prepare "$@"
89 }
90
91 # @FUNCTION: xorg-2_font_configure
92 @@ -472,12 +476,18 @@ xorg-2_src_configure() {
93 ${dep_track}
94 ${FONT_OPTIONS}
95 "${xorgconfadd[@]}"
96 + "$@"
97 )
98
99 if [[ ${XORG_MULTILIB} == yes ]]; then
100 - autotools-multilib_src_configure "$@"
101 + if ! declare -f multilib_src_configure >/dev/null; then
102 + multilib_src_configure() {
103 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
104 + }
105 + fi
106 + multilib-minimal_src_configure
107 else
108 - autotools-utils_src_configure "$@"
109 + econf "${myeconfargs[@]}"
110 fi
111 }
112
113 @@ -487,10 +497,17 @@ xorg-2_src_configure() {
114 xorg-2_src_compile() {
115 debug-print-function ${FUNCNAME} "$@"
116
117 + local makeargs=( "$@" )
118 +
119 if [[ ${XORG_MULTILIB} == yes ]]; then
120 - autotools-multilib_src_compile "$@"
121 + if ! declare -f multilib_src_compile >/dev/null; then
122 + multilib_src_compile() {
123 + emake "${makeargs[@]}"
124 + }
125 + fi
126 + multilib-minimal_src_compile
127 else
128 - autotools-utils_src_compile "$@"
129 + emake "${makeargs[@]}"
130 fi
131 }
132
133 @@ -509,10 +526,18 @@ xorg-2_src_install() {
134 )
135 fi
136
137 + install_args+=( "$@" )
138 +
139 if [[ ${XORG_MULTILIB} == yes ]]; then
140 - autotools-multilib_src_install "${install_args[@]}"
141 + if ! declare -f multilib_src_install >/dev/null; then
142 + multilib_src_install() {
143 + emake DESTDIR="${D}" install "${install_args[@]}"
144 + }
145 + fi
146 + multilib-minimal_src_install
147 else
148 - autotools-utils_src_install "${install_args[@]}"
149 + emake DESTDIR="${D}" install "${install_args[@]}"
150 + einstalldocs
151 fi
152
153 if [[ -n ${GIT_ECLASS} ]]; then
154 --
155 2.8.1

Replies

Subject Author
Re: [gentoo-dev] [PATCH 1/7] xorg-2.eclass: drop autotools-utils Ian Stakenvicius <axs@g.o>