Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: xorg-2.eclass
Date: Mon, 28 Feb 2011 18:16:50
Message-Id: 20110228181640.2309F20054@flycatcher.gentoo.org
1 mgorny 11/02/28 18:16:40
2
3 Modified: xorg-2.eclass
4 Log:
5 Sync eclass from the x11 overlay.
6
7 Changes:
8 - use of autotools-utils, with out of tree builds by default;
9 - complete .la file removal,
10 - common doc and video driver dependency handling,
11 - simplified font encoding disable calls (with new enough util-macros).
12
13 Revision Changes Path
14 1.24 eclass/xorg-2.eclass
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/xorg-2.eclass?rev=1.24&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/xorg-2.eclass?rev=1.24&content-type=text/plain
18 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/xorg-2.eclass?r1=1.23&r2=1.24
19
20 Index: xorg-2.eclass
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v
23 retrieving revision 1.23
24 retrieving revision 1.24
25 diff -u -r1.23 -r1.24
26 --- xorg-2.eclass 15 Feb 2011 12:13:58 -0000 1.23
27 +++ xorg-2.eclass 28 Feb 2011 18:16:40 -0000 1.24
28 @@ -1,6 +1,6 @@
29 # Copyright 1999-2010 Gentoo Foundation
30 # Distributed under the terms of the GNU General Public License v2
31 -# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.23 2011/02/15 12:13:58 scarabeus Exp $
32 +# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.24 2011/02/28 18:16:40 mgorny Exp $
33 #
34 # @ECLASS: xorg-2.eclass
35 # @MAINTAINER:
36 @@ -38,7 +38,7 @@
37 FONT_ECLASS="font"
38 fi
39
40 -inherit eutils base libtool multilib toolchain-funcs flag-o-matic autotools \
41 +inherit autotools-utils eutils libtool multilib toolchain-funcs flag-o-matic autotools \
42 ${FONT_ECLASS} ${GIT_ECLASS}
43
44 EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm"
45 @@ -68,28 +68,28 @@
46 # inherit to override the default autoconfigured module.
47 if [[ -z ${MODULE} ]]; then
48 case ${CATEGORY} in
49 - app-doc) MODULE="doc" ;;
50 - media-fonts) MODULE="font" ;;
51 - x11-apps|x11-wm) MODULE="app" ;;
52 - x11-misc|x11-themes) MODULE="util" ;;
53 - x11-drivers) MODULE="driver" ;;
54 - x11-base) MODULE="xserver" ;;
55 - x11-proto) MODULE="proto" ;;
56 - x11-libs) MODULE="lib" ;;
57 - *) MODULE="" ;;
58 + app-doc) MODULE=doc/ ;;
59 + media-fonts) MODULE=font/ ;;
60 + x11-apps|x11-wm) MODULE=app/ ;;
61 + x11-misc|x11-themes) MODULE=util/ ;;
62 + x11-base) MODULE=xserver/ ;;
63 + x11-drivers) MODULE=driver/ ;;
64 + x11-proto) MODULE=proto/ ;;
65 + x11-libs) MODULE=lib/ ;;
66 + *) MODULE= ;;
67 esac
68 fi
69
70 # @ECLASS-VARIABLE: PACKAGE_NAME
71 # @DESCRIPTION:
72 -# For git checkout the git repository migth differ from package name.
73 +# For git checkout the git repository might differ from package name.
74 # This variable can be used for proper directory specification
75 : ${PACKAGE_NAME:=${PN}}
76
77 if [[ -n ${GIT_ECLASS} ]]; then
78 - EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PACKAGE_NAME}"
79 + EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}${PACKAGE_NAME}"
80 else
81 - SRC_URI+=" ${BASE_INDIVIDUAL_URI}/${MODULE}/${P}.tar.bz2"
82 + SRC_URI+=" ${BASE_INDIVIDUAL_URI}/${MODULE}${P}.tar.bz2"
83 fi
84
85 : ${SLOT:=0}
86 @@ -174,9 +174,54 @@
87
88 DEPEND+=" >=dev-util/pkgconfig-0.23"
89
90 -# Check deps on xorg-server
91 -has dri ${IUSE//+} && DEPEND+=" dri? ( >=x11-base/xorg-server-1.6.3.901-r2[-minimal] )"
92 -[[ -n "${DRIVER}" ]] && DEPEND+=" x11-base/xorg-server[xorg]"
93 +# Check deps on drivers
94 +if has dri ${IUSE//+}; then
95 + COMMON_DEPEND+=" dri? (
96 + x11-base/xorg-server[-minimal]
97 + x11-libs/libdrm
98 + )"
99 + DEPEND+=" dri? (
100 + x11-proto/xf86driproto
101 + x11-proto/glproto
102 + x11-proto/dri2proto
103 + )"
104 +fi
105 +if [[ -n "${DRIVER}" ]]; then
106 + COMMON_DEPEND+="
107 + x11-base/xorg-server[xorg]
108 + x11-libs/libpciaccess
109 + "
110 + # we also needs some protos and libs in all cases
111 + DEPEND+="
112 + x11-proto/fontsproto
113 + x11-proto/randrproto
114 + x11-proto/renderproto
115 + x11-proto/videoproto
116 + x11-proto/xextproto
117 + x11-proto/xineramaproto
118 + x11-proto/xproto
119 + "
120 +fi
121 +
122 +# Add deps on documentation
123 +# Most docbooks use dtd version 4.2 and 4.3 add more when found
124 +if has doc ${IUSE//+}; then
125 + DEPEND+="
126 + doc? (
127 + app-text/xmlto
128 + app-doc/doxygen
129 + app-text/docbook-xml-dtd:4.2
130 + app-text/docbook-xml-dtd:4.3
131 + )
132 + "
133 +fi
134 +
135 +DEPEND+=" ${COMMON_DEPEND}"
136 +RDEPEND+=" ${COMMON_DEPEND}"
137 +unset COMMON_DEPEND
138 +
139 +debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}"
140 +debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
141
142 # @FUNCTION: xorg-2_pkg_setup
143 # @DESCRIPTION:
144 @@ -214,7 +259,7 @@
145 EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch}
146
147 [[ -d "${EPATCH_SOURCE}" ]] && epatch
148 - base_src_prepare "$@"
149 + autotools-utils_src_prepare "$@"
150 }
151
152 # @FUNCTION: xorg-2_reconf_source
153 @@ -253,24 +298,29 @@
154 debug-print-function ${FUNCNAME} "$@"
155
156 if has nls ${IUSE//+} && ! use nls; then
157 - FONT_OPTIONS+="
158 - --disable-iso8859-2
159 - --disable-iso8859-3
160 - --disable-iso8859-4
161 - --disable-iso8859-5
162 - --disable-iso8859-6
163 - --disable-iso8859-7
164 - --disable-iso8859-8
165 - --disable-iso8859-9
166 - --disable-iso8859-10
167 - --disable-iso8859-11
168 - --disable-iso8859-12
169 - --disable-iso8859-13
170 - --disable-iso8859-14
171 - --disable-iso8859-15
172 - --disable-iso8859-16
173 - --disable-jisx0201
174 - --disable-koi8-r"
175 + if grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then
176 + FONT_OPTIONS+="
177 + --disable-all-encodings"
178 + else
179 + FONT_OPTIONS+="
180 + --disable-iso8859-2
181 + --disable-iso8859-3
182 + --disable-iso8859-4
183 + --disable-iso8859-5
184 + --disable-iso8859-6
185 + --disable-iso8859-7
186 + --disable-iso8859-8
187 + --disable-iso8859-9
188 + --disable-iso8859-10
189 + --disable-iso8859-11
190 + --disable-iso8859-12
191 + --disable-iso8859-13
192 + --disable-iso8859-14
193 + --disable-iso8859-15
194 + --disable-iso8859-16
195 + --disable-jisx0201
196 + --disable-koi8-r"
197 + fi
198 fi
199 }
200
201 @@ -298,25 +348,23 @@
202 # Perform any necessary pre-configuration steps, then run configure
203 xorg-2_src_configure() {
204 debug-print-function ${FUNCNAME} "$@"
205 - local myopts=""
206
207 xorg-2_flags_setup
208 - [[ -n "${FONT}" ]] && xorg-2_font_configure
209
210 # @VARIABLE: CONFIGURE_OPTIONS
211 # @DESCRIPTION:
212 # Any options to pass to configure
213 # @DEFAULT_UNSET
214 CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""}
215 - if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
216 - if has static-libs ${IUSE//+}; then
217 - myopts+=" $(use_enable static-libs static)"
218 - fi
219 - econf \
220 - ${FONT_OPTIONS} \
221 - ${CONFIGURE_OPTIONS} \
222 - ${myopts}
223 - fi
224 +
225 + [[ -n "${FONT}" ]] && xorg-2_font_configure
226 + local myeconfargs=(
227 + --disable-dependency-tracking
228 + ${CONFIGURE_OPTIONS}
229 + ${FONT_OPTIONS}
230 + )
231 +
232 + autotools-utils_src_configure "$@"
233 }
234
235 # @FUNCTION: xorg-2_src_compile
236 @@ -325,7 +373,7 @@
237 xorg-2_src_compile() {
238 debug-print-function ${FUNCNAME} "$@"
239
240 - base_src_compile "$@"
241 + autotools-utils_src_compile "$@"
242 }
243
244 # @FUNCTION: xorg-2_src_install
245 @@ -336,16 +384,12 @@
246 debug-print-function ${FUNCNAME} "$@"
247
248 if [[ ${CATEGORY} == x11-proto ]]; then
249 - emake \
250 - ${PN/proto/}docdir=${EPREFIX}/usr/share/doc/${PF} \
251 - docdir=${EPREFIX}/usr/share/doc/${PF} \
252 - DESTDIR="${D}" \
253 - install || die "emake install failed"
254 + autotools-utils_src_install \
255 + ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}" \
256 + docdir="${EPREFIX}/usr/share/doc/${PF}"
257 else
258 - emake \
259 - docdir=${EPREFIX}/usr/share/doc/${PF} \
260 - DESTDIR="${D}" \
261 - install || die "emake install failed"
262 + autotools-utils_src_install \
263 + docdir="${EPREFIX}/usr/share/doc/${PF}"
264 fi
265
266 if [[ -n ${GIT_ECLASS} ]]; then
267 @@ -357,19 +401,9 @@
268 if [[ -e "${S}"/ChangeLog ]]; then
269 dodoc "${S}"/ChangeLog || die "dodoc failed"
270 fi
271 - # @VARIABLE: DOCS
272 - # @DESCRIPTION:
273 - # Any documentation to install
274 - # @DEFAULT_UNSET
275 - if [[ -n ${DOCS} ]]; then
276 - dodoc ${DOCS} || die "dodoc failed"
277 - fi
278
279 - # Don't install libtool archives for server modules
280 - if [[ -e "${D%/}${EPREFIX}/usr/$(get_libdir)/xorg/modules" ]]; then
281 - find "${D%/}${EPREFIX}/usr/$(get_libdir)/xorg/modules" -name '*.la' \
282 - -exec rm -f {} ';'
283 - fi
284 + # Don't install libtool archives (even with static-libs)
285 + remove_libtool_files all
286
287 [[ -n ${FONT} ]] && remove_font_metadata
288 }