| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.21 2011/01/06 11:01:59 scarabeus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.51 2011/11/01 13:51:05 chithanh Exp $ |
| 4 | # |
4 | |
| 5 | # @ECLASS: xorg-2.eclass |
5 | # @ECLASS: xorg-2.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # x11@gentoo.org |
7 | # x11@gentoo.org |
|
|
8 | # @AUTHOR: |
|
|
9 | # Author: Tomáš Chvátal <scarabeus@gentoo.org> |
|
|
10 | # Author: Donnie Berkholz <dberkholz@gentoo.org> |
| 8 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
11 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
| 9 | # @DESCRIPTION: |
12 | # @DESCRIPTION: |
| 10 | # This eclass makes trivial X ebuilds possible for apps, fonts, drivers, |
13 | # This eclass makes trivial X ebuilds possible for apps, fonts, drivers, |
| 11 | # and more. Many things that would normally be done in various functions |
14 | # and more. Many things that would normally be done in various functions |
| 12 | # can be accessed by setting variables instead, such as patching, |
15 | # can be accessed by setting variables instead, such as patching, |
| … | |
… | |
| 15 | # All you need to do in a basic ebuild is inherit this eclass and set |
18 | # All you need to do in a basic ebuild is inherit this eclass and set |
| 16 | # DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted |
19 | # DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted |
| 17 | # with the other X packages, you don't need to set SRC_URI. Pretty much |
20 | # with the other X packages, you don't need to set SRC_URI. Pretty much |
| 18 | # everything else should be automatic. |
21 | # everything else should be automatic. |
| 19 | |
22 | |
| 20 | # Author: Tomáš Chvátal <scarabeus@gentoo.org> |
|
|
| 21 | # Author: Donnie Berkholz <dberkholz@gentoo.org> |
|
|
| 22 | |
|
|
| 23 | GIT_ECLASS="" |
23 | GIT_ECLASS="" |
| 24 | if [[ ${PV} == *9999* ]]; then |
24 | if [[ ${PV} == *9999* ]]; then |
| 25 | GIT_ECLASS="git" |
25 | GIT_ECLASS="git-2" |
| 26 | XORG_EAUTORECONF="yes" |
26 | XORG_EAUTORECONF="yes" |
| 27 | SRC_URI="" |
|
|
| 28 | fi |
27 | fi |
| 29 | |
28 | |
| 30 | # If we're a font package, but not the font.alias one |
29 | # If we're a font package, but not the font.alias one |
| 31 | FONT_ECLASS="" |
30 | FONT_ECLASS="" |
| 32 | if [[ ${PN} == font* \ |
31 | if [[ ${PN} == font* \ |
| … | |
… | |
| 36 | # Activate font code in the rest of the eclass |
35 | # Activate font code in the rest of the eclass |
| 37 | FONT="yes" |
36 | FONT="yes" |
| 38 | FONT_ECLASS="font" |
37 | FONT_ECLASS="font" |
| 39 | fi |
38 | fi |
| 40 | |
39 | |
| 41 | inherit eutils base libtool multilib toolchain-funcs flag-o-matic autotools \ |
40 | inherit autotools-utils eutils libtool multilib toolchain-funcs flag-o-matic autotools \ |
| 42 | ${FONT_ECLASS} ${GIT_ECLASS} |
41 | ${FONT_ECLASS} ${GIT_ECLASS} |
| 43 | |
42 | |
| 44 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
43 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
| 45 | case "${EAPI:-0}" in |
44 | case "${EAPI:-0}" in |
| 46 | 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
45 | 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
| 47 | *) die "EAPI-UNSUPPORTED" ;; |
46 | *) die "EAPI=${EAPI} is not supported" ;; |
| 48 | esac |
47 | esac |
| 49 | |
48 | |
| 50 | # exports must be ALWAYS after inherit |
49 | # exports must be ALWAYS after inherit |
| 51 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
50 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
| 52 | |
51 | |
| … | |
… | |
| 57 | # @DESCRIPTION: |
56 | # @DESCRIPTION: |
| 58 | # If set to 'yes' and configure.ac exists, eautoreconf will run. Set |
57 | # If set to 'yes' and configure.ac exists, eautoreconf will run. Set |
| 59 | # before inheriting this eclass. |
58 | # before inheriting this eclass. |
| 60 | : ${XORG_EAUTORECONF:="no"} |
59 | : ${XORG_EAUTORECONF:="no"} |
| 61 | |
60 | |
|
|
61 | # @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI |
|
|
62 | # @DESCRIPTION: |
| 62 | # Set up SRC_URI for individual modular releases |
63 | # Set up SRC_URI for individual modular releases. If set to an empty |
|
|
64 | # string, no SRC_URI will be provided by the eclass. |
| 63 | BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" |
65 | : ${XORG_BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"} |
|
|
66 | |
| 64 | # @ECLASS-VARIABLE: MODULE |
67 | # @ECLASS-VARIABLE: XORG_MODULE |
| 65 | # @DESCRIPTION: |
68 | # @DESCRIPTION: |
| 66 | # The subdirectory to download source from. Possible settings are app, |
69 | # The subdirectory to download source from. Possible settings are app, |
| 67 | # doc, data, util, driver, font, lib, proto, xserver. Set above the |
70 | # doc, data, util, driver, font, lib, proto, xserver. Set above the |
| 68 | # inherit to override the default autoconfigured module. |
71 | # inherit to override the default autoconfigured module. |
| 69 | if [[ -z ${MODULE} ]]; then |
72 | if [[ -z ${XORG_MODULE} ]]; then |
| 70 | case ${CATEGORY} in |
73 | case ${CATEGORY} in |
| 71 | app-doc) MODULE="doc" ;; |
74 | app-doc) XORG_MODULE=doc/ ;; |
| 72 | media-fonts) MODULE="font" ;; |
75 | media-fonts) XORG_MODULE=font/ ;; |
| 73 | x11-apps|x11-wm) MODULE="app" ;; |
76 | x11-apps|x11-wm) XORG_MODULE=app/ ;; |
| 74 | x11-misc|x11-themes) MODULE="util" ;; |
77 | x11-misc|x11-themes) XORG_MODULE=util/ ;; |
| 75 | x11-drivers) MODULE="driver" ;; |
|
|
| 76 | x11-base) MODULE="xserver" ;; |
78 | x11-base) XORG_MODULE=xserver/ ;; |
|
|
79 | x11-drivers) XORG_MODULE=driver/ ;; |
| 77 | x11-proto) MODULE="proto" ;; |
80 | x11-proto) XORG_MODULE=proto/ ;; |
| 78 | x11-libs) MODULE="lib" ;; |
81 | x11-libs) XORG_MODULE=lib/ ;; |
| 79 | *) MODULE="" ;; |
82 | *) XORG_MODULE= ;; |
| 80 | esac |
83 | esac |
| 81 | fi |
84 | fi |
| 82 | |
85 | |
| 83 | # @ECLASS-VARIABLE: PACKAGE_NAME |
86 | # @ECLASS-VARIABLE: XORG_PACKAGE_NAME |
| 84 | # @DESCRIPTION: |
87 | # @DESCRIPTION: |
| 85 | # For git checkout the git repository migth differ from package name. |
88 | # For git checkout the git repository might differ from package name. |
| 86 | # This variable can be used for proper directory specification |
89 | # This variable can be used for proper directory specification |
| 87 | : ${PACKAGE_NAME:=${PN}} |
90 | : ${XORG_PACKAGE_NAME:=${PN}} |
| 88 | |
91 | |
| 89 | if [[ -n ${GIT_ECLASS} ]]; then |
92 | if [[ -n ${GIT_ECLASS} ]]; then |
| 90 | EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PACKAGE_NAME}" |
93 | : ${EGIT_REPO_URI:="git://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME} http://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}"} |
| 91 | else |
94 | elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then |
| 92 | SRC_URI+=" ${BASE_INDIVIDUAL_URI}/${MODULE}/${P}.tar.bz2" |
95 | SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2" |
| 93 | fi |
96 | fi |
| 94 | |
97 | |
| 95 | : ${SLOT:=0} |
98 | : ${SLOT:=0} |
| 96 | |
99 | |
| 97 | # Set the license for the package. This can be overridden by setting |
100 | # Set the license for the package. This can be overridden by setting |
| … | |
… | |
| 104 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
107 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
| 105 | EAUTORECONF_DEPEND+=" |
108 | EAUTORECONF_DEPEND+=" |
| 106 | >=sys-devel/libtool-2.2.6a |
109 | >=sys-devel/libtool-2.2.6a |
| 107 | sys-devel/m4" |
110 | sys-devel/m4" |
| 108 | if [[ ${PN} != util-macros ]] ; then |
111 | if [[ ${PN} != util-macros ]] ; then |
| 109 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.11.0" |
112 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.15.0" |
| 110 | # Required even by xorg-server |
113 | # Required even by xorg-server |
| 111 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.1.1-r1" |
114 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" |
| 112 | fi |
115 | fi |
| 113 | WANT_AUTOCONF="latest" |
116 | WANT_AUTOCONF="latest" |
| 114 | WANT_AUTOMAKE="latest" |
117 | WANT_AUTOMAKE="latest" |
| 115 | for arch in ${XORG_EAUTORECONF_ARCHES}; do |
118 | for arch in ${XORG_EAUTORECONF_ARCHES}; do |
| 116 | EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )" |
119 | EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )" |
| … | |
… | |
| 123 | if [[ ${FONT} == yes ]]; then |
126 | if [[ ${FONT} == yes ]]; then |
| 124 | RDEPEND+=" media-fonts/encodings |
127 | RDEPEND+=" media-fonts/encodings |
| 125 | x11-apps/mkfontscale |
128 | x11-apps/mkfontscale |
| 126 | x11-apps/mkfontdir" |
129 | x11-apps/mkfontdir" |
| 127 | PDEPEND+=" media-fonts/font-alias" |
130 | PDEPEND+=" media-fonts/font-alias" |
| 128 | DEPEND+=" >=media-fonts/font-util-1.1.1-r1" |
131 | DEPEND+=" >=media-fonts/font-util-1.2.0" |
| 129 | |
132 | |
| 130 | # @ECLASS-VARIABLE: FONT_DIR |
133 | # @ECLASS-VARIABLE: FONT_DIR |
| 131 | # @DESCRIPTION: |
134 | # @DESCRIPTION: |
| 132 | # If you're creating a font package and the suffix of PN is not equal to |
135 | # If you're creating a font package and the suffix of PN is not equal to |
| 133 | # the subdirectory of /usr/share/fonts/ it should install into, set |
136 | # the subdirectory of /usr/share/fonts/ it should install into, set |
| … | |
… | |
| 172 | IUSE+=" static-libs" |
175 | IUSE+=" static-libs" |
| 173 | fi |
176 | fi |
| 174 | |
177 | |
| 175 | DEPEND+=" >=dev-util/pkgconfig-0.23" |
178 | DEPEND+=" >=dev-util/pkgconfig-0.23" |
| 176 | |
179 | |
| 177 | # Check deps on xorg-server |
180 | # @ECLASS-VARIABLE: XORG_DRI |
| 178 | has dri ${IUSE//+} && DEPEND+=" dri? ( >=x11-base/xorg-server-1.6.3.901-r2[-minimal] )" |
181 | # @DESCRIPTION: |
| 179 | [[ -n "${DRIVER}" ]] && DEPEND+=" x11-base/xorg-server[xorg]" |
182 | # Possible values are "always" or the value of the useflag DRI capabilities |
|
|
183 | # are required for. Default value is "no" |
|
|
184 | # |
|
|
185 | # Eg. XORG_DRI="opengl" will pull all dri dependant deps for opengl useflag |
|
|
186 | : ${XORG_DRI:="no"} |
|
|
187 | |
|
|
188 | DRI_COMMON_DEPEND=" |
|
|
189 | x11-base/xorg-server[-minimal] |
|
|
190 | x11-libs/libdrm |
|
|
191 | " |
|
|
192 | DRI_DEPEND=" |
|
|
193 | x11-proto/xf86driproto |
|
|
194 | x11-proto/glproto |
|
|
195 | x11-proto/dri2proto |
|
|
196 | " |
|
|
197 | case ${XORG_DRI} in |
|
|
198 | no) |
|
|
199 | ;; |
|
|
200 | always) |
|
|
201 | COMMON_DEPEND+=" ${DRI_COMMON_DEPEND}" |
|
|
202 | DEPEND+=" ${DRI_DEPEND}" |
|
|
203 | ;; |
|
|
204 | *) |
|
|
205 | COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )" |
|
|
206 | DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )" |
|
|
207 | IUSE+=" ${XORG_DRI}" |
|
|
208 | ;; |
|
|
209 | esac |
|
|
210 | unset DRI_DEPEND |
|
|
211 | unset DRI_COMMONDEPEND |
|
|
212 | |
|
|
213 | if [[ -n "${DRIVER}" ]]; then |
|
|
214 | COMMON_DEPEND+=" |
|
|
215 | x11-base/xorg-server[xorg] |
|
|
216 | " |
|
|
217 | fi |
|
|
218 | if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then |
|
|
219 | DEPEND+=" |
|
|
220 | x11-proto/inputproto |
|
|
221 | x11-proto/kbproto |
|
|
222 | x11-proto/xproto |
|
|
223 | " |
|
|
224 | fi |
|
|
225 | if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
|
|
226 | COMMON_DEPEND+=" |
|
|
227 | x11-libs/libpciaccess |
|
|
228 | " |
|
|
229 | # we also needs some protos and libs in all cases |
|
|
230 | DEPEND+=" |
|
|
231 | x11-proto/fontsproto |
|
|
232 | x11-proto/randrproto |
|
|
233 | x11-proto/renderproto |
|
|
234 | x11-proto/videoproto |
|
|
235 | x11-proto/xextproto |
|
|
236 | x11-proto/xineramaproto |
|
|
237 | x11-proto/xproto |
|
|
238 | " |
|
|
239 | fi |
|
|
240 | |
|
|
241 | # @ECLASS-VARIABLE: XORG_DOC |
|
|
242 | # @DESCRIPTION: |
|
|
243 | # Possible values are "always" or the value of the useflag doc packages |
|
|
244 | # are required for. Default value is "no" |
|
|
245 | # |
|
|
246 | # Eg. XORG_DOC="manual" will pull all doc dependant deps for manual useflag |
|
|
247 | : ${XORG_DOC:="no"} |
|
|
248 | |
|
|
249 | DOC_DEPEND=" |
|
|
250 | doc? ( |
|
|
251 | app-text/asciidoc |
|
|
252 | app-text/xmlto |
|
|
253 | app-doc/doxygen |
|
|
254 | app-text/docbook-xml-dtd:4.1.2 |
|
|
255 | app-text/docbook-xml-dtd:4.2 |
|
|
256 | app-text/docbook-xml-dtd:4.3 |
|
|
257 | ) |
|
|
258 | " |
|
|
259 | case ${XORG_DOC} in |
|
|
260 | no) |
|
|
261 | ;; |
|
|
262 | always) |
|
|
263 | DEPEND+=" ${DOC_DEPEND}" |
|
|
264 | ;; |
|
|
265 | *) |
|
|
266 | DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )" |
|
|
267 | IUSE+=" ${XORG_DOC}" |
|
|
268 | ;; |
|
|
269 | esac |
|
|
270 | unset DOC_DEPEND |
|
|
271 | |
|
|
272 | DEPEND+=" ${COMMON_DEPEND}" |
|
|
273 | RDEPEND+=" ${COMMON_DEPEND}" |
|
|
274 | unset COMMON_DEPEND |
|
|
275 | |
|
|
276 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}" |
|
|
277 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}" |
|
|
278 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}" |
| 180 | |
279 | |
| 181 | # @FUNCTION: xorg-2_pkg_setup |
280 | # @FUNCTION: xorg-2_pkg_setup |
| 182 | # @DESCRIPTION: |
281 | # @DESCRIPTION: |
| 183 | # Setup prefix compat |
282 | # Setup prefix compat |
| 184 | xorg-2_pkg_setup() { |
283 | xorg-2_pkg_setup() { |
| … | |
… | |
| 192 | # Simply unpack source code. |
291 | # Simply unpack source code. |
| 193 | xorg-2_src_unpack() { |
292 | xorg-2_src_unpack() { |
| 194 | debug-print-function ${FUNCNAME} "$@" |
293 | debug-print-function ${FUNCNAME} "$@" |
| 195 | |
294 | |
| 196 | if [[ -n ${GIT_ECLASS} ]]; then |
295 | if [[ -n ${GIT_ECLASS} ]]; then |
| 197 | git_src_unpack |
296 | git-2_src_unpack |
| 198 | else |
297 | else |
| 199 | unpack ${A} |
298 | unpack ${A} |
| 200 | fi |
299 | fi |
| 201 | |
300 | |
| 202 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
301 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
| … | |
… | |
| 212 | # Patch directory is ${WORKDIR}/patch |
311 | # Patch directory is ${WORKDIR}/patch |
| 213 | # See epatch() in eutils.eclass for more documentation |
312 | # See epatch() in eutils.eclass for more documentation |
| 214 | EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
313 | EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
| 215 | |
314 | |
| 216 | [[ -d "${EPATCH_SOURCE}" ]] && epatch |
315 | [[ -d "${EPATCH_SOURCE}" ]] && epatch |
| 217 | base_src_prepare "$@" |
316 | autotools-utils_src_prepare "$@" |
| 218 | } |
317 | } |
| 219 | |
318 | |
| 220 | # @FUNCTION: xorg-2_reconf_source |
319 | # @FUNCTION: xorg-2_reconf_source |
| 221 | # @DESCRIPTION: |
320 | # @DESCRIPTION: |
| 222 | # Run eautoreconf if necessary, and run elibtoolize. |
321 | # Run eautoreconf if necessary, and run elibtoolize. |
| … | |
… | |
| 239 | # @DESCRIPTION: |
338 | # @DESCRIPTION: |
| 240 | # Prepare a package after unpacking, performing all X-related tasks. |
339 | # Prepare a package after unpacking, performing all X-related tasks. |
| 241 | xorg-2_src_prepare() { |
340 | xorg-2_src_prepare() { |
| 242 | debug-print-function ${FUNCNAME} "$@" |
341 | debug-print-function ${FUNCNAME} "$@" |
| 243 | |
342 | |
| 244 | [[ -n ${GIT_ECLASS} ]] && git_src_prepare |
|
|
| 245 | xorg-2_patch_source |
343 | xorg-2_patch_source |
| 246 | xorg-2_reconf_source |
344 | xorg-2_reconf_source |
| 247 | } |
345 | } |
| 248 | |
346 | |
| 249 | # @FUNCTION: xorg-2_font_configure |
347 | # @FUNCTION: xorg-2_font_configure |
| … | |
… | |
| 251 | # If a font package, perform any necessary configuration steps |
349 | # If a font package, perform any necessary configuration steps |
| 252 | xorg-2_font_configure() { |
350 | xorg-2_font_configure() { |
| 253 | debug-print-function ${FUNCNAME} "$@" |
351 | debug-print-function ${FUNCNAME} "$@" |
| 254 | |
352 | |
| 255 | if has nls ${IUSE//+} && ! use nls; then |
353 | if has nls ${IUSE//+} && ! use nls; then |
|
|
354 | if grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then |
| 256 | FONT_OPTIONS+=" |
355 | FONT_OPTIONS+=" |
|
|
356 | --disable-all-encodings" |
|
|
357 | else |
|
|
358 | FONT_OPTIONS+=" |
| 257 | --disable-iso8859-2 |
359 | --disable-iso8859-2 |
| 258 | --disable-iso8859-3 |
360 | --disable-iso8859-3 |
| 259 | --disable-iso8859-4 |
361 | --disable-iso8859-4 |
| 260 | --disable-iso8859-5 |
362 | --disable-iso8859-5 |
| 261 | --disable-iso8859-6 |
363 | --disable-iso8859-6 |
| 262 | --disable-iso8859-7 |
364 | --disable-iso8859-7 |
| 263 | --disable-iso8859-8 |
365 | --disable-iso8859-8 |
| 264 | --disable-iso8859-9 |
366 | --disable-iso8859-9 |
| 265 | --disable-iso8859-10 |
367 | --disable-iso8859-10 |
| 266 | --disable-iso8859-11 |
368 | --disable-iso8859-11 |
| 267 | --disable-iso8859-12 |
369 | --disable-iso8859-12 |
| 268 | --disable-iso8859-13 |
370 | --disable-iso8859-13 |
| 269 | --disable-iso8859-14 |
371 | --disable-iso8859-14 |
| 270 | --disable-iso8859-15 |
372 | --disable-iso8859-15 |
| 271 | --disable-iso8859-16 |
373 | --disable-iso8859-16 |
| 272 | --disable-jisx0201 |
374 | --disable-jisx0201 |
| 273 | --disable-koi8-r" |
375 | --disable-koi8-r" |
|
|
376 | fi |
| 274 | fi |
377 | fi |
| 275 | } |
378 | } |
| 276 | |
379 | |
| 277 | # @FUNCTION: xorg-2_flags_setup |
380 | # @FUNCTION: xorg-2_flags_setup |
| 278 | # @DESCRIPTION: |
381 | # @DESCRIPTION: |
| … | |
… | |
| 296 | # @FUNCTION: xorg-2_src_configure |
399 | # @FUNCTION: xorg-2_src_configure |
| 297 | # @DESCRIPTION: |
400 | # @DESCRIPTION: |
| 298 | # Perform any necessary pre-configuration steps, then run configure |
401 | # Perform any necessary pre-configuration steps, then run configure |
| 299 | xorg-2_src_configure() { |
402 | xorg-2_src_configure() { |
| 300 | debug-print-function ${FUNCNAME} "$@" |
403 | debug-print-function ${FUNCNAME} "$@" |
| 301 | local myopts="" |
|
|
| 302 | |
404 | |
| 303 | xorg-2_flags_setup |
405 | xorg-2_flags_setup |
|
|
406 | |
|
|
407 | # @VARIABLE: XORG_CONFIGURE_OPTIONS |
|
|
408 | # @DESCRIPTION: |
|
|
409 | # Array of an additional options to pass to configure. |
|
|
410 | # @DEFAULT_UNSET |
|
|
411 | if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then |
|
|
412 | # fallback to CONFIGURE_OPTIONS, deprecated. |
|
|
413 | if [[ -n "${CONFIGURE_OPTIONS}" ]]; then |
|
|
414 | eqawarn "CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS" |
|
|
415 | eqawarn "to preserve namespace." |
|
|
416 | fi |
|
|
417 | |
|
|
418 | local xorgconfadd=(${CONFIGURE_OPTIONS}) |
|
|
419 | else |
|
|
420 | local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}") |
|
|
421 | fi |
|
|
422 | |
| 304 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
423 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
| 305 | |
424 | local myeconfargs=( |
| 306 | # @VARIABLE: CONFIGURE_OPTIONS |
425 | --disable-dependency-tracking |
| 307 | # @DESCRIPTION: |
|
|
| 308 | # Any options to pass to configure |
|
|
| 309 | # @DEFAULT_UNSET |
|
|
| 310 | CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""} |
|
|
| 311 | if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then |
|
|
| 312 | if has static-libs ${IUSE//+}; then |
|
|
| 313 | myopts+=" $(use_enable static-libs static)" |
|
|
| 314 | fi |
|
|
| 315 | econf \ |
|
|
| 316 | ${FONT_OPTIONS} \ |
426 | ${FONT_OPTIONS} |
| 317 | ${CONFIGURE_OPTIONS} \ |
427 | "${xorgconfadd[@]}" |
| 318 | ${myopts} |
428 | ) |
| 319 | fi |
429 | |
|
|
430 | autotools-utils_src_configure "$@" |
| 320 | } |
431 | } |
| 321 | |
432 | |
| 322 | # @FUNCTION: xorg-2_src_compile |
433 | # @FUNCTION: xorg-2_src_compile |
| 323 | # @DESCRIPTION: |
434 | # @DESCRIPTION: |
| 324 | # Compile a package, performing all X-related tasks. |
435 | # Compile a package, performing all X-related tasks. |
| 325 | xorg-2_src_compile() { |
436 | xorg-2_src_compile() { |
| 326 | debug-print-function ${FUNCNAME} "$@" |
437 | debug-print-function ${FUNCNAME} "$@" |
| 327 | |
438 | |
| 328 | base_src_compile "$@" |
439 | autotools-utils_src_compile "$@" |
| 329 | } |
440 | } |
| 330 | |
441 | |
| 331 | # @FUNCTION: xorg-2_src_install |
442 | # @FUNCTION: xorg-2_src_install |
| 332 | # @DESCRIPTION: |
443 | # @DESCRIPTION: |
| 333 | # Install a built package to ${D}, performing any necessary steps. |
444 | # Install a built package to ${D}, performing any necessary steps. |
| 334 | # Creates a ChangeLog from git if using live ebuilds. |
445 | # Creates a ChangeLog from git if using live ebuilds. |
| 335 | xorg-2_src_install() { |
446 | xorg-2_src_install() { |
| 336 | debug-print-function ${FUNCNAME} "$@" |
447 | debug-print-function ${FUNCNAME} "$@" |
| 337 | |
448 | |
| 338 | if [[ ${CATEGORY} == x11-proto ]]; then |
449 | if [[ ${CATEGORY} == x11-proto ]]; then |
| 339 | emake \ |
450 | autotools-utils_src_install \ |
| 340 | ${PN/proto/}docdir=${EPREFIX}/usr/share/doc/${PF} \ |
451 | ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}" \ |
| 341 | docdir=${EPREFIX}/usr/share/doc/${PF} \ |
452 | docdir="${EPREFIX}/usr/share/doc/${PF}" |
| 342 | DESTDIR="${D}" \ |
|
|
| 343 | install || die "emake install failed" |
|
|
| 344 | else |
453 | else |
| 345 | emake \ |
454 | autotools-utils_src_install \ |
| 346 | docdir=${EPREFIX}/usr/share/doc/${PF} \ |
455 | docdir="${EPREFIX}/usr/share/doc/${PF}" |
| 347 | DESTDIR="${D}" \ |
|
|
| 348 | install || die "emake install failed" |
|
|
| 349 | fi |
456 | fi |
| 350 | |
457 | |
| 351 | if [[ -n ${GIT_ECLASS} ]]; then |
458 | if [[ -n ${GIT_ECLASS} ]]; then |
| 352 | pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null |
459 | pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null |
| 353 | git log ${EGIT_COMMIT} > "${S}"/ChangeLog |
460 | git log ${EGIT_COMMIT} > "${S}"/ChangeLog |
| … | |
… | |
| 355 | fi |
462 | fi |
| 356 | |
463 | |
| 357 | if [[ -e "${S}"/ChangeLog ]]; then |
464 | if [[ -e "${S}"/ChangeLog ]]; then |
| 358 | dodoc "${S}"/ChangeLog || die "dodoc failed" |
465 | dodoc "${S}"/ChangeLog || die "dodoc failed" |
| 359 | fi |
466 | fi |
| 360 | # @VARIABLE: DOCS |
|
|
| 361 | # @DESCRIPTION: |
|
|
| 362 | # Any documentation to install |
|
|
| 363 | # @DEFAULT_UNSET |
|
|
| 364 | if [[ -n ${DOCS} ]]; then |
|
|
| 365 | dodoc ${DOCS} || die "dodoc failed" |
|
|
| 366 | fi |
|
|
| 367 | |
467 | |
| 368 | # Don't install libtool archives for server modules |
468 | # Don't install libtool archives (even with static-libs) |
| 369 | if [[ -e "${D%/}${EPREFIX}/usr/$(get_libdir)/xorg/modules" ]]; then |
469 | remove_libtool_files all |
| 370 | find "${D%/}${EPREFIX}/usr/$(get_libdir)/xorg/modules" -name '*.la' \ |
|
|
| 371 | -exec rm -f {} ';' |
|
|
| 372 | fi |
|
|
| 373 | |
470 | |
| 374 | [[ -n ${FONT} ]] && remove_font_metadata |
471 | [[ -n ${FONT} ]] && remove_font_metadata |
| 375 | } |
472 | } |
| 376 | |
473 | |
| 377 | # @FUNCTION: xorg-2_pkg_postinst |
474 | # @FUNCTION: xorg-2_pkg_postinst |
| … | |
… | |
| 379 | # Run X-specific post-installation tasks on the live filesystem. The |
476 | # Run X-specific post-installation tasks on the live filesystem. The |
| 380 | # only task right now is some setup for font packages. |
477 | # only task right now is some setup for font packages. |
| 381 | xorg-2_pkg_postinst() { |
478 | xorg-2_pkg_postinst() { |
| 382 | debug-print-function ${FUNCNAME} "$@" |
479 | debug-print-function ${FUNCNAME} "$@" |
| 383 | |
480 | |
| 384 | [[ -n ${FONT} ]] && setup_fonts "$@" |
481 | if [[ -n ${FONT} ]]; then |
|
|
482 | create_fonts_scale |
|
|
483 | create_fonts_dir |
|
|
484 | font_pkg_postinst "$@" |
|
|
485 | fi |
| 385 | } |
486 | } |
| 386 | |
487 | |
| 387 | # @FUNCTION: xorg-2_pkg_postrm |
488 | # @FUNCTION: xorg-2_pkg_postrm |
| 388 | # @DESCRIPTION: |
489 | # @DESCRIPTION: |
| 389 | # Run X-specific post-removal tasks on the live filesystem. The only |
490 | # Run X-specific post-removal tasks on the live filesystem. The only |
| 390 | # task right now is some cleanup for font packages. |
491 | # task right now is some cleanup for font packages. |
| 391 | xorg-2_pkg_postrm() { |
492 | xorg-2_pkg_postrm() { |
| 392 | debug-print-function ${FUNCNAME} "$@" |
493 | debug-print-function ${FUNCNAME} "$@" |
| 393 | |
494 | |
| 394 | [[ -n ${FONT} ]] && font_pkg_postrm "$@" |
495 | if [[ -n ${FONT} ]]; then |
| 395 | } |
496 | # if we're doing an upgrade, postinst will do |
| 396 | |
497 | if [[ ${EAPI} -lt 4 || -z ${REPLACED_BY_VERSION} ]]; then |
| 397 | # @FUNCTION: setup_fonts |
|
|
| 398 | # @DESCRIPTION: |
|
|
| 399 | # Generates needed files for fonts and fixes font permissions |
|
|
| 400 | setup_fonts() { |
|
|
| 401 | debug-print-function ${FUNCNAME} "$@" |
|
|
| 402 | |
|
|
| 403 | create_fonts_scale |
498 | create_fonts_scale |
| 404 | create_fonts_dir |
499 | create_fonts_dir |
| 405 | font_pkg_postinst |
500 | font_pkg_postrm "$@" |
|
|
501 | fi |
|
|
502 | fi |
| 406 | } |
503 | } |
| 407 | |
504 | |
| 408 | # @FUNCTION: remove_font_metadata |
505 | # @FUNCTION: remove_font_metadata |
| 409 | # @DESCRIPTION: |
506 | # @DESCRIPTION: |
| 410 | # Don't let the package install generated font files that may overlap |
507 | # Don't let the package install generated font files that may overlap |
| … | |
… | |
| 423 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
520 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
| 424 | create_fonts_scale() { |
521 | create_fonts_scale() { |
| 425 | debug-print-function ${FUNCNAME} "$@" |
522 | debug-print-function ${FUNCNAME} "$@" |
| 426 | |
523 | |
| 427 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
524 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
| 428 | ebegin "Generating font.scale" |
525 | ebegin "Generating fonts.scale" |
| 429 | mkfontscale \ |
526 | mkfontscale \ |
| 430 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
527 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
| 431 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
528 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
| 432 | eend $? |
529 | eend $? |
| 433 | fi |
530 | fi |