1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2014 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.35 2011/03/17 22:40:20 scarabeus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.64 2014/03/02 15:41:20 mgorny 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-r3" |
26 | XORG_EAUTORECONF="yes" |
26 | XORG_EAUTORECONF="yes" |
27 | fi |
27 | fi |
28 | |
28 | |
29 | # 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 |
30 | FONT_ECLASS="" |
30 | FONT_ECLASS="" |
… | |
… | |
35 | # Activate font code in the rest of the eclass |
35 | # Activate font code in the rest of the eclass |
36 | FONT="yes" |
36 | FONT="yes" |
37 | FONT_ECLASS="font" |
37 | FONT_ECLASS="font" |
38 | fi |
38 | fi |
39 | |
39 | |
|
|
40 | # @ECLASS-VARIABLE: XORG_MULTILIB |
|
|
41 | # @DESCRIPTION: |
|
|
42 | # If set to 'yes', the multilib support for package will be enabled. Set |
|
|
43 | # before inheriting this eclass. |
|
|
44 | : ${XORG_MULTILIB:="no"} |
|
|
45 | |
|
|
46 | # we need to inherit autotools first to get the deps |
40 | inherit autotools-utils eutils libtool multilib toolchain-funcs flag-o-matic autotools \ |
47 | inherit autotools autotools-utils eutils libtool multilib toolchain-funcs \ |
41 | ${FONT_ECLASS} ${GIT_ECLASS} |
48 | flag-o-matic ${FONT_ECLASS} ${GIT_ECLASS} |
|
|
49 | |
|
|
50 | if [[ ${XORG_MULTILIB} == yes ]]; then |
|
|
51 | inherit autotools-multilib |
|
|
52 | fi |
42 | |
53 | |
43 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
54 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
44 | case "${EAPI:-0}" in |
55 | case "${EAPI:-0}" in |
45 | 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
56 | 3|4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
46 | *) die "EAPI-UNSUPPORTED" ;; |
57 | *) die "EAPI=${EAPI} is not supported" ;; |
47 | esac |
58 | esac |
48 | |
59 | |
49 | # exports must be ALWAYS after inherit |
60 | # exports must be ALWAYS after inherit |
50 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
61 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
51 | |
62 | |
… | |
… | |
81 | x11-libs) XORG_MODULE=lib/ ;; |
92 | x11-libs) XORG_MODULE=lib/ ;; |
82 | *) XORG_MODULE= ;; |
93 | *) XORG_MODULE= ;; |
83 | esac |
94 | esac |
84 | fi |
95 | fi |
85 | |
96 | |
86 | # backcompat, remove when everything in main tree fixed |
|
|
87 | [[ -n ${MODULE} ]] && XORG_MODULE=${MODULE} && ewarn "Your ebuild is using MODULE variable, please migrate to XORG_MODULE to preserve namespace." |
|
|
88 | |
|
|
89 | # @ECLASS-VARIABLE: XORG_PACKAGE_NAME |
97 | # @ECLASS-VARIABLE: XORG_PACKAGE_NAME |
90 | # @DESCRIPTION: |
98 | # @DESCRIPTION: |
91 | # For git checkout the git repository might differ from package name. |
99 | # For git checkout the git repository might differ from package name. |
92 | # This variable can be used for proper directory specification |
100 | # This variable can be used for proper directory specification |
93 | : ${XORG_PACKAGE_NAME:=${PN}} |
101 | : ${XORG_PACKAGE_NAME:=${PN}} |
94 | |
102 | |
95 | if [[ -n ${GIT_ECLASS} ]]; then |
103 | if [[ -n ${GIT_ECLASS} ]]; then |
96 | EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}" |
104 | : ${EGIT_REPO_URI:="git://anongit.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME} http://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}"} |
97 | elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then |
105 | elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then |
98 | SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2" |
106 | SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2" |
99 | fi |
107 | fi |
100 | |
108 | |
101 | : ${SLOT:=0} |
109 | : ${SLOT:=0} |
… | |
… | |
110 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
118 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
111 | EAUTORECONF_DEPEND+=" |
119 | EAUTORECONF_DEPEND+=" |
112 | >=sys-devel/libtool-2.2.6a |
120 | >=sys-devel/libtool-2.2.6a |
113 | sys-devel/m4" |
121 | sys-devel/m4" |
114 | if [[ ${PN} != util-macros ]] ; then |
122 | if [[ ${PN} != util-macros ]] ; then |
115 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.12.0" |
123 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.17" |
116 | # Required even by xorg-server |
124 | # Required even by xorg-server |
117 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" |
125 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" |
118 | fi |
126 | fi |
119 | WANT_AUTOCONF="latest" |
127 | WANT_AUTOCONF="latest" |
120 | WANT_AUTOMAKE="latest" |
128 | WANT_AUTOMAKE="latest" |
… | |
… | |
176 | && ${PN} != xorg-cf-files \ |
184 | && ${PN} != xorg-cf-files \ |
177 | && ${PN/xcursor} = ${PN} ]]; then |
185 | && ${PN/xcursor} = ${PN} ]]; then |
178 | IUSE+=" static-libs" |
186 | IUSE+=" static-libs" |
179 | fi |
187 | fi |
180 | |
188 | |
181 | DEPEND+=" >=dev-util/pkgconfig-0.23" |
189 | DEPEND+=" virtual/pkgconfig" |
182 | |
190 | |
183 | # @ECLASS-VARIABLE: XORG_DRI |
191 | # @ECLASS-VARIABLE: XORG_DRI |
184 | # @DESCRIPTION: |
192 | # @DESCRIPTION: |
185 | # Possible values are "always" or the value of the useflag DRI capabilities |
193 | # Possible values are "always" or the value of the useflag DRI capabilities |
186 | # are required for. Default value is "no" |
194 | # are required for. Default value is "no" |
… | |
… | |
205 | DEPEND+=" ${DRI_DEPEND}" |
213 | DEPEND+=" ${DRI_DEPEND}" |
206 | ;; |
214 | ;; |
207 | *) |
215 | *) |
208 | COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )" |
216 | COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )" |
209 | DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )" |
217 | DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )" |
210 | IUSE="${XORG_DRI}" |
218 | IUSE+=" ${XORG_DRI}" |
211 | ;; |
219 | ;; |
212 | esac |
220 | esac |
213 | unset DRI_DEPEND |
221 | unset DRI_DEPEND |
214 | unset DRI_COMMONDEPEND |
222 | unset DRI_COMMONDEPEND |
215 | |
223 | |
216 | if [[ -n "${DRIVER}" ]]; then |
224 | if [[ -n "${DRIVER}" ]]; then |
217 | COMMON_DEPEND+=" |
225 | COMMON_DEPEND+=" |
218 | x11-base/xorg-server[xorg] |
226 | x11-base/xorg-server[xorg] |
|
|
227 | " |
|
|
228 | fi |
|
|
229 | if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then |
|
|
230 | DEPEND+=" |
|
|
231 | x11-proto/inputproto |
|
|
232 | x11-proto/kbproto |
|
|
233 | x11-proto/xproto |
219 | " |
234 | " |
220 | fi |
235 | fi |
221 | if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
236 | if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
222 | COMMON_DEPEND+=" |
237 | COMMON_DEPEND+=" |
223 | x11-libs/libpciaccess |
238 | x11-libs/libpciaccess |
… | |
… | |
258 | always) |
273 | always) |
259 | DEPEND+=" ${DOC_DEPEND}" |
274 | DEPEND+=" ${DOC_DEPEND}" |
260 | ;; |
275 | ;; |
261 | *) |
276 | *) |
262 | DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )" |
277 | DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )" |
263 | IUSE="${XORG_DOC}" |
278 | IUSE+=" ${XORG_DOC}" |
264 | ;; |
279 | ;; |
265 | esac |
280 | esac |
266 | unset DOC_DEPEND |
281 | unset DOC_DEPEND |
267 | |
282 | |
|
|
283 | # @ECLASS-VARIABLE: XORG_MODULE_REBUILD |
|
|
284 | # @DESCRIPTION: |
|
|
285 | # Describes whether a package contains modules that need to be rebuilt on |
|
|
286 | # xorg-server upgrade. This has an effect only since EAPI=5. |
|
|
287 | # Possible values are "yes" or "no". Default value is "yes" for packages which |
|
|
288 | # are recognized as DRIVER by this eclass and "no" for all other packages. |
|
|
289 | if [[ "${DRIVER}" == yes ]]; then |
|
|
290 | : ${XORG_MODULE_REBUILD:="yes"} |
|
|
291 | else |
|
|
292 | : ${XORG_MODULE_REBUILD:="no"} |
|
|
293 | fi |
|
|
294 | |
|
|
295 | if [[ ${XORG_MODULE_REBUILD} == yes ]]; then |
|
|
296 | case ${EAPI} in |
|
|
297 | 3|4) |
|
|
298 | ;; |
|
|
299 | *) |
|
|
300 | RDEPEND+=" x11-base/xorg-server:=" |
|
|
301 | ;; |
|
|
302 | esac |
|
|
303 | fi |
|
|
304 | |
268 | DEPEND+=" ${COMMON_DEPEND}" |
305 | DEPEND+=" ${COMMON_DEPEND}" |
269 | RDEPEND+=" ${COMMON_DEPEND}" |
306 | RDEPEND+=" ${COMMON_DEPEND}" |
270 | unset COMMON_DEPEND |
307 | unset COMMON_DEPEND |
271 | |
308 | |
|
|
309 | if [[ ${XORG_MULTILIB} == yes ]]; then |
|
|
310 | RDEPEND+=" abi_x86_32? ( !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)] )" |
|
|
311 | fi |
|
|
312 | |
272 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}" |
313 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}" |
273 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}" |
314 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}" |
274 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}" |
315 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}" |
275 | |
316 | |
276 | # @FUNCTION: xorg-2_pkg_setup |
317 | # @FUNCTION: xorg-2_pkg_setup |
… | |
… | |
287 | # Simply unpack source code. |
328 | # Simply unpack source code. |
288 | xorg-2_src_unpack() { |
329 | xorg-2_src_unpack() { |
289 | debug-print-function ${FUNCNAME} "$@" |
330 | debug-print-function ${FUNCNAME} "$@" |
290 | |
331 | |
291 | if [[ -n ${GIT_ECLASS} ]]; then |
332 | if [[ -n ${GIT_ECLASS} ]]; then |
292 | git_src_unpack |
333 | git-r3_src_unpack |
293 | else |
334 | else |
294 | unpack ${A} |
335 | unpack ${A} |
295 | fi |
336 | fi |
296 | |
337 | |
297 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
338 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
… | |
… | |
307 | # Patch directory is ${WORKDIR}/patch |
348 | # Patch directory is ${WORKDIR}/patch |
308 | # See epatch() in eutils.eclass for more documentation |
349 | # See epatch() in eutils.eclass for more documentation |
309 | EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
350 | EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
310 | |
351 | |
311 | [[ -d "${EPATCH_SOURCE}" ]] && epatch |
352 | [[ -d "${EPATCH_SOURCE}" ]] && epatch |
312 | autotools-utils_src_prepare "$@" |
|
|
313 | } |
353 | } |
314 | |
354 | |
315 | # @FUNCTION: xorg-2_reconf_source |
355 | # @FUNCTION: xorg-2_reconf_source |
316 | # @DESCRIPTION: |
356 | # @DESCRIPTION: |
317 | # Run eautoreconf if necessary, and run elibtoolize. |
357 | # Run eautoreconf if necessary, and run elibtoolize. |
… | |
… | |
319 | debug-print-function ${FUNCNAME} "$@" |
359 | debug-print-function ${FUNCNAME} "$@" |
320 | |
360 | |
321 | case ${CHOST} in |
361 | case ${CHOST} in |
322 | *-interix* | *-aix* | *-winnt*) |
362 | *-interix* | *-aix* | *-winnt*) |
323 | # some hosts need full eautoreconf |
363 | # some hosts need full eautoreconf |
324 | [[ -e "./configure.ac" || -e "./configure.in" ]] && eautoreconf || ewarn "Unable to autoreconf the configure script. Things may fail." |
364 | [[ -e "./configure.ac" || -e "./configure.in" ]] \ |
|
|
365 | && AUTOTOOLS_AUTORECONF=1 |
325 | ;; |
366 | ;; |
326 | *) |
367 | *) |
327 | # elibtoolize required for BSD |
368 | # elibtoolize required for BSD |
328 | [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] && eautoreconf || elibtoolize |
369 | [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] \ |
|
|
370 | && AUTOTOOLS_AUTORECONF=1 |
329 | ;; |
371 | ;; |
330 | esac |
372 | esac |
331 | } |
373 | } |
332 | |
374 | |
333 | # @FUNCTION: xorg-2_src_prepare |
375 | # @FUNCTION: xorg-2_src_prepare |
334 | # @DESCRIPTION: |
376 | # @DESCRIPTION: |
335 | # Prepare a package after unpacking, performing all X-related tasks. |
377 | # Prepare a package after unpacking, performing all X-related tasks. |
336 | xorg-2_src_prepare() { |
378 | xorg-2_src_prepare() { |
337 | debug-print-function ${FUNCNAME} "$@" |
379 | debug-print-function ${FUNCNAME} "$@" |
338 | |
380 | |
339 | [[ -n ${GIT_ECLASS} ]] && git_src_prepare |
|
|
340 | xorg-2_patch_source |
381 | xorg-2_patch_source |
341 | xorg-2_reconf_source |
382 | xorg-2_reconf_source |
|
|
383 | autotools-utils_src_prepare "$@" |
342 | } |
384 | } |
343 | |
385 | |
344 | # @FUNCTION: xorg-2_font_configure |
386 | # @FUNCTION: xorg-2_font_configure |
345 | # @DESCRIPTION: |
387 | # @DESCRIPTION: |
346 | # If a font package, perform any necessary configuration steps |
388 | # If a font package, perform any necessary configuration steps |
… | |
… | |
399 | xorg-2_src_configure() { |
441 | xorg-2_src_configure() { |
400 | debug-print-function ${FUNCNAME} "$@" |
442 | debug-print-function ${FUNCNAME} "$@" |
401 | |
443 | |
402 | xorg-2_flags_setup |
444 | xorg-2_flags_setup |
403 | |
445 | |
404 | # @VARIABLE: CONFIGURE_OPTIONS |
446 | # @VARIABLE: XORG_CONFIGURE_OPTIONS |
405 | # @DESCRIPTION: |
447 | # @DESCRIPTION: |
406 | # Any options to pass to configure |
448 | # Array of an additional options to pass to configure. |
407 | # @DEFAULT_UNSET |
449 | # @DEFAULT_UNSET |
408 | CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""} |
450 | if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then |
|
|
451 | # fallback to CONFIGURE_OPTIONS, deprecated. |
|
|
452 | if [[ -n "${CONFIGURE_OPTIONS}" ]]; then |
|
|
453 | eqawarn "CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS" |
|
|
454 | eqawarn "to preserve namespace." |
|
|
455 | fi |
|
|
456 | |
|
|
457 | local xorgconfadd=(${CONFIGURE_OPTIONS} ${XORG_CONFIGURE_OPTIONS}) |
|
|
458 | else |
|
|
459 | local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}") |
|
|
460 | fi |
409 | |
461 | |
410 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
462 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
|
|
463 | |
|
|
464 | # Check if package supports disabling of dep tracking |
|
|
465 | # Fixes warnings like: |
|
|
466 | # WARNING: unrecognized options: --disable-dependency-tracking |
|
|
467 | if grep -q -s "disable-depencency-tracking" ${ECONF_SOURCE:-.}/configure; then |
|
|
468 | local dep_track="--disable-dependency-tracking" |
|
|
469 | fi |
|
|
470 | |
411 | local myeconfargs=( |
471 | local myeconfargs=( |
412 | --disable-dependency-tracking |
472 | ${dep_track} |
413 | ${CONFIGURE_OPTIONS} |
|
|
414 | ${FONT_OPTIONS} |
473 | ${FONT_OPTIONS} |
|
|
474 | "${xorgconfadd[@]}" |
415 | ) |
475 | ) |
416 | |
476 | |
|
|
477 | if [[ ${XORG_MULTILIB} == yes ]]; then |
|
|
478 | autotools-multilib_src_configure "$@" |
|
|
479 | else |
417 | autotools-utils_src_configure "$@" |
480 | autotools-utils_src_configure "$@" |
|
|
481 | fi |
418 | } |
482 | } |
419 | |
483 | |
420 | # @FUNCTION: xorg-2_src_compile |
484 | # @FUNCTION: xorg-2_src_compile |
421 | # @DESCRIPTION: |
485 | # @DESCRIPTION: |
422 | # Compile a package, performing all X-related tasks. |
486 | # Compile a package, performing all X-related tasks. |
423 | xorg-2_src_compile() { |
487 | xorg-2_src_compile() { |
424 | debug-print-function ${FUNCNAME} "$@" |
488 | debug-print-function ${FUNCNAME} "$@" |
425 | |
489 | |
|
|
490 | if [[ ${XORG_MULTILIB} == yes ]]; then |
|
|
491 | autotools-multilib_src_compile "$@" |
|
|
492 | else |
426 | autotools-utils_src_compile "$@" |
493 | autotools-utils_src_compile "$@" |
|
|
494 | fi |
427 | } |
495 | } |
428 | |
496 | |
429 | # @FUNCTION: xorg-2_src_install |
497 | # @FUNCTION: xorg-2_src_install |
430 | # @DESCRIPTION: |
498 | # @DESCRIPTION: |
431 | # Install a built package to ${D}, performing any necessary steps. |
499 | # Install a built package to ${D}, performing any necessary steps. |
432 | # Creates a ChangeLog from git if using live ebuilds. |
500 | # Creates a ChangeLog from git if using live ebuilds. |
433 | xorg-2_src_install() { |
501 | xorg-2_src_install() { |
434 | debug-print-function ${FUNCNAME} "$@" |
502 | debug-print-function ${FUNCNAME} "$@" |
435 | |
503 | |
|
|
504 | local install_args=( docdir="${EPREFIX}/usr/share/doc/${PF}" ) |
|
|
505 | |
436 | if [[ ${CATEGORY} == x11-proto ]]; then |
506 | if [[ ${CATEGORY} == x11-proto ]]; then |
437 | autotools-utils_src_install \ |
507 | install_args+=( |
438 | ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}" \ |
508 | ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}" |
439 | docdir="${EPREFIX}/usr/share/doc/${PF}" |
509 | ) |
|
|
510 | fi |
|
|
511 | |
|
|
512 | if [[ ${XORG_MULTILIB} == yes ]]; then |
|
|
513 | autotools-multilib_src_install "${install_args[@]}" |
440 | else |
514 | else |
441 | autotools-utils_src_install \ |
515 | autotools-utils_src_install "${install_args[@]}" |
442 | docdir="${EPREFIX}/usr/share/doc/${PF}" |
|
|
443 | fi |
516 | fi |
444 | |
517 | |
445 | if [[ -n ${GIT_ECLASS} ]]; then |
518 | if [[ -n ${GIT_ECLASS} ]]; then |
446 | pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null |
519 | pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null |
447 | git log ${EGIT_COMMIT} > "${S}"/ChangeLog |
520 | git log ${EGIT_COMMIT} > "${S}"/ChangeLog |
… | |
… | |
450 | |
523 | |
451 | if [[ -e "${S}"/ChangeLog ]]; then |
524 | if [[ -e "${S}"/ChangeLog ]]; then |
452 | dodoc "${S}"/ChangeLog || die "dodoc failed" |
525 | dodoc "${S}"/ChangeLog || die "dodoc failed" |
453 | fi |
526 | fi |
454 | |
527 | |
455 | # Don't install libtool archives (even with static-libs) |
528 | # Don't install libtool archives (even for modules) |
456 | remove_libtool_files all |
529 | prune_libtool_files --all |
457 | |
530 | |
458 | [[ -n ${FONT} ]] && remove_font_metadata |
531 | [[ -n ${FONT} ]] && remove_font_metadata |
459 | } |
532 | } |
460 | |
533 | |
461 | # @FUNCTION: xorg-2_pkg_postinst |
534 | # @FUNCTION: xorg-2_pkg_postinst |
… | |
… | |
463 | # Run X-specific post-installation tasks on the live filesystem. The |
536 | # Run X-specific post-installation tasks on the live filesystem. The |
464 | # only task right now is some setup for font packages. |
537 | # only task right now is some setup for font packages. |
465 | xorg-2_pkg_postinst() { |
538 | xorg-2_pkg_postinst() { |
466 | debug-print-function ${FUNCNAME} "$@" |
539 | debug-print-function ${FUNCNAME} "$@" |
467 | |
540 | |
468 | [[ -n ${FONT} ]] && setup_fonts "$@" |
541 | if [[ -n ${FONT} ]]; then |
|
|
542 | create_fonts_scale |
|
|
543 | create_fonts_dir |
|
|
544 | font_pkg_postinst "$@" |
|
|
545 | fi |
469 | } |
546 | } |
470 | |
547 | |
471 | # @FUNCTION: xorg-2_pkg_postrm |
548 | # @FUNCTION: xorg-2_pkg_postrm |
472 | # @DESCRIPTION: |
549 | # @DESCRIPTION: |
473 | # Run X-specific post-removal tasks on the live filesystem. The only |
550 | # Run X-specific post-removal tasks on the live filesystem. The only |
474 | # task right now is some cleanup for font packages. |
551 | # task right now is some cleanup for font packages. |
475 | xorg-2_pkg_postrm() { |
552 | xorg-2_pkg_postrm() { |
476 | debug-print-function ${FUNCNAME} "$@" |
553 | debug-print-function ${FUNCNAME} "$@" |
477 | |
554 | |
478 | [[ -n ${FONT} ]] && font_pkg_postrm "$@" |
555 | if [[ -n ${FONT} ]]; then |
479 | } |
556 | # if we're doing an upgrade, postinst will do |
480 | |
557 | if [[ ${EAPI} -lt 4 || -z ${REPLACED_BY_VERSION} ]]; then |
481 | # @FUNCTION: setup_fonts |
|
|
482 | # @DESCRIPTION: |
|
|
483 | # Generates needed files for fonts and fixes font permissions |
|
|
484 | setup_fonts() { |
|
|
485 | debug-print-function ${FUNCNAME} "$@" |
|
|
486 | |
|
|
487 | create_fonts_scale |
558 | create_fonts_scale |
488 | create_fonts_dir |
559 | create_fonts_dir |
489 | font_pkg_postinst |
560 | font_pkg_postrm "$@" |
|
|
561 | fi |
|
|
562 | fi |
490 | } |
563 | } |
491 | |
564 | |
492 | # @FUNCTION: remove_font_metadata |
565 | # @FUNCTION: remove_font_metadata |
493 | # @DESCRIPTION: |
566 | # @DESCRIPTION: |
494 | # Don't let the package install generated font files that may overlap |
567 | # Don't let the package install generated font files that may overlap |
… | |
… | |
507 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
580 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
508 | create_fonts_scale() { |
581 | create_fonts_scale() { |
509 | debug-print-function ${FUNCNAME} "$@" |
582 | debug-print-function ${FUNCNAME} "$@" |
510 | |
583 | |
511 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
584 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
512 | ebegin "Generating font.scale" |
585 | ebegin "Generating fonts.scale" |
513 | mkfontscale \ |
586 | mkfontscale \ |
514 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
587 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
515 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
588 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
516 | eend $? |
589 | eend $? |
517 | fi |
590 | fi |