1 |
vapier |
1.47 |
# Copyright 1999-2011 Gentoo Foundation |
2 |
scarabeus |
1.1 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
mgorny |
1.49 |
# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.48 2011/09/12 13:50:57 mgorny Exp $ |
4 |
vapier |
1.47 |
|
5 |
scarabeus |
1.1 |
# @ECLASS: xorg-2.eclass |
6 |
|
|
# @MAINTAINER: |
7 |
|
|
# x11@gentoo.org |
8 |
vapier |
1.47 |
# @AUTHOR: |
9 |
|
|
# Author: Tomáš Chvátal <scarabeus@gentoo.org> |
10 |
|
|
# Author: Donnie Berkholz <dberkholz@gentoo.org> |
11 |
scarabeus |
1.1 |
# @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
12 |
|
|
# @DESCRIPTION: |
13 |
|
|
# This eclass makes trivial X ebuilds possible for apps, fonts, drivers, |
14 |
|
|
# and more. Many things that would normally be done in various functions |
15 |
|
|
# can be accessed by setting variables instead, such as patching, |
16 |
|
|
# running eautoreconf, passing options to configure and installing docs. |
17 |
|
|
# |
18 |
|
|
# All you need to do in a basic ebuild is inherit this eclass and set |
19 |
|
|
# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted |
20 |
|
|
# with the other X packages, you don't need to set SRC_URI. Pretty much |
21 |
|
|
# everything else should be automatic. |
22 |
|
|
|
23 |
|
|
GIT_ECLASS="" |
24 |
|
|
if [[ ${PV} == *9999* ]]; then |
25 |
mgorny |
1.41 |
GIT_ECLASS="git-2" |
26 |
scarabeus |
1.1 |
XORG_EAUTORECONF="yes" |
27 |
|
|
fi |
28 |
|
|
|
29 |
|
|
# If we're a font package, but not the font.alias one |
30 |
|
|
FONT_ECLASS="" |
31 |
|
|
if [[ ${PN} == font* \ |
32 |
|
|
&& ${CATEGORY} = media-fonts \ |
33 |
|
|
&& ${PN} != font-alias \ |
34 |
|
|
&& ${PN} != font-util ]]; then |
35 |
|
|
# Activate font code in the rest of the eclass |
36 |
|
|
FONT="yes" |
37 |
|
|
FONT_ECLASS="font" |
38 |
|
|
fi |
39 |
|
|
|
40 |
mgorny |
1.24 |
inherit autotools-utils eutils libtool multilib toolchain-funcs flag-o-matic autotools \ |
41 |
scarabeus |
1.1 |
${FONT_ECLASS} ${GIT_ECLASS} |
42 |
|
|
|
43 |
|
|
EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" |
44 |
|
|
case "${EAPI:-0}" in |
45 |
scarabeus |
1.21 |
3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; |
46 |
scarabeus |
1.39 |
*) die "EAPI=${EAPI} is not supported" ;; |
47 |
scarabeus |
1.1 |
esac |
48 |
|
|
|
49 |
|
|
# exports must be ALWAYS after inherit |
50 |
|
|
EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} |
51 |
|
|
|
52 |
|
|
IUSE="" |
53 |
|
|
HOMEPAGE="http://xorg.freedesktop.org/" |
54 |
|
|
|
55 |
|
|
# @ECLASS-VARIABLE: XORG_EAUTORECONF |
56 |
|
|
# @DESCRIPTION: |
57 |
|
|
# If set to 'yes' and configure.ac exists, eautoreconf will run. Set |
58 |
|
|
# before inheriting this eclass. |
59 |
|
|
: ${XORG_EAUTORECONF:="no"} |
60 |
|
|
|
61 |
scarabeus |
1.31 |
# @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI |
62 |
flameeyes |
1.28 |
# @DESCRIPTION: |
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. |
65 |
scarabeus |
1.31 |
: ${XORG_BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"} |
66 |
flameeyes |
1.28 |
|
67 |
scarabeus |
1.31 |
# @ECLASS-VARIABLE: XORG_MODULE |
68 |
scarabeus |
1.1 |
# @DESCRIPTION: |
69 |
|
|
# The subdirectory to download source from. Possible settings are app, |
70 |
|
|
# doc, data, util, driver, font, lib, proto, xserver. Set above the |
71 |
|
|
# inherit to override the default autoconfigured module. |
72 |
scarabeus |
1.31 |
if [[ -z ${XORG_MODULE} ]]; then |
73 |
scarabeus |
1.1 |
case ${CATEGORY} in |
74 |
scarabeus |
1.31 |
app-doc) XORG_MODULE=doc/ ;; |
75 |
|
|
media-fonts) XORG_MODULE=font/ ;; |
76 |
|
|
x11-apps|x11-wm) XORG_MODULE=app/ ;; |
77 |
|
|
x11-misc|x11-themes) XORG_MODULE=util/ ;; |
78 |
|
|
x11-base) XORG_MODULE=xserver/ ;; |
79 |
|
|
x11-drivers) XORG_MODULE=driver/ ;; |
80 |
|
|
x11-proto) XORG_MODULE=proto/ ;; |
81 |
|
|
x11-libs) XORG_MODULE=lib/ ;; |
82 |
|
|
*) XORG_MODULE= ;; |
83 |
scarabeus |
1.1 |
esac |
84 |
|
|
fi |
85 |
|
|
|
86 |
scarabeus |
1.31 |
# @ECLASS-VARIABLE: XORG_PACKAGE_NAME |
87 |
scarabeus |
1.20 |
# @DESCRIPTION: |
88 |
mgorny |
1.24 |
# For git checkout the git repository might differ from package name. |
89 |
scarabeus |
1.21 |
# This variable can be used for proper directory specification |
90 |
scarabeus |
1.31 |
: ${XORG_PACKAGE_NAME:=${PN}} |
91 |
scarabeus |
1.20 |
|
92 |
scarabeus |
1.1 |
if [[ -n ${GIT_ECLASS} ]]; then |
93 |
mgorny |
1.45 |
: ${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}"} |
94 |
scarabeus |
1.31 |
elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then |
95 |
|
|
SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2" |
96 |
scarabeus |
1.1 |
fi |
97 |
|
|
|
98 |
|
|
: ${SLOT:=0} |
99 |
|
|
|
100 |
|
|
# Set the license for the package. This can be overridden by setting |
101 |
|
|
# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages |
102 |
|
|
# are under the MIT license. (This is what Red Hat does in their rpms) |
103 |
scarabeus |
1.2 |
: ${LICENSE:=MIT} |
104 |
scarabeus |
1.1 |
|
105 |
scarabeus |
1.19 |
# Set up autotools shared dependencies |
106 |
|
|
# Remember that all versions here MUST be stable |
107 |
|
|
XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
108 |
|
|
EAUTORECONF_DEPEND+=" |
109 |
|
|
>=sys-devel/libtool-2.2.6a |
110 |
|
|
sys-devel/m4" |
111 |
|
|
if [[ ${PN} != util-macros ]] ; then |
112 |
chithanh |
1.46 |
EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.14.0" |
113 |
scarabeus |
1.19 |
# Required even by xorg-server |
114 |
scarabeus |
1.35 |
[[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" |
115 |
scarabeus |
1.1 |
fi |
116 |
scarabeus |
1.19 |
WANT_AUTOCONF="latest" |
117 |
|
|
WANT_AUTOMAKE="latest" |
118 |
|
|
for arch in ${XORG_EAUTORECONF_ARCHES}; do |
119 |
|
|
EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )" |
120 |
|
|
done |
121 |
|
|
DEPEND+=" ${EAUTORECONF_DEPENDS}" |
122 |
|
|
[[ ${XORG_EAUTORECONF} != no ]] && DEPEND+=" ${EAUTORECONF_DEPEND}" |
123 |
|
|
unset EAUTORECONF_DEPENDS |
124 |
|
|
unset EAUTORECONF_DEPEND |
125 |
scarabeus |
1.1 |
|
126 |
|
|
if [[ ${FONT} == yes ]]; then |
127 |
|
|
RDEPEND+=" media-fonts/encodings |
128 |
|
|
x11-apps/mkfontscale |
129 |
|
|
x11-apps/mkfontdir" |
130 |
|
|
PDEPEND+=" media-fonts/font-alias" |
131 |
scarabeus |
1.35 |
DEPEND+=" >=media-fonts/font-util-1.2.0" |
132 |
scarabeus |
1.1 |
|
133 |
|
|
# @ECLASS-VARIABLE: FONT_DIR |
134 |
|
|
# @DESCRIPTION: |
135 |
|
|
# If you're creating a font package and the suffix of PN is not equal to |
136 |
|
|
# the subdirectory of /usr/share/fonts/ it should install into, set |
137 |
|
|
# FONT_DIR to that directory or directories. Set before inheriting this |
138 |
|
|
# eclass. |
139 |
|
|
[[ -z ${FONT_DIR} ]] && FONT_DIR=${PN##*-} |
140 |
|
|
|
141 |
|
|
# Fix case of font directories |
142 |
|
|
FONT_DIR=${FONT_DIR/ttf/TTF} |
143 |
|
|
FONT_DIR=${FONT_DIR/otf/OTF} |
144 |
|
|
FONT_DIR=${FONT_DIR/type1/Type1} |
145 |
|
|
FONT_DIR=${FONT_DIR/speedo/Speedo} |
146 |
|
|
|
147 |
|
|
# Set up configure options, wrapped so ebuilds can override if need be |
148 |
|
|
[[ -z ${FONT_OPTIONS} ]] && FONT_OPTIONS="--with-fontdir=\"${EPREFIX}/usr/share/fonts/${FONT_DIR}\"" |
149 |
|
|
|
150 |
|
|
[[ ${PN##*-} = misc || ${PN##*-} = 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && IUSE+=" nls" |
151 |
|
|
fi |
152 |
|
|
|
153 |
|
|
# If we're a driver package, then enable DRIVER case |
154 |
|
|
[[ ${PN} == xf86-video-* || ${PN} == xf86-input-* ]] && DRIVER="yes" |
155 |
|
|
|
156 |
scarabeus |
1.2 |
# @ECLASS-VARIABLE: XORG_STATIC |
157 |
|
|
# @DESCRIPTION: |
158 |
|
|
# Enables static-libs useflag. Set to no, if your package gets: |
159 |
|
|
# |
160 |
|
|
# QA: configure: WARNING: unrecognized options: --disable-static |
161 |
|
|
: ${XORG_STATIC:="yes"} |
162 |
|
|
|
163 |
scarabeus |
1.1 |
# Add static-libs useflag where usefull. |
164 |
scarabeus |
1.2 |
if [[ ${XORG_STATIC} == yes \ |
165 |
|
|
&& ${FONT} != yes \ |
166 |
scarabeus |
1.1 |
&& ${CATEGORY} != app-doc \ |
167 |
scarabeus |
1.18 |
&& ${CATEGORY} != x11-apps \ |
168 |
scarabeus |
1.1 |
&& ${CATEGORY} != x11-proto \ |
169 |
|
|
&& ${CATEGORY} != x11-drivers \ |
170 |
|
|
&& ${CATEGORY} != media-fonts \ |
171 |
|
|
&& ${PN} != util-macros \ |
172 |
|
|
&& ${PN} != xbitmaps \ |
173 |
|
|
&& ${PN} != xorg-cf-files \ |
174 |
|
|
&& ${PN/xcursor} = ${PN} ]]; then |
175 |
|
|
IUSE+=" static-libs" |
176 |
|
|
fi |
177 |
|
|
|
178 |
|
|
DEPEND+=" >=dev-util/pkgconfig-0.23" |
179 |
|
|
|
180 |
scarabeus |
1.31 |
# @ECLASS-VARIABLE: XORG_DRI |
181 |
|
|
# @DESCRIPTION: |
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 |
scarabeus |
1.38 |
IUSE+=" ${XORG_DRI}" |
208 |
scarabeus |
1.31 |
;; |
209 |
|
|
esac |
210 |
|
|
unset DRI_DEPEND |
211 |
|
|
unset DRI_COMMONDEPEND |
212 |
|
|
|
213 |
scarabeus |
1.26 |
if [[ -n "${DRIVER}" ]]; then |
214 |
|
|
COMMON_DEPEND+=" |
215 |
|
|
x11-base/xorg-server[xorg] |
216 |
|
|
" |
217 |
|
|
fi |
218 |
scarabeus |
1.44 |
if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then |
219 |
scarabeus |
1.42 |
DEPEND+=" |
220 |
|
|
x11-proto/inputproto |
221 |
scarabeus |
1.43 |
x11-proto/kbproto |
222 |
|
|
x11-proto/xproto |
223 |
scarabeus |
1.42 |
" |
224 |
|
|
fi |
225 |
|
|
if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
226 |
mgorny |
1.24 |
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 |
scarabeus |
1.31 |
# @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 |
scarabeus |
1.33 |
app-text/docbook-xml-dtd:4.1.2 |
255 |
scarabeus |
1.31 |
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 |
scarabeus |
1.32 |
DEPEND+=" ${DOC_DEPEND}" |
264 |
scarabeus |
1.31 |
;; |
265 |
|
|
*) |
266 |
scarabeus |
1.32 |
DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )" |
267 |
scarabeus |
1.38 |
IUSE+=" ${XORG_DOC}" |
268 |
scarabeus |
1.31 |
;; |
269 |
|
|
esac |
270 |
|
|
unset DOC_DEPEND |
271 |
mgorny |
1.24 |
|
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 |
scarabeus |
1.31 |
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}" |
279 |
scarabeus |
1.1 |
|
280 |
|
|
# @FUNCTION: xorg-2_pkg_setup |
281 |
|
|
# @DESCRIPTION: |
282 |
|
|
# Setup prefix compat |
283 |
|
|
xorg-2_pkg_setup() { |
284 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
285 |
|
|
|
286 |
|
|
[[ ${FONT} == yes ]] && font_pkg_setup "$@" |
287 |
scarabeus |
1.1 |
} |
288 |
|
|
|
289 |
|
|
# @FUNCTION: xorg-2_src_unpack |
290 |
|
|
# @DESCRIPTION: |
291 |
|
|
# Simply unpack source code. |
292 |
|
|
xorg-2_src_unpack() { |
293 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
294 |
|
|
|
295 |
scarabeus |
1.1 |
if [[ -n ${GIT_ECLASS} ]]; then |
296 |
mgorny |
1.41 |
git-2_src_unpack |
297 |
scarabeus |
1.1 |
else |
298 |
|
|
unpack ${A} |
299 |
|
|
fi |
300 |
|
|
|
301 |
|
|
[[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
302 |
|
|
} |
303 |
|
|
|
304 |
|
|
# @FUNCTION: xorg-2_patch_source |
305 |
|
|
# @DESCRIPTION: |
306 |
|
|
# Apply all patches |
307 |
|
|
xorg-2_patch_source() { |
308 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
309 |
|
|
|
310 |
scarabeus |
1.1 |
# Use standardized names and locations with bulk patching |
311 |
|
|
# Patch directory is ${WORKDIR}/patch |
312 |
|
|
# See epatch() in eutils.eclass for more documentation |
313 |
|
|
EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch} |
314 |
|
|
|
315 |
|
|
[[ -d "${EPATCH_SOURCE}" ]] && epatch |
316 |
mgorny |
1.24 |
autotools-utils_src_prepare "$@" |
317 |
scarabeus |
1.1 |
} |
318 |
|
|
|
319 |
|
|
# @FUNCTION: xorg-2_reconf_source |
320 |
|
|
# @DESCRIPTION: |
321 |
|
|
# Run eautoreconf if necessary, and run elibtoolize. |
322 |
|
|
xorg-2_reconf_source() { |
323 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
324 |
|
|
|
325 |
scarabeus |
1.1 |
case ${CHOST} in |
326 |
|
|
*-interix* | *-aix* | *-winnt*) |
327 |
|
|
# some hosts need full eautoreconf |
328 |
scarabeus |
1.6 |
[[ -e "./configure.ac" || -e "./configure.in" ]] && eautoreconf || ewarn "Unable to autoreconf the configure script. Things may fail." |
329 |
scarabeus |
1.1 |
;; |
330 |
|
|
*) |
331 |
|
|
# elibtoolize required for BSD |
332 |
scarabeus |
1.8 |
[[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] && eautoreconf || elibtoolize |
333 |
scarabeus |
1.1 |
;; |
334 |
|
|
esac |
335 |
|
|
} |
336 |
|
|
|
337 |
|
|
# @FUNCTION: xorg-2_src_prepare |
338 |
|
|
# @DESCRIPTION: |
339 |
|
|
# Prepare a package after unpacking, performing all X-related tasks. |
340 |
|
|
xorg-2_src_prepare() { |
341 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
342 |
|
|
|
343 |
scarabeus |
1.1 |
xorg-2_patch_source |
344 |
|
|
xorg-2_reconf_source |
345 |
|
|
} |
346 |
|
|
|
347 |
|
|
# @FUNCTION: xorg-2_font_configure |
348 |
|
|
# @DESCRIPTION: |
349 |
|
|
# If a font package, perform any necessary configuration steps |
350 |
|
|
xorg-2_font_configure() { |
351 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
352 |
|
|
|
353 |
scarabeus |
1.1 |
if has nls ${IUSE//+} && ! use nls; then |
354 |
mgorny |
1.24 |
if grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then |
355 |
|
|
FONT_OPTIONS+=" |
356 |
|
|
--disable-all-encodings" |
357 |
|
|
else |
358 |
|
|
FONT_OPTIONS+=" |
359 |
|
|
--disable-iso8859-2 |
360 |
|
|
--disable-iso8859-3 |
361 |
|
|
--disable-iso8859-4 |
362 |
|
|
--disable-iso8859-5 |
363 |
|
|
--disable-iso8859-6 |
364 |
|
|
--disable-iso8859-7 |
365 |
|
|
--disable-iso8859-8 |
366 |
|
|
--disable-iso8859-9 |
367 |
|
|
--disable-iso8859-10 |
368 |
|
|
--disable-iso8859-11 |
369 |
|
|
--disable-iso8859-12 |
370 |
|
|
--disable-iso8859-13 |
371 |
|
|
--disable-iso8859-14 |
372 |
|
|
--disable-iso8859-15 |
373 |
|
|
--disable-iso8859-16 |
374 |
|
|
--disable-jisx0201 |
375 |
|
|
--disable-koi8-r" |
376 |
|
|
fi |
377 |
scarabeus |
1.1 |
fi |
378 |
|
|
} |
379 |
|
|
|
380 |
scarabeus |
1.11 |
# @FUNCTION: xorg-2_flags_setup |
381 |
scarabeus |
1.1 |
# @DESCRIPTION: |
382 |
|
|
# Set up CFLAGS for a debug build |
383 |
|
|
xorg-2_flags_setup() { |
384 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
385 |
|
|
|
386 |
scarabeus |
1.1 |
# Win32 require special define |
387 |
|
|
[[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__ |
388 |
|
|
# hardened ldflags |
389 |
|
|
[[ ${PN} = xorg-server || -n ${DRIVER} ]] && append-ldflags -Wl,-z,lazy |
390 |
scarabeus |
1.15 |
|
391 |
scarabeus |
1.16 |
# Quite few libraries fail on runtime without these: |
392 |
|
|
if has static-libs ${IUSE//+}; then |
393 |
|
|
filter-flags -Wl,-Bdirect |
394 |
|
|
filter-ldflags -Bdirect |
395 |
|
|
filter-ldflags -Wl,-Bdirect |
396 |
|
|
fi |
397 |
scarabeus |
1.1 |
} |
398 |
|
|
|
399 |
|
|
# @FUNCTION: xorg-2_src_configure |
400 |
|
|
# @DESCRIPTION: |
401 |
|
|
# Perform any necessary pre-configuration steps, then run configure |
402 |
|
|
xorg-2_src_configure() { |
403 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
404 |
scarabeus |
1.1 |
|
405 |
|
|
xorg-2_flags_setup |
406 |
|
|
|
407 |
mgorny |
1.41 |
# @VARIABLE: XORG_CONFIGURE_OPTIONS |
408 |
scarabeus |
1.10 |
# @DESCRIPTION: |
409 |
mgorny |
1.41 |
# Array of an additional options to pass to configure. |
410 |
scarabeus |
1.10 |
# @DEFAULT_UNSET |
411 |
mgorny |
1.41 |
if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then |
412 |
|
|
# fallback to CONFIGURE_OPTIONS, deprecated. |
413 |
mgorny |
1.48 |
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 |
mgorny |
1.41 |
local xorgconfadd=(${CONFIGURE_OPTIONS}) |
419 |
|
|
else |
420 |
|
|
local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}") |
421 |
|
|
fi |
422 |
mgorny |
1.24 |
|
423 |
|
|
[[ -n "${FONT}" ]] && xorg-2_font_configure |
424 |
|
|
local myeconfargs=( |
425 |
|
|
--disable-dependency-tracking |
426 |
|
|
${FONT_OPTIONS} |
427 |
mgorny |
1.41 |
"${xorgconfadd[@]}" |
428 |
mgorny |
1.24 |
) |
429 |
|
|
|
430 |
|
|
autotools-utils_src_configure "$@" |
431 |
scarabeus |
1.1 |
} |
432 |
|
|
|
433 |
|
|
# @FUNCTION: xorg-2_src_compile |
434 |
|
|
# @DESCRIPTION: |
435 |
|
|
# Compile a package, performing all X-related tasks. |
436 |
|
|
xorg-2_src_compile() { |
437 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
438 |
|
|
|
439 |
mgorny |
1.24 |
autotools-utils_src_compile "$@" |
440 |
scarabeus |
1.1 |
} |
441 |
|
|
|
442 |
|
|
# @FUNCTION: xorg-2_src_install |
443 |
|
|
# @DESCRIPTION: |
444 |
|
|
# Install a built package to ${D}, performing any necessary steps. |
445 |
|
|
# Creates a ChangeLog from git if using live ebuilds. |
446 |
|
|
xorg-2_src_install() { |
447 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
448 |
|
|
|
449 |
scarabeus |
1.1 |
if [[ ${CATEGORY} == x11-proto ]]; then |
450 |
mgorny |
1.24 |
autotools-utils_src_install \ |
451 |
|
|
${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}" \ |
452 |
|
|
docdir="${EPREFIX}/usr/share/doc/${PF}" |
453 |
scarabeus |
1.1 |
else |
454 |
mgorny |
1.24 |
autotools-utils_src_install \ |
455 |
|
|
docdir="${EPREFIX}/usr/share/doc/${PF}" |
456 |
scarabeus |
1.1 |
fi |
457 |
|
|
|
458 |
|
|
if [[ -n ${GIT_ECLASS} ]]; then |
459 |
|
|
pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null |
460 |
scarabeus |
1.12 |
git log ${EGIT_COMMIT} > "${S}"/ChangeLog |
461 |
scarabeus |
1.1 |
popd > /dev/null |
462 |
|
|
fi |
463 |
|
|
|
464 |
|
|
if [[ -e "${S}"/ChangeLog ]]; then |
465 |
scarabeus |
1.21 |
dodoc "${S}"/ChangeLog || die "dodoc failed" |
466 |
scarabeus |
1.1 |
fi |
467 |
|
|
|
468 |
mgorny |
1.24 |
# Don't install libtool archives (even with static-libs) |
469 |
|
|
remove_libtool_files all |
470 |
scarabeus |
1.1 |
|
471 |
|
|
[[ -n ${FONT} ]] && remove_font_metadata |
472 |
|
|
} |
473 |
|
|
|
474 |
|
|
# @FUNCTION: xorg-2_pkg_postinst |
475 |
|
|
# @DESCRIPTION: |
476 |
|
|
# Run X-specific post-installation tasks on the live filesystem. The |
477 |
|
|
# only task right now is some setup for font packages. |
478 |
|
|
xorg-2_pkg_postinst() { |
479 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
480 |
|
|
|
481 |
|
|
[[ -n ${FONT} ]] && setup_fonts "$@" |
482 |
scarabeus |
1.1 |
} |
483 |
|
|
|
484 |
|
|
# @FUNCTION: xorg-2_pkg_postrm |
485 |
|
|
# @DESCRIPTION: |
486 |
|
|
# Run X-specific post-removal tasks on the live filesystem. The only |
487 |
|
|
# task right now is some cleanup for font packages. |
488 |
|
|
xorg-2_pkg_postrm() { |
489 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
490 |
|
|
|
491 |
|
|
[[ -n ${FONT} ]] && font_pkg_postrm "$@" |
492 |
scarabeus |
1.1 |
} |
493 |
|
|
|
494 |
|
|
# @FUNCTION: setup_fonts |
495 |
|
|
# @DESCRIPTION: |
496 |
|
|
# Generates needed files for fonts and fixes font permissions |
497 |
|
|
setup_fonts() { |
498 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
499 |
|
|
|
500 |
scarabeus |
1.1 |
create_fonts_scale |
501 |
|
|
create_fonts_dir |
502 |
|
|
font_pkg_postinst |
503 |
|
|
} |
504 |
|
|
|
505 |
|
|
# @FUNCTION: remove_font_metadata |
506 |
|
|
# @DESCRIPTION: |
507 |
|
|
# Don't let the package install generated font files that may overlap |
508 |
|
|
# with other packages. Instead, they're generated in pkg_postinst(). |
509 |
|
|
remove_font_metadata() { |
510 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
511 |
|
|
|
512 |
scarabeus |
1.1 |
if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
513 |
|
|
einfo "Removing font metadata" |
514 |
|
|
rm -rf "${ED}"/usr/share/fonts/${FONT_DIR}/fonts.{scale,dir,cache-1} |
515 |
|
|
fi |
516 |
|
|
} |
517 |
|
|
|
518 |
|
|
# @FUNCTION: create_fonts_scale |
519 |
|
|
# @DESCRIPTION: |
520 |
|
|
# Create fonts.scale file, used by the old server-side fonts subsystem. |
521 |
|
|
create_fonts_scale() { |
522 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
523 |
|
|
|
524 |
scarabeus |
1.1 |
if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
525 |
mgorny |
1.49 |
ebegin "Generating fonts.scale" |
526 |
scarabeus |
1.1 |
mkfontscale \ |
527 |
|
|
-a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
528 |
|
|
-- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
529 |
|
|
eend $? |
530 |
|
|
fi |
531 |
|
|
} |
532 |
|
|
|
533 |
|
|
# @FUNCTION: create_fonts_dir |
534 |
|
|
# @DESCRIPTION: |
535 |
|
|
# Create fonts.dir file, used by the old server-side fonts subsystem. |
536 |
|
|
create_fonts_dir() { |
537 |
scarabeus |
1.21 |
debug-print-function ${FUNCNAME} "$@" |
538 |
|
|
|
539 |
scarabeus |
1.1 |
ebegin "Generating fonts.dir" |
540 |
|
|
mkfontdir \ |
541 |
|
|
-e "${EROOT}"/usr/share/fonts/encodings \ |
542 |
|
|
-e "${EROOT}"/usr/share/fonts/encodings/large \ |
543 |
|
|
-- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
544 |
|
|
eend $? |
545 |
|
|
} |