| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2012 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.24 2011/02/28 18:16:40 mgorny Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.58 2012/08/14 06:34:16 scarabeus 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 | |
|
|
40 | # we need to inherit autotools first to get the deps |
| 41 | inherit autotools-utils eutils libtool multilib toolchain-funcs flag-o-matic autotools \ |
41 | inherit autotools autotools-utils eutils libtool multilib toolchain-funcs \ |
| 42 | ${FONT_ECLASS} ${GIT_ECLASS} |
42 | flag-o-matic ${FONT_ECLASS} ${GIT_ECLASS} |
| 43 | |
43 | |
| 44 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
44 | EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
| 45 | case "${EAPI:-0}" in |
45 | case "${EAPI:-0}" in |
| 46 | 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
46 | 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
| 47 | *) die "EAPI-UNSUPPORTED" ;; |
47 | *) die "EAPI=${EAPI} is not supported" ;; |
| 48 | esac |
48 | esac |
| 49 | |
49 | |
| 50 | # exports must be ALWAYS after inherit |
50 | # exports must be ALWAYS after inherit |
| 51 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
51 | EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
| 52 | |
52 | |
| … | |
… | |
| 57 | # @DESCRIPTION: |
57 | # @DESCRIPTION: |
| 58 | # If set to 'yes' and configure.ac exists, eautoreconf will run. Set |
58 | # If set to 'yes' and configure.ac exists, eautoreconf will run. Set |
| 59 | # before inheriting this eclass. |
59 | # before inheriting this eclass. |
| 60 | : ${XORG_EAUTORECONF:="no"} |
60 | : ${XORG_EAUTORECONF:="no"} |
| 61 | |
61 | |
|
|
62 | # @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI |
|
|
63 | # @DESCRIPTION: |
| 62 | # Set up SRC_URI for individual modular releases |
64 | # Set up SRC_URI for individual modular releases. If set to an empty |
|
|
65 | # string, no SRC_URI will be provided by the eclass. |
| 63 | BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" |
66 | : ${XORG_BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"} |
|
|
67 | |
| 64 | # @ECLASS-VARIABLE: MODULE |
68 | # @ECLASS-VARIABLE: XORG_MODULE |
| 65 | # @DESCRIPTION: |
69 | # @DESCRIPTION: |
| 66 | # The subdirectory to download source from. Possible settings are app, |
70 | # The subdirectory to download source from. Possible settings are app, |
| 67 | # doc, data, util, driver, font, lib, proto, xserver. Set above the |
71 | # doc, data, util, driver, font, lib, proto, xserver. Set above the |
| 68 | # inherit to override the default autoconfigured module. |
72 | # inherit to override the default autoconfigured module. |
| 69 | if [[ -z ${MODULE} ]]; then |
73 | if [[ -z ${XORG_MODULE} ]]; then |
| 70 | case ${CATEGORY} in |
74 | case ${CATEGORY} in |
| 71 | app-doc) MODULE=doc/ ;; |
75 | app-doc) XORG_MODULE=doc/ ;; |
| 72 | media-fonts) MODULE=font/ ;; |
76 | media-fonts) XORG_MODULE=font/ ;; |
| 73 | x11-apps|x11-wm) MODULE=app/ ;; |
77 | x11-apps|x11-wm) XORG_MODULE=app/ ;; |
| 74 | x11-misc|x11-themes) MODULE=util/ ;; |
78 | x11-misc|x11-themes) XORG_MODULE=util/ ;; |
| 75 | x11-base) MODULE=xserver/ ;; |
79 | x11-base) XORG_MODULE=xserver/ ;; |
| 76 | x11-drivers) MODULE=driver/ ;; |
80 | x11-drivers) XORG_MODULE=driver/ ;; |
| 77 | x11-proto) MODULE=proto/ ;; |
81 | x11-proto) XORG_MODULE=proto/ ;; |
| 78 | x11-libs) MODULE=lib/ ;; |
82 | x11-libs) XORG_MODULE=lib/ ;; |
| 79 | *) MODULE= ;; |
83 | *) XORG_MODULE= ;; |
| 80 | esac |
84 | esac |
| 81 | fi |
85 | fi |
| 82 | |
86 | |
| 83 | # @ECLASS-VARIABLE: PACKAGE_NAME |
87 | # @ECLASS-VARIABLE: XORG_PACKAGE_NAME |
| 84 | # @DESCRIPTION: |
88 | # @DESCRIPTION: |
| 85 | # For git checkout the git repository might differ from package name. |
89 | # For git checkout the git repository might differ from package name. |
| 86 | # This variable can be used for proper directory specification |
90 | # This variable can be used for proper directory specification |
| 87 | : ${PACKAGE_NAME:=${PN}} |
91 | : ${XORG_PACKAGE_NAME:=${PN}} |
| 88 | |
92 | |
| 89 | if [[ -n ${GIT_ECLASS} ]]; then |
93 | if [[ -n ${GIT_ECLASS} ]]; then |
| 90 | EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}${PACKAGE_NAME}" |
94 | : ${EGIT_REPO_URI:="git://anongit.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME} http://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}"} |
| 91 | else |
95 | elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then |
| 92 | SRC_URI+=" ${BASE_INDIVIDUAL_URI}/${MODULE}${P}.tar.bz2" |
96 | SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2" |
| 93 | fi |
97 | fi |
| 94 | |
98 | |
| 95 | : ${SLOT:=0} |
99 | : ${SLOT:=0} |
| 96 | |
100 | |
| 97 | # Set the license for the package. This can be overridden by setting |
101 | # Set the license for the package. This can be overridden by setting |
| … | |
… | |
| 104 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
108 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
| 105 | EAUTORECONF_DEPEND+=" |
109 | EAUTORECONF_DEPEND+=" |
| 106 | >=sys-devel/libtool-2.2.6a |
110 | >=sys-devel/libtool-2.2.6a |
| 107 | sys-devel/m4" |
111 | sys-devel/m4" |
| 108 | if [[ ${PN} != util-macros ]] ; then |
112 | if [[ ${PN} != util-macros ]] ; then |
| 109 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.11.0" |
113 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.17" |
| 110 | # Required even by xorg-server |
114 | # Required even by xorg-server |
| 111 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.1.1-r1" |
115 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" |
| 112 | fi |
116 | fi |
| 113 | WANT_AUTOCONF="latest" |
117 | WANT_AUTOCONF="latest" |
| 114 | WANT_AUTOMAKE="latest" |
118 | WANT_AUTOMAKE="latest" |
| 115 | for arch in ${XORG_EAUTORECONF_ARCHES}; do |
119 | for arch in ${XORG_EAUTORECONF_ARCHES}; do |
| 116 | EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )" |
120 | EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )" |
| … | |
… | |
| 123 | if [[ ${FONT} == yes ]]; then |
127 | if [[ ${FONT} == yes ]]; then |
| 124 | RDEPEND+=" media-fonts/encodings |
128 | RDEPEND+=" media-fonts/encodings |
| 125 | x11-apps/mkfontscale |
129 | x11-apps/mkfontscale |
| 126 | x11-apps/mkfontdir" |
130 | x11-apps/mkfontdir" |
| 127 | PDEPEND+=" media-fonts/font-alias" |
131 | PDEPEND+=" media-fonts/font-alias" |
| 128 | DEPEND+=" >=media-fonts/font-util-1.1.1-r1" |
132 | DEPEND+=" >=media-fonts/font-util-1.2.0" |
| 129 | |
133 | |
| 130 | # @ECLASS-VARIABLE: FONT_DIR |
134 | # @ECLASS-VARIABLE: FONT_DIR |
| 131 | # @DESCRIPTION: |
135 | # @DESCRIPTION: |
| 132 | # If you're creating a font package and the suffix of PN is not equal to |
136 | # 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 |
137 | # the subdirectory of /usr/share/fonts/ it should install into, set |
| … | |
… | |
| 170 | && ${PN} != xorg-cf-files \ |
174 | && ${PN} != xorg-cf-files \ |
| 171 | && ${PN/xcursor} = ${PN} ]]; then |
175 | && ${PN/xcursor} = ${PN} ]]; then |
| 172 | IUSE+=" static-libs" |
176 | IUSE+=" static-libs" |
| 173 | fi |
177 | fi |
| 174 | |
178 | |
| 175 | DEPEND+=" >=dev-util/pkgconfig-0.23" |
179 | DEPEND+=" virtual/pkgconfig" |
| 176 | |
180 | |
| 177 | # Check deps on drivers |
181 | # @ECLASS-VARIABLE: XORG_DRI |
| 178 | if has dri ${IUSE//+}; then |
182 | # @DESCRIPTION: |
| 179 | COMMON_DEPEND+=" dri? ( |
183 | # Possible values are "always" or the value of the useflag DRI capabilities |
|
|
184 | # are required for. Default value is "no" |
|
|
185 | # |
|
|
186 | # Eg. XORG_DRI="opengl" will pull all dri dependant deps for opengl useflag |
|
|
187 | : ${XORG_DRI:="no"} |
|
|
188 | |
|
|
189 | DRI_COMMON_DEPEND=" |
| 180 | x11-base/xorg-server[-minimal] |
190 | x11-base/xorg-server[-minimal] |
| 181 | x11-libs/libdrm |
191 | x11-libs/libdrm |
| 182 | )" |
192 | " |
| 183 | DEPEND+=" dri? ( |
193 | DRI_DEPEND=" |
| 184 | x11-proto/xf86driproto |
194 | x11-proto/xf86driproto |
| 185 | x11-proto/glproto |
195 | x11-proto/glproto |
| 186 | x11-proto/dri2proto |
196 | x11-proto/dri2proto |
| 187 | )" |
197 | " |
| 188 | fi |
198 | case ${XORG_DRI} in |
|
|
199 | no) |
|
|
200 | ;; |
|
|
201 | always) |
|
|
202 | COMMON_DEPEND+=" ${DRI_COMMON_DEPEND}" |
|
|
203 | DEPEND+=" ${DRI_DEPEND}" |
|
|
204 | ;; |
|
|
205 | *) |
|
|
206 | COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )" |
|
|
207 | DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )" |
|
|
208 | IUSE+=" ${XORG_DRI}" |
|
|
209 | ;; |
|
|
210 | esac |
|
|
211 | unset DRI_DEPEND |
|
|
212 | unset DRI_COMMONDEPEND |
|
|
213 | |
| 189 | if [[ -n "${DRIVER}" ]]; then |
214 | if [[ -n "${DRIVER}" ]]; then |
| 190 | COMMON_DEPEND+=" |
215 | COMMON_DEPEND+=" |
| 191 | x11-base/xorg-server[xorg] |
216 | x11-base/xorg-server[xorg] |
|
|
217 | " |
|
|
218 | fi |
|
|
219 | if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then |
|
|
220 | DEPEND+=" |
|
|
221 | x11-proto/inputproto |
|
|
222 | x11-proto/kbproto |
|
|
223 | x11-proto/xproto |
|
|
224 | " |
|
|
225 | fi |
|
|
226 | if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
|
|
227 | COMMON_DEPEND+=" |
| 192 | x11-libs/libpciaccess |
228 | x11-libs/libpciaccess |
| 193 | " |
229 | " |
| 194 | # we also needs some protos and libs in all cases |
230 | # we also needs some protos and libs in all cases |
| 195 | DEPEND+=" |
231 | DEPEND+=" |
| 196 | x11-proto/fontsproto |
232 | x11-proto/fontsproto |
| … | |
… | |
| 201 | x11-proto/xineramaproto |
237 | x11-proto/xineramaproto |
| 202 | x11-proto/xproto |
238 | x11-proto/xproto |
| 203 | " |
239 | " |
| 204 | fi |
240 | fi |
| 205 | |
241 | |
| 206 | # Add deps on documentation |
242 | # @ECLASS-VARIABLE: XORG_DOC |
| 207 | # Most docbooks use dtd version 4.2 and 4.3 add more when found |
243 | # @DESCRIPTION: |
| 208 | if has doc ${IUSE//+}; then |
244 | # Possible values are "always" or the value of the useflag doc packages |
| 209 | DEPEND+=" |
245 | # are required for. Default value is "no" |
|
|
246 | # |
|
|
247 | # Eg. XORG_DOC="manual" will pull all doc dependant deps for manual useflag |
|
|
248 | : ${XORG_DOC:="no"} |
|
|
249 | |
|
|
250 | DOC_DEPEND=" |
| 210 | doc? ( |
251 | doc? ( |
|
|
252 | app-text/asciidoc |
| 211 | app-text/xmlto |
253 | app-text/xmlto |
| 212 | app-doc/doxygen |
254 | app-doc/doxygen |
|
|
255 | app-text/docbook-xml-dtd:4.1.2 |
| 213 | app-text/docbook-xml-dtd:4.2 |
256 | app-text/docbook-xml-dtd:4.2 |
| 214 | app-text/docbook-xml-dtd:4.3 |
257 | app-text/docbook-xml-dtd:4.3 |
| 215 | ) |
258 | ) |
| 216 | " |
259 | " |
| 217 | fi |
260 | case ${XORG_DOC} in |
|
|
261 | no) |
|
|
262 | ;; |
|
|
263 | always) |
|
|
264 | DEPEND+=" ${DOC_DEPEND}" |
|
|
265 | ;; |
|
|
266 | *) |
|
|
267 | DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )" |
|
|
268 | IUSE+=" ${XORG_DOC}" |
|
|
269 | ;; |
|
|
270 | esac |
|
|
271 | unset DOC_DEPEND |
| 218 | |
272 | |
| 219 | DEPEND+=" ${COMMON_DEPEND}" |
273 | DEPEND+=" ${COMMON_DEPEND}" |
| 220 | RDEPEND+=" ${COMMON_DEPEND}" |
274 | RDEPEND+=" ${COMMON_DEPEND}" |
| 221 | unset COMMON_DEPEND |
275 | unset COMMON_DEPEND |
| 222 | |
276 | |
| 223 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}" |
277 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}" |
| 224 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}" |
278 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}" |
|
|
279 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}" |
| 225 | |
280 | |
| 226 | # @FUNCTION: xorg-2_pkg_setup |
281 | # @FUNCTION: xorg-2_pkg_setup |
| 227 | # @DESCRIPTION: |
282 | # @DESCRIPTION: |
| 228 | # Setup prefix compat |
283 | # Setup prefix compat |
| 229 | xorg-2_pkg_setup() { |
284 | xorg-2_pkg_setup() { |
| … | |
… | |
| 237 | # Simply unpack source code. |
292 | # Simply unpack source code. |
| 238 | xorg-2_src_unpack() { |
293 | xorg-2_src_unpack() { |
| 239 | debug-print-function ${FUNCNAME} "$@" |
294 | debug-print-function ${FUNCNAME} "$@" |
| 240 | |
295 | |
| 241 | if [[ -n ${GIT_ECLASS} ]]; then |
296 | if [[ -n ${GIT_ECLASS} ]]; then |
| 242 | git_src_unpack |
297 | git-2_src_unpack |
| 243 | else |
298 | else |
| 244 | unpack ${A} |
299 | unpack ${A} |
| 245 | fi |
300 | fi |
| 246 | |
301 | |
| 247 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
302 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
| … | |
… | |
| 257 | # Patch directory is ${WORKDIR}/patch |
312 | # Patch directory is ${WORKDIR}/patch |
| 258 | # See epatch() in eutils.eclass for more documentation |
313 | # See epatch() in eutils.eclass for more documentation |
| 259 | EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
314 | EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
| 260 | |
315 | |
| 261 | [[ -d "${EPATCH_SOURCE}" ]] && epatch |
316 | [[ -d "${EPATCH_SOURCE}" ]] && epatch |
| 262 | autotools-utils_src_prepare "$@" |
|
|
| 263 | } |
317 | } |
| 264 | |
318 | |
| 265 | # @FUNCTION: xorg-2_reconf_source |
319 | # @FUNCTION: xorg-2_reconf_source |
| 266 | # @DESCRIPTION: |
320 | # @DESCRIPTION: |
| 267 | # Run eautoreconf if necessary, and run elibtoolize. |
321 | # Run eautoreconf if necessary, and run elibtoolize. |
| … | |
… | |
| 269 | debug-print-function ${FUNCNAME} "$@" |
323 | debug-print-function ${FUNCNAME} "$@" |
| 270 | |
324 | |
| 271 | case ${CHOST} in |
325 | case ${CHOST} in |
| 272 | *-interix* | *-aix* | *-winnt*) |
326 | *-interix* | *-aix* | *-winnt*) |
| 273 | # some hosts need full eautoreconf |
327 | # some hosts need full eautoreconf |
| 274 | [[ -e "./configure.ac" || -e "./configure.in" ]] && eautoreconf || ewarn "Unable to autoreconf the configure script. Things may fail." |
328 | [[ -e "./configure.ac" || -e "./configure.in" ]] \ |
|
|
329 | && AUTOTOOLS_AUTORECONF=1 |
| 275 | ;; |
330 | ;; |
| 276 | *) |
331 | *) |
| 277 | # elibtoolize required for BSD |
332 | # elibtoolize required for BSD |
| 278 | [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] && eautoreconf || elibtoolize |
333 | [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] \ |
|
|
334 | && AUTOTOOLS_AUTORECONF=1 |
| 279 | ;; |
335 | ;; |
| 280 | esac |
336 | esac |
| 281 | } |
337 | } |
| 282 | |
338 | |
| 283 | # @FUNCTION: xorg-2_src_prepare |
339 | # @FUNCTION: xorg-2_src_prepare |
| 284 | # @DESCRIPTION: |
340 | # @DESCRIPTION: |
| 285 | # Prepare a package after unpacking, performing all X-related tasks. |
341 | # Prepare a package after unpacking, performing all X-related tasks. |
| 286 | xorg-2_src_prepare() { |
342 | xorg-2_src_prepare() { |
| 287 | debug-print-function ${FUNCNAME} "$@" |
343 | debug-print-function ${FUNCNAME} "$@" |
| 288 | |
344 | |
| 289 | [[ -n ${GIT_ECLASS} ]] && git_src_prepare |
|
|
| 290 | xorg-2_patch_source |
345 | xorg-2_patch_source |
| 291 | xorg-2_reconf_source |
346 | xorg-2_reconf_source |
|
|
347 | autotools-utils_src_prepare "$@" |
| 292 | } |
348 | } |
| 293 | |
349 | |
| 294 | # @FUNCTION: xorg-2_font_configure |
350 | # @FUNCTION: xorg-2_font_configure |
| 295 | # @DESCRIPTION: |
351 | # @DESCRIPTION: |
| 296 | # If a font package, perform any necessary configuration steps |
352 | # If a font package, perform any necessary configuration steps |
| … | |
… | |
| 349 | xorg-2_src_configure() { |
405 | xorg-2_src_configure() { |
| 350 | debug-print-function ${FUNCNAME} "$@" |
406 | debug-print-function ${FUNCNAME} "$@" |
| 351 | |
407 | |
| 352 | xorg-2_flags_setup |
408 | xorg-2_flags_setup |
| 353 | |
409 | |
| 354 | # @VARIABLE: CONFIGURE_OPTIONS |
410 | # @VARIABLE: XORG_CONFIGURE_OPTIONS |
| 355 | # @DESCRIPTION: |
411 | # @DESCRIPTION: |
| 356 | # Any options to pass to configure |
412 | # Array of an additional options to pass to configure. |
| 357 | # @DEFAULT_UNSET |
413 | # @DEFAULT_UNSET |
| 358 | CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""} |
414 | if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then |
|
|
415 | # fallback to CONFIGURE_OPTIONS, deprecated. |
|
|
416 | if [[ -n "${CONFIGURE_OPTIONS}" ]]; then |
|
|
417 | eqawarn "CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS" |
|
|
418 | eqawarn "to preserve namespace." |
|
|
419 | fi |
|
|
420 | |
|
|
421 | local xorgconfadd=(${CONFIGURE_OPTIONS} ${XORG_CONFIGURE_OPTIONS}) |
|
|
422 | else |
|
|
423 | local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}") |
|
|
424 | fi |
| 359 | |
425 | |
| 360 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
426 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
|
|
427 | |
|
|
428 | # Check if package supports disabling of dep tracking |
|
|
429 | # Fixes warnings like: |
|
|
430 | # WARNING: unrecognized options: --disable-dependency-tracking |
|
|
431 | if grep -q -s "disable-depencency-tracking" ${ECONF_SOURCE:-.}/configure; then |
|
|
432 | local dep_track="--disable-dependency-tracking" |
|
|
433 | fi |
|
|
434 | |
| 361 | local myeconfargs=( |
435 | local myeconfargs=( |
| 362 | --disable-dependency-tracking |
436 | ${dep_track} |
| 363 | ${CONFIGURE_OPTIONS} |
|
|
| 364 | ${FONT_OPTIONS} |
437 | ${FONT_OPTIONS} |
|
|
438 | "${xorgconfadd[@]}" |
| 365 | ) |
439 | ) |
| 366 | |
440 | |
| 367 | autotools-utils_src_configure "$@" |
441 | autotools-utils_src_configure "$@" |
| 368 | } |
442 | } |
| 369 | |
443 | |
| … | |
… | |
| 400 | |
474 | |
| 401 | if [[ -e "${S}"/ChangeLog ]]; then |
475 | if [[ -e "${S}"/ChangeLog ]]; then |
| 402 | dodoc "${S}"/ChangeLog || die "dodoc failed" |
476 | dodoc "${S}"/ChangeLog || die "dodoc failed" |
| 403 | fi |
477 | fi |
| 404 | |
478 | |
| 405 | # Don't install libtool archives (even with static-libs) |
479 | # Don't install libtool archives (even for modules) |
| 406 | remove_libtool_files all |
480 | prune_libtool_files --all |
| 407 | |
481 | |
| 408 | [[ -n ${FONT} ]] && remove_font_metadata |
482 | [[ -n ${FONT} ]] && remove_font_metadata |
| 409 | } |
483 | } |
| 410 | |
484 | |
| 411 | # @FUNCTION: xorg-2_pkg_postinst |
485 | # @FUNCTION: xorg-2_pkg_postinst |
| … | |
… | |
| 413 | # Run X-specific post-installation tasks on the live filesystem. The |
487 | # Run X-specific post-installation tasks on the live filesystem. The |
| 414 | # only task right now is some setup for font packages. |
488 | # only task right now is some setup for font packages. |
| 415 | xorg-2_pkg_postinst() { |
489 | xorg-2_pkg_postinst() { |
| 416 | debug-print-function ${FUNCNAME} "$@" |
490 | debug-print-function ${FUNCNAME} "$@" |
| 417 | |
491 | |
| 418 | [[ -n ${FONT} ]] && setup_fonts "$@" |
492 | if [[ -n ${FONT} ]]; then |
|
|
493 | create_fonts_scale |
|
|
494 | create_fonts_dir |
|
|
495 | font_pkg_postinst "$@" |
|
|
496 | fi |
| 419 | } |
497 | } |
| 420 | |
498 | |
| 421 | # @FUNCTION: xorg-2_pkg_postrm |
499 | # @FUNCTION: xorg-2_pkg_postrm |
| 422 | # @DESCRIPTION: |
500 | # @DESCRIPTION: |
| 423 | # Run X-specific post-removal tasks on the live filesystem. The only |
501 | # Run X-specific post-removal tasks on the live filesystem. The only |
| 424 | # task right now is some cleanup for font packages. |
502 | # task right now is some cleanup for font packages. |
| 425 | xorg-2_pkg_postrm() { |
503 | xorg-2_pkg_postrm() { |
| 426 | debug-print-function ${FUNCNAME} "$@" |
504 | debug-print-function ${FUNCNAME} "$@" |
| 427 | |
505 | |
| 428 | [[ -n ${FONT} ]] && font_pkg_postrm "$@" |
506 | if [[ -n ${FONT} ]]; then |
| 429 | } |
507 | # if we're doing an upgrade, postinst will do |
| 430 | |
508 | if [[ ${EAPI} -lt 4 || -z ${REPLACED_BY_VERSION} ]]; then |
| 431 | # @FUNCTION: setup_fonts |
|
|
| 432 | # @DESCRIPTION: |
|
|
| 433 | # Generates needed files for fonts and fixes font permissions |
|
|
| 434 | setup_fonts() { |
|
|
| 435 | debug-print-function ${FUNCNAME} "$@" |
|
|
| 436 | |
|
|
| 437 | create_fonts_scale |
509 | create_fonts_scale |
| 438 | create_fonts_dir |
510 | create_fonts_dir |
| 439 | font_pkg_postinst |
511 | font_pkg_postrm "$@" |
|
|
512 | fi |
|
|
513 | fi |
| 440 | } |
514 | } |
| 441 | |
515 | |
| 442 | # @FUNCTION: remove_font_metadata |
516 | # @FUNCTION: remove_font_metadata |
| 443 | # @DESCRIPTION: |
517 | # @DESCRIPTION: |
| 444 | # Don't let the package install generated font files that may overlap |
518 | # Don't let the package install generated font files that may overlap |
| … | |
… | |
| 457 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
531 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
| 458 | create_fonts_scale() { |
532 | create_fonts_scale() { |
| 459 | debug-print-function ${FUNCNAME} "$@" |
533 | debug-print-function ${FUNCNAME} "$@" |
| 460 | |
534 | |
| 461 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
535 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
| 462 | ebegin "Generating font.scale" |
536 | ebegin "Generating fonts.scale" |
| 463 | mkfontscale \ |
537 | mkfontscale \ |
| 464 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
538 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
| 465 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
539 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
| 466 | eend $? |
540 | eend $? |
| 467 | fi |
541 | fi |