/[gentoo-x86]/eclass/xorg-2.eclass
Gentoo

Diff of /eclass/xorg-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.22 Revision 1.61
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2013 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.22 2011/01/15 17:55:21 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.61 2013/02/24 21:05:08 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
23GIT_ECLASS="" 23GIT_ECLASS=""
24if [[ ${PV} == *9999* ]]; then 24if [[ ${PV} == *9999* ]]; then
25 GIT_ECLASS="git" 25 GIT_ECLASS="git-2"
26 XORG_EAUTORECONF="yes" 26 XORG_EAUTORECONF="yes"
27 SRC_URI=""
28fi 27fi
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
31FONT_ECLASS="" 30FONT_ECLASS=""
32if [[ ${PN} == font* \ 31if [[ ${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"
39fi 38fi
40 39
41inherit eutils base libtool multilib toolchain-funcs flag-o-matic autotools \ 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
47inherit autotools autotools-utils eutils libtool multilib toolchain-funcs \
42 ${FONT_ECLASS} ${GIT_ECLASS} 48 flag-o-matic ${FONT_ECLASS} ${GIT_ECLASS}
49
50if [[ ${XORG_MULTILIB} == yes ]]; then
51 inherit autotools-multilib
52fi
43 53
44EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" 54EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm"
45case "${EAPI:-0}" in 55case "${EAPI:-0}" in
46 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; 56 3|4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
47 *) die "EAPI-UNSUPPORTED" ;; 57 *) die "EAPI=${EAPI} is not supported" ;;
48esac 58esac
49 59
50# exports must be ALWAYS after inherit 60# exports must be ALWAYS after inherit
51EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} 61EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
52 62
57# @DESCRIPTION: 67# @DESCRIPTION:
58# If set to 'yes' and configure.ac exists, eautoreconf will run. Set 68# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
59# before inheriting this eclass. 69# before inheriting this eclass.
60: ${XORG_EAUTORECONF:="no"} 70: ${XORG_EAUTORECONF:="no"}
61 71
72# @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI
73# @DESCRIPTION:
62# Set up SRC_URI for individual modular releases 74# Set up SRC_URI for individual modular releases. If set to an empty
75# string, no SRC_URI will be provided by the eclass.
63BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" 76: ${XORG_BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"}
77
64# @ECLASS-VARIABLE: MODULE 78# @ECLASS-VARIABLE: XORG_MODULE
65# @DESCRIPTION: 79# @DESCRIPTION:
66# The subdirectory to download source from. Possible settings are app, 80# The subdirectory to download source from. Possible settings are app,
67# doc, data, util, driver, font, lib, proto, xserver. Set above the 81# doc, data, util, driver, font, lib, proto, xserver. Set above the
68# inherit to override the default autoconfigured module. 82# inherit to override the default autoconfigured module.
69if [[ -z ${MODULE} ]]; then 83if [[ -z ${XORG_MODULE} ]]; then
70 case ${CATEGORY} in 84 case ${CATEGORY} in
71 app-doc) MODULE="doc" ;; 85 app-doc) XORG_MODULE=doc/ ;;
72 media-fonts) MODULE="font" ;; 86 media-fonts) XORG_MODULE=font/ ;;
73 x11-apps|x11-wm) MODULE="app" ;; 87 x11-apps|x11-wm) XORG_MODULE=app/ ;;
74 x11-misc|x11-themes) MODULE="util" ;; 88 x11-misc|x11-themes) XORG_MODULE=util/ ;;
75 x11-drivers) MODULE="driver" ;;
76 x11-base) MODULE="xserver" ;; 89 x11-base) XORG_MODULE=xserver/ ;;
90 x11-drivers) XORG_MODULE=driver/ ;;
77 x11-proto) MODULE="proto" ;; 91 x11-proto) XORG_MODULE=proto/ ;;
78 x11-libs) MODULE="lib" ;; 92 x11-libs) XORG_MODULE=lib/ ;;
79 *) MODULE="" ;; 93 *) XORG_MODULE= ;;
80 esac 94 esac
81fi 95fi
82 96
83# @ECLASS-VARIABLE: PACKAGE_NAME 97# @ECLASS-VARIABLE: XORG_PACKAGE_NAME
84# @DESCRIPTION: 98# @DESCRIPTION:
85# For git checkout the git repository migth differ from package name. 99# For git checkout the git repository might differ from package name.
86# This variable can be used for proper directory specification 100# This variable can be used for proper directory specification
87: ${PACKAGE_NAME:=${PN}} 101: ${XORG_PACKAGE_NAME:=${PN}}
88 102
89if [[ -n ${GIT_ECLASS} ]]; then 103if [[ -n ${GIT_ECLASS} ]]; then
90 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${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}"}
91else 105elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
92 SRC_URI+=" ${BASE_INDIVIDUAL_URI}/${MODULE}/${P}.tar.bz2" 106 SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2"
93fi 107fi
94 108
95: ${SLOT:=0} 109: ${SLOT:=0}
96 110
97# Set the license for the package. This can be overridden by setting 111# Set the license for the package. This can be overridden by setting
104XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" 118XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt"
105EAUTORECONF_DEPEND+=" 119EAUTORECONF_DEPEND+="
106 >=sys-devel/libtool-2.2.6a 120 >=sys-devel/libtool-2.2.6a
107 sys-devel/m4" 121 sys-devel/m4"
108if [[ ${PN} != util-macros ]] ; then 122if [[ ${PN} != util-macros ]] ; then
109 EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.11.0" 123 EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.17"
110 # Required even by xorg-server 124 # Required even by xorg-server
111 [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.1.1-r1" 125 [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0"
112fi 126fi
113WANT_AUTOCONF="latest" 127WANT_AUTOCONF="latest"
114WANT_AUTOMAKE="latest" 128WANT_AUTOMAKE="latest"
115for arch in ${XORG_EAUTORECONF_ARCHES}; do 129for arch in ${XORG_EAUTORECONF_ARCHES}; do
116 EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )" 130 EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )"
123if [[ ${FONT} == yes ]]; then 137if [[ ${FONT} == yes ]]; then
124 RDEPEND+=" media-fonts/encodings 138 RDEPEND+=" media-fonts/encodings
125 x11-apps/mkfontscale 139 x11-apps/mkfontscale
126 x11-apps/mkfontdir" 140 x11-apps/mkfontdir"
127 PDEPEND+=" media-fonts/font-alias" 141 PDEPEND+=" media-fonts/font-alias"
128 DEPEND+=" >=media-fonts/font-util-1.1.1-r1" 142 DEPEND+=" >=media-fonts/font-util-1.2.0"
129 143
130 # @ECLASS-VARIABLE: FONT_DIR 144 # @ECLASS-VARIABLE: FONT_DIR
131 # @DESCRIPTION: 145 # @DESCRIPTION:
132 # If you're creating a font package and the suffix of PN is not equal to 146 # 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 147 # the subdirectory of /usr/share/fonts/ it should install into, set
170 && ${PN} != xorg-cf-files \ 184 && ${PN} != xorg-cf-files \
171 && ${PN/xcursor} = ${PN} ]]; then 185 && ${PN/xcursor} = ${PN} ]]; then
172 IUSE+=" static-libs" 186 IUSE+=" static-libs"
173fi 187fi
174 188
175DEPEND+=" >=dev-util/pkgconfig-0.23" 189DEPEND+=" virtual/pkgconfig"
176 190
177# Check deps on xorg-server 191# @ECLASS-VARIABLE: XORG_DRI
178has dri ${IUSE//+} && DEPEND+=" dri? ( >=x11-base/xorg-server-1.6.3.901-r2[-minimal] )" 192# @DESCRIPTION:
179[[ -n "${DRIVER}" ]] && DEPEND+=" x11-base/xorg-server[xorg]" 193# Possible values are "always" or the value of the useflag DRI capabilities
194# are required for. Default value is "no"
195#
196# Eg. XORG_DRI="opengl" will pull all dri dependant deps for opengl useflag
197: ${XORG_DRI:="no"}
198
199DRI_COMMON_DEPEND="
200 x11-base/xorg-server[-minimal]
201 x11-libs/libdrm
202"
203DRI_DEPEND="
204 x11-proto/xf86driproto
205 x11-proto/glproto
206 x11-proto/dri2proto
207"
208case ${XORG_DRI} in
209 no)
210 ;;
211 always)
212 COMMON_DEPEND+=" ${DRI_COMMON_DEPEND}"
213 DEPEND+=" ${DRI_DEPEND}"
214 ;;
215 *)
216 COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )"
217 DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )"
218 IUSE+=" ${XORG_DRI}"
219 ;;
220esac
221unset DRI_DEPEND
222unset DRI_COMMONDEPEND
223
224if [[ -n "${DRIVER}" ]]; then
225 COMMON_DEPEND+="
226 x11-base/xorg-server[xorg]
227 "
228fi
229if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then
230 DEPEND+="
231 x11-proto/inputproto
232 x11-proto/kbproto
233 x11-proto/xproto
234 "
235fi
236if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then
237 COMMON_DEPEND+="
238 x11-libs/libpciaccess
239 "
240 # we also needs some protos and libs in all cases
241 DEPEND+="
242 x11-proto/fontsproto
243 x11-proto/randrproto
244 x11-proto/renderproto
245 x11-proto/videoproto
246 x11-proto/xextproto
247 x11-proto/xineramaproto
248 x11-proto/xproto
249 "
250fi
251
252# @ECLASS-VARIABLE: XORG_DOC
253# @DESCRIPTION:
254# Possible values are "always" or the value of the useflag doc packages
255# are required for. Default value is "no"
256#
257# Eg. XORG_DOC="manual" will pull all doc dependant deps for manual useflag
258: ${XORG_DOC:="no"}
259
260DOC_DEPEND="
261 doc? (
262 app-text/asciidoc
263 app-text/xmlto
264 app-doc/doxygen
265 app-text/docbook-xml-dtd:4.1.2
266 app-text/docbook-xml-dtd:4.2
267 app-text/docbook-xml-dtd:4.3
268 )
269"
270case ${XORG_DOC} in
271 no)
272 ;;
273 always)
274 DEPEND+=" ${DOC_DEPEND}"
275 ;;
276 *)
277 DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )"
278 IUSE+=" ${XORG_DOC}"
279 ;;
280esac
281unset DOC_DEPEND
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.
289if [[ "${DRIVER}" == yes ]]; then
290 : ${XORG_MODULE_REBUILD:="yes"}
291else
292 : ${XORG_MODULE_REBUILD:="no"}
293fi
294
295if [[ ${XORG_MODULE_REBUILD} == yes ]]; then
296 case ${EAPI} in
297 3|4)
298 ;;
299 *)
300 RDEPEND+=" x11-base/xorg-server:="
301 ;;
302 esac
303fi
304
305DEPEND+=" ${COMMON_DEPEND}"
306RDEPEND+=" ${COMMON_DEPEND}"
307unset COMMON_DEPEND
308
309if [[ ${XORG_MULTILIB} == yes ]]; then
310 RDEPEND+=" abi_x86_32? ( !<=app-emulation/emul-linux-x86-xlibs-20121202 )"
311fi
312
313debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}"
314debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
315debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
180 316
181# @FUNCTION: xorg-2_pkg_setup 317# @FUNCTION: xorg-2_pkg_setup
182# @DESCRIPTION: 318# @DESCRIPTION:
183# Setup prefix compat 319# Setup prefix compat
184xorg-2_pkg_setup() { 320xorg-2_pkg_setup() {
192# Simply unpack source code. 328# Simply unpack source code.
193xorg-2_src_unpack() { 329xorg-2_src_unpack() {
194 debug-print-function ${FUNCNAME} "$@" 330 debug-print-function ${FUNCNAME} "$@"
195 331
196 if [[ -n ${GIT_ECLASS} ]]; then 332 if [[ -n ${GIT_ECLASS} ]]; then
197 git_src_unpack 333 git-2_src_unpack
198 else 334 else
199 unpack ${A} 335 unpack ${A}
200 fi 336 fi
201 337
202 [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" 338 [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}"
212 # Patch directory is ${WORKDIR}/patch 348 # Patch directory is ${WORKDIR}/patch
213 # See epatch() in eutils.eclass for more documentation 349 # See epatch() in eutils.eclass for more documentation
214 EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} 350 EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch}
215 351
216 [[ -d "${EPATCH_SOURCE}" ]] && epatch 352 [[ -d "${EPATCH_SOURCE}" ]] && epatch
217 base_src_prepare "$@"
218} 353}
219 354
220# @FUNCTION: xorg-2_reconf_source 355# @FUNCTION: xorg-2_reconf_source
221# @DESCRIPTION: 356# @DESCRIPTION:
222# Run eautoreconf if necessary, and run elibtoolize. 357# Run eautoreconf if necessary, and run elibtoolize.
224 debug-print-function ${FUNCNAME} "$@" 359 debug-print-function ${FUNCNAME} "$@"
225 360
226 case ${CHOST} in 361 case ${CHOST} in
227 *-interix* | *-aix* | *-winnt*) 362 *-interix* | *-aix* | *-winnt*)
228 # some hosts need full eautoreconf 363 # some hosts need full eautoreconf
229 [[ -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
230 ;; 366 ;;
231 *) 367 *)
232 # elibtoolize required for BSD 368 # elibtoolize required for BSD
233 [[ ${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
234 ;; 371 ;;
235 esac 372 esac
236} 373}
237 374
238# @FUNCTION: xorg-2_src_prepare 375# @FUNCTION: xorg-2_src_prepare
239# @DESCRIPTION: 376# @DESCRIPTION:
240# Prepare a package after unpacking, performing all X-related tasks. 377# Prepare a package after unpacking, performing all X-related tasks.
241xorg-2_src_prepare() { 378xorg-2_src_prepare() {
242 debug-print-function ${FUNCNAME} "$@" 379 debug-print-function ${FUNCNAME} "$@"
243 380
244 [[ -n ${GIT_ECLASS} ]] && git_src_prepare
245 xorg-2_patch_source 381 xorg-2_patch_source
246 xorg-2_reconf_source 382 xorg-2_reconf_source
383 autotools-utils_src_prepare "$@"
247} 384}
248 385
249# @FUNCTION: xorg-2_font_configure 386# @FUNCTION: xorg-2_font_configure
250# @DESCRIPTION: 387# @DESCRIPTION:
251# If a font package, perform any necessary configuration steps 388# If a font package, perform any necessary configuration steps
252xorg-2_font_configure() { 389xorg-2_font_configure() {
253 debug-print-function ${FUNCNAME} "$@" 390 debug-print-function ${FUNCNAME} "$@"
254 391
255 if has nls ${IUSE//+} && ! use nls; then 392 if has nls ${IUSE//+} && ! use nls; then
393 if grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then
256 FONT_OPTIONS+=" 394 FONT_OPTIONS+="
395 --disable-all-encodings"
396 else
397 FONT_OPTIONS+="
257 --disable-iso8859-2 398 --disable-iso8859-2
258 --disable-iso8859-3 399 --disable-iso8859-3
259 --disable-iso8859-4 400 --disable-iso8859-4
260 --disable-iso8859-5 401 --disable-iso8859-5
261 --disable-iso8859-6 402 --disable-iso8859-6
262 --disable-iso8859-7 403 --disable-iso8859-7
263 --disable-iso8859-8 404 --disable-iso8859-8
264 --disable-iso8859-9 405 --disable-iso8859-9
265 --disable-iso8859-10 406 --disable-iso8859-10
266 --disable-iso8859-11 407 --disable-iso8859-11
267 --disable-iso8859-12 408 --disable-iso8859-12
268 --disable-iso8859-13 409 --disable-iso8859-13
269 --disable-iso8859-14 410 --disable-iso8859-14
270 --disable-iso8859-15 411 --disable-iso8859-15
271 --disable-iso8859-16 412 --disable-iso8859-16
272 --disable-jisx0201 413 --disable-jisx0201
273 --disable-koi8-r" 414 --disable-koi8-r"
415 fi
274 fi 416 fi
275} 417}
276 418
277# @FUNCTION: xorg-2_flags_setup 419# @FUNCTION: xorg-2_flags_setup
278# @DESCRIPTION: 420# @DESCRIPTION:
296# @FUNCTION: xorg-2_src_configure 438# @FUNCTION: xorg-2_src_configure
297# @DESCRIPTION: 439# @DESCRIPTION:
298# Perform any necessary pre-configuration steps, then run configure 440# Perform any necessary pre-configuration steps, then run configure
299xorg-2_src_configure() { 441xorg-2_src_configure() {
300 debug-print-function ${FUNCNAME} "$@" 442 debug-print-function ${FUNCNAME} "$@"
301 local myopts=""
302 443
303 xorg-2_flags_setup 444 xorg-2_flags_setup
445
446 # @VARIABLE: XORG_CONFIGURE_OPTIONS
447 # @DESCRIPTION:
448 # Array of an additional options to pass to configure.
449 # @DEFAULT_UNSET
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
461
304 [[ -n "${FONT}" ]] && xorg-2_font_configure 462 [[ -n "${FONT}" ]] && xorg-2_font_configure
305 463
306 # @VARIABLE: CONFIGURE_OPTIONS 464 # Check if package supports disabling of dep tracking
307 # @DESCRIPTION: 465 # Fixes warnings like:
308 # Any options to pass to configure 466 # WARNING: unrecognized options: --disable-dependency-tracking
309 # @DEFAULT_UNSET 467 if grep -q -s "disable-depencency-tracking" ${ECONF_SOURCE:-.}/configure; then
310 CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""} 468 local dep_track="--disable-dependency-tracking"
311 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
312 if has static-libs ${IUSE//+}; then
313 myopts+=" $(use_enable static-libs static)"
314 fi 469 fi
315 econf \ 470
316 --disable-dependency-tracking \ 471 local myeconfargs=(
472 ${dep_track}
317 ${FONT_OPTIONS} \ 473 ${FONT_OPTIONS}
318 ${CONFIGURE_OPTIONS} \ 474 "${xorgconfadd[@]}"
319 ${myopts} 475 )
476
477 if [[ ${XORG_MULTILIB} == yes ]]; then
478 autotools-multilib_src_configure "$@"
479 else
480 autotools-utils_src_configure "$@"
320 fi 481 fi
321} 482}
322 483
323# @FUNCTION: xorg-2_src_compile 484# @FUNCTION: xorg-2_src_compile
324# @DESCRIPTION: 485# @DESCRIPTION:
325# Compile a package, performing all X-related tasks. 486# Compile a package, performing all X-related tasks.
326xorg-2_src_compile() { 487xorg-2_src_compile() {
327 debug-print-function ${FUNCNAME} "$@" 488 debug-print-function ${FUNCNAME} "$@"
328 489
329 base_src_compile "$@" 490 if [[ ${XORG_MULTILIB} == yes ]]; then
491 autotools-multilib_src_compile "$@"
492 else
493 autotools-utils_src_compile "$@"
494 fi
330} 495}
331 496
332# @FUNCTION: xorg-2_src_install 497# @FUNCTION: xorg-2_src_install
333# @DESCRIPTION: 498# @DESCRIPTION:
334# Install a built package to ${D}, performing any necessary steps. 499# Install a built package to ${D}, performing any necessary steps.
335# Creates a ChangeLog from git if using live ebuilds. 500# Creates a ChangeLog from git if using live ebuilds.
336xorg-2_src_install() { 501xorg-2_src_install() {
337 debug-print-function ${FUNCNAME} "$@" 502 debug-print-function ${FUNCNAME} "$@"
338 503
504 local install_args=( docdir="${EPREFIX}/usr/share/doc/${PF}" )
505
339 if [[ ${CATEGORY} == x11-proto ]]; then 506 if [[ ${CATEGORY} == x11-proto ]]; then
340 emake \ 507 install_args+=(
341 ${PN/proto/}docdir=${EPREFIX}/usr/share/doc/${PF} \ 508 ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}"
342 docdir=${EPREFIX}/usr/share/doc/${PF} \ 509 )
343 DESTDIR="${D}" \ 510 fi
344 install || die "emake install failed" 511
512 if [[ ${XORG_MULTILIB} == yes ]]; then
513 autotools-multilib_src_install "${install_args[@]}"
345 else 514 else
346 emake \ 515 autotools-utils_src_install "${install_args[@]}"
347 docdir=${EPREFIX}/usr/share/doc/${PF} \
348 DESTDIR="${D}" \
349 install || die "emake install failed"
350 fi 516 fi
351 517
352 if [[ -n ${GIT_ECLASS} ]]; then 518 if [[ -n ${GIT_ECLASS} ]]; then
353 pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null 519 pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null
354 git log ${EGIT_COMMIT} > "${S}"/ChangeLog 520 git log ${EGIT_COMMIT} > "${S}"/ChangeLog
356 fi 522 fi
357 523
358 if [[ -e "${S}"/ChangeLog ]]; then 524 if [[ -e "${S}"/ChangeLog ]]; then
359 dodoc "${S}"/ChangeLog || die "dodoc failed" 525 dodoc "${S}"/ChangeLog || die "dodoc failed"
360 fi 526 fi
361 # @VARIABLE: DOCS
362 # @DESCRIPTION:
363 # Any documentation to install
364 # @DEFAULT_UNSET
365 if [[ -n ${DOCS} ]]; then
366 dodoc ${DOCS} || die "dodoc failed"
367 fi
368 527
369 # Don't install libtool archives for server modules 528 # Don't install libtool archives (even for modules)
370 if [[ -e "${D%/}${EPREFIX}/usr/$(get_libdir)/xorg/modules" ]]; then 529 prune_libtool_files --all
371 find "${D%/}${EPREFIX}/usr/$(get_libdir)/xorg/modules" -name '*.la' \
372 -exec rm -f {} ';'
373 fi
374 530
375 [[ -n ${FONT} ]] && remove_font_metadata 531 [[ -n ${FONT} ]] && remove_font_metadata
376} 532}
377 533
378# @FUNCTION: xorg-2_pkg_postinst 534# @FUNCTION: xorg-2_pkg_postinst
380# Run X-specific post-installation tasks on the live filesystem. The 536# Run X-specific post-installation tasks on the live filesystem. The
381# only task right now is some setup for font packages. 537# only task right now is some setup for font packages.
382xorg-2_pkg_postinst() { 538xorg-2_pkg_postinst() {
383 debug-print-function ${FUNCNAME} "$@" 539 debug-print-function ${FUNCNAME} "$@"
384 540
385 [[ -n ${FONT} ]] && setup_fonts "$@" 541 if [[ -n ${FONT} ]]; then
542 create_fonts_scale
543 create_fonts_dir
544 font_pkg_postinst "$@"
545 fi
386} 546}
387 547
388# @FUNCTION: xorg-2_pkg_postrm 548# @FUNCTION: xorg-2_pkg_postrm
389# @DESCRIPTION: 549# @DESCRIPTION:
390# 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
391# task right now is some cleanup for font packages. 551# task right now is some cleanup for font packages.
392xorg-2_pkg_postrm() { 552xorg-2_pkg_postrm() {
393 debug-print-function ${FUNCNAME} "$@" 553 debug-print-function ${FUNCNAME} "$@"
394 554
395 [[ -n ${FONT} ]] && font_pkg_postrm "$@" 555 if [[ -n ${FONT} ]]; then
396} 556 # if we're doing an upgrade, postinst will do
397 557 if [[ ${EAPI} -lt 4 || -z ${REPLACED_BY_VERSION} ]]; then
398# @FUNCTION: setup_fonts
399# @DESCRIPTION:
400# Generates needed files for fonts and fixes font permissions
401setup_fonts() {
402 debug-print-function ${FUNCNAME} "$@"
403
404 create_fonts_scale 558 create_fonts_scale
405 create_fonts_dir 559 create_fonts_dir
406 font_pkg_postinst 560 font_pkg_postrm "$@"
561 fi
562 fi
407} 563}
408 564
409# @FUNCTION: remove_font_metadata 565# @FUNCTION: remove_font_metadata
410# @DESCRIPTION: 566# @DESCRIPTION:
411# 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
424# 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.
425create_fonts_scale() { 581create_fonts_scale() {
426 debug-print-function ${FUNCNAME} "$@" 582 debug-print-function ${FUNCNAME} "$@"
427 583
428 if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then 584 if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
429 ebegin "Generating font.scale" 585 ebegin "Generating fonts.scale"
430 mkfontscale \ 586 mkfontscale \
431 -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ 587 -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \
432 -- "${EROOT}/usr/share/fonts/${FONT_DIR}" 588 -- "${EROOT}/usr/share/fonts/${FONT_DIR}"
433 eend $? 589 eend $?
434 fi 590 fi

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.61

  ViewVC Help
Powered by ViewVC 1.1.20