xorg-2.eclass: Fix EGIT_REPO_URI, #628226
[gentoo.git] / eclass / xorg-2.eclass
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: xorg-2.eclass
5 # @MAINTAINER:
6 # x11@gentoo.org
7 # @AUTHOR:
8 # Author: Tomáš Chvátal <scarabeus@gentoo.org>
9 # Author: Donnie Berkholz <dberkholz@gentoo.org>
10 # @BLURB: Reduces code duplication in the modularized X11 ebuilds.
11 # @DESCRIPTION:
12 # This eclass makes trivial X ebuilds possible for apps, fonts, drivers,
13 # and more. Many things that would normally be done in various functions
14 # can be accessed by setting variables instead, such as patching,
15 # running eautoreconf, passing options to configure and installing docs.
16 #
17 # All you need to do in a basic ebuild is inherit this eclass and set
18 # DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted
19 # with the other X packages, you don't need to set SRC_URI. Pretty much
20 # everything else should be automatic.
21
22 GIT_ECLASS=""
23 if [[ ${PV} == *9999* ]]; then
24         GIT_ECLASS="git-r3"
25         XORG_EAUTORECONF="yes"
26 fi
27
28 # If we're a font package, but not the font.alias one
29 FONT_ECLASS=""
30 if [[ ${PN} == font* \
31         && ${CATEGORY} = media-fonts \
32         && ${PN} != font-alias \
33         && ${PN} != font-util ]]; then
34         # Activate font code in the rest of the eclass
35         FONT="yes"
36         FONT_ECLASS="font"
37 fi
38
39 # @ECLASS-VARIABLE: XORG_MULTILIB
40 # @DESCRIPTION:
41 # If set to 'yes', the multilib support for package will be enabled. Set
42 # before inheriting this eclass.
43 : ${XORG_MULTILIB:="no"}
44
45 # we need to inherit autotools first to get the deps
46 inherit autotools autotools-utils eutils libtool multilib toolchain-funcs \
47         flag-o-matic ${FONT_ECLASS} ${GIT_ECLASS}
48
49 if [[ ${XORG_MULTILIB} == yes ]]; then
50         inherit autotools-multilib
51 fi
52
53 EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm"
54 case "${EAPI:-0}" in
55         3|4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
56         *) die "EAPI=${EAPI} is not supported" ;;
57 esac
58
59 # exports must be ALWAYS after inherit
60 EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
61
62 IUSE=""
63 HOMEPAGE="https://www.x.org/wiki/"
64
65 # @ECLASS-VARIABLE: XORG_EAUTORECONF
66 # @DESCRIPTION:
67 # If set to 'yes' and configure.ac exists, eautoreconf will run. Set
68 # before inheriting this eclass.
69 : ${XORG_EAUTORECONF:="no"}
70
71 # @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI
72 # @DESCRIPTION:
73 # Set up SRC_URI for individual modular releases. If set to an empty
74 # string, no SRC_URI will be provided by the eclass.
75 : ${XORG_BASE_INDIVIDUAL_URI="https://www.x.org/releases/individual"}
76
77 # @ECLASS-VARIABLE: XORG_MODULE
78 # @DESCRIPTION:
79 # The subdirectory to download source from. Possible settings are app,
80 # doc, data, util, driver, font, lib, proto, xserver. Set above the
81 # inherit to override the default autoconfigured module.
82 if [[ -z ${XORG_MODULE} ]]; then
83         case ${CATEGORY} in
84                 app-doc)             XORG_MODULE=doc/     ;;
85                 media-fonts)         XORG_MODULE=font/    ;;
86                 x11-apps|x11-wm)     XORG_MODULE=app/     ;;
87                 x11-misc|x11-themes) XORG_MODULE=util/    ;;
88                 x11-base)            XORG_MODULE=xserver/ ;;
89                 x11-drivers)         XORG_MODULE=driver/  ;;
90                 x11-proto)           XORG_MODULE=proto/   ;;
91                 x11-libs)            XORG_MODULE=lib/     ;;
92                 *)                   XORG_MODULE=         ;;
93         esac
94 fi
95
96 # @ECLASS-VARIABLE: XORG_PACKAGE_NAME
97 # @DESCRIPTION:
98 # For git checkout the git repository might differ from package name.
99 # This variable can be used for proper directory specification
100 : ${XORG_PACKAGE_NAME:=${PN}}
101
102 if [[ -n ${GIT_ECLASS} ]]; then
103         : ${EGIT_REPO_URI:="https://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}.git"}
104 elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
105         SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2"
106 fi
107
108 : ${SLOT:=0}
109
110 # Set the license for the package. This can be overridden by setting
111 # LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
112 # are under the MIT license. (This is what Red Hat does in their rpms)
113 : ${LICENSE:=MIT}
114
115 # Set up autotools shared dependencies
116 # Remember that all versions here MUST be stable
117 XORG_EAUTORECONF_ARCHES="ppc-aix x86-winnt"
118 EAUTORECONF_DEPEND+="
119         >=sys-devel/libtool-2.2.6a
120         sys-devel/m4"
121 if [[ ${PN} != util-macros ]] ; then
122         EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.18"
123         # Required even by xorg-server
124         [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0"
125 fi
126 WANT_AUTOCONF="latest"
127 WANT_AUTOMAKE="latest"
128 for arch in ${XORG_EAUTORECONF_ARCHES}; do
129         EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )"
130 done
131 DEPEND+=" ${EAUTORECONF_DEPENDS}"
132 [[ ${XORG_EAUTORECONF} != no ]] && DEPEND+=" ${EAUTORECONF_DEPEND}"
133 unset EAUTORECONF_DEPENDS
134 unset EAUTORECONF_DEPEND
135
136 if [[ ${FONT} == yes ]]; then
137         RDEPEND+=" media-fonts/encodings
138                 x11-apps/mkfontscale
139                 x11-apps/mkfontdir"
140         PDEPEND+=" media-fonts/font-alias"
141         DEPEND+=" >=media-fonts/font-util-1.2.0"
142
143         # @ECLASS-VARIABLE: FONT_DIR
144         # @DESCRIPTION:
145         # If you're creating a font package and the suffix of PN is not equal to
146         # the subdirectory of /usr/share/fonts/ it should install into, set
147         # FONT_DIR to that directory or directories. Set before inheriting this
148         # eclass.
149         [[ -z ${FONT_DIR} ]] && FONT_DIR=${PN##*-}
150
151         # Fix case of font directories
152         FONT_DIR=${FONT_DIR/ttf/TTF}
153         FONT_DIR=${FONT_DIR/otf/OTF}
154         FONT_DIR=${FONT_DIR/type1/Type1}
155         FONT_DIR=${FONT_DIR/speedo/Speedo}
156
157         # Set up configure options, wrapped so ebuilds can override if need be
158         [[ -z ${FONT_OPTIONS} ]] && FONT_OPTIONS="--with-fontdir=\"${EPREFIX}/usr/share/fonts/${FONT_DIR}\""
159
160         [[ ${PN##*-} = misc || ${PN##*-} = 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && IUSE+=" nls"
161 fi
162
163 # If we're a driver package, then enable DRIVER case
164 [[ ${PN} == xf86-video-* || ${PN} == xf86-input-* ]] && DRIVER="yes"
165
166 # @ECLASS-VARIABLE: XORG_STATIC
167 # @DESCRIPTION:
168 # Enables static-libs useflag. Set to no, if your package gets:
169 #
170 # QA: configure: WARNING: unrecognized options: --disable-static
171 : ${XORG_STATIC:="yes"}
172
173 # Add static-libs useflag where usefull.
174 if [[ ${XORG_STATIC} == yes \
175                 && ${FONT} != yes \
176                 && ${CATEGORY} != app-doc \
177                 && ${CATEGORY} != x11-apps \
178                 && ${CATEGORY} != x11-proto \
179                 && ${CATEGORY} != x11-drivers \
180                 && ${CATEGORY} != media-fonts \
181                 && ${PN} != util-macros \
182                 && ${PN} != xbitmaps \
183                 && ${PN} != xorg-cf-files \
184                 && ${PN/xcursor} = ${PN} ]]; then
185         IUSE+=" static-libs"
186 fi
187
188 DEPEND+=" virtual/pkgconfig"
189
190 # @ECLASS-VARIABLE: XORG_DRI
191 # @DESCRIPTION:
192 # Possible values are "always" or the value of the useflag DRI capabilities
193 # are required for. Default value is "no"
194 #
195 # Eg. XORG_DRI="opengl" will pull all dri dependant deps for opengl useflag
196 : ${XORG_DRI:="no"}
197
198 DRI_COMMON_DEPEND="
199         x11-base/xorg-server[-minimal]
200         x11-libs/libdrm
201 "
202 DRI_DEPEND="
203         x11-proto/xf86driproto
204         x11-proto/glproto
205         x11-proto/dri2proto
206 "
207 case ${XORG_DRI} in
208         no)
209                 ;;
210         always)
211                 COMMON_DEPEND+=" ${DRI_COMMON_DEPEND}"
212                 DEPEND+=" ${DRI_DEPEND}"
213                 ;;
214         *)
215                 COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )"
216                 DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )"
217                 IUSE+=" ${XORG_DRI}"
218                 ;;
219 esac
220 unset DRI_DEPEND
221 unset DRI_COMMONDEPEND
222
223 if [[ -n "${DRIVER}" ]]; then
224         COMMON_DEPEND+="
225                 x11-base/xorg-server[xorg]
226         "
227 fi
228 if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then
229         DEPEND+="
230                 x11-proto/inputproto
231                 x11-proto/kbproto
232                 x11-proto/xproto
233         "
234 fi
235 if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then
236         COMMON_DEPEND+="
237                 x11-libs/libpciaccess
238         "
239         # we also needs some protos and libs in all cases
240         DEPEND+="
241                 x11-proto/fontsproto
242                 x11-proto/randrproto
243                 x11-proto/renderproto
244                 x11-proto/videoproto
245                 x11-proto/xextproto
246                 x11-proto/xineramaproto
247                 x11-proto/xproto
248         "
249 fi
250
251 # @ECLASS-VARIABLE: XORG_DOC
252 # @DESCRIPTION:
253 # Possible values are "always" or the value of the useflag doc packages
254 # are required for. Default value is "no"
255 #
256 # Eg. XORG_DOC="manual" will pull all doc dependant deps for manual useflag
257 : ${XORG_DOC:="no"}
258
259 DOC_DEPEND="
260         doc? (
261                 app-text/asciidoc
262                 app-text/xmlto
263                 app-doc/doxygen
264                 app-text/docbook-xml-dtd:4.1.2
265                 app-text/docbook-xml-dtd:4.2
266                 app-text/docbook-xml-dtd:4.3
267         )
268 "
269 case ${XORG_DOC} in
270         no)
271                 ;;
272         always)
273                 DEPEND+=" ${DOC_DEPEND}"
274                 ;;
275         *)
276                 DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )"
277                 IUSE+=" ${XORG_DOC}"
278                 ;;
279 esac
280 unset DOC_DEPEND
281
282 # @ECLASS-VARIABLE: XORG_MODULE_REBUILD
283 # @DESCRIPTION:
284 # Describes whether a package contains modules that need to be rebuilt on
285 # xorg-server upgrade. This has an effect only since EAPI=5.
286 # Possible values are "yes" or "no". Default value is "yes" for packages which
287 # are recognized as DRIVER by this eclass and "no" for all other packages.
288 if [[ "${DRIVER}" == yes ]]; then
289         : ${XORG_MODULE_REBUILD:="yes"}
290 else
291         : ${XORG_MODULE_REBUILD:="no"}
292 fi
293
294 if [[ ${XORG_MODULE_REBUILD} == yes ]]; then
295         case ${EAPI} in
296                 3|4)
297                         ;;
298                 *)
299                         RDEPEND+=" x11-base/xorg-server:="
300                         ;;
301         esac
302 fi
303
304 DEPEND+=" ${COMMON_DEPEND}"
305 RDEPEND+=" ${COMMON_DEPEND}"
306 unset COMMON_DEPEND
307
308 if [[ ${XORG_MULTILIB} == yes ]]; then
309         RDEPEND+=" abi_x86_32? ( !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)] )"
310 fi
311
312 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}"
313 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
314 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
315
316 # @FUNCTION: xorg-2_pkg_setup
317 # @DESCRIPTION:
318 # Setup prefix compat
319 xorg-2_pkg_setup() {
320         debug-print-function ${FUNCNAME} "$@"
321
322         [[ ${FONT} == yes ]] && font_pkg_setup "$@"
323 }
324
325 # @FUNCTION: xorg-2_src_unpack
326 # @DESCRIPTION:
327 # Simply unpack source code.
328 xorg-2_src_unpack() {
329         debug-print-function ${FUNCNAME} "$@"
330
331         if [[ -n ${GIT_ECLASS} ]]; then
332                 git-r3_src_unpack
333         else
334                 unpack ${A}
335         fi
336
337         [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}"
338 }
339
340 # @FUNCTION: xorg-2_patch_source
341 # @DESCRIPTION:
342 # Apply all patches
343 xorg-2_patch_source() {
344         debug-print-function ${FUNCNAME} "$@"
345
346         # Use standardized names and locations with bulk patching
347         # Patch directory is ${WORKDIR}/patch
348         # See epatch() in eutils.eclass for more documentation
349         EPATCH_SUFFIX=${EPATCH_SUFFIX:=patch}
350
351         [[ -d "${EPATCH_SOURCE}" ]] && epatch
352 }
353
354 # @FUNCTION: xorg-2_reconf_source
355 # @DESCRIPTION:
356 # Run eautoreconf if necessary, and run elibtoolize.
357 xorg-2_reconf_source() {
358         debug-print-function ${FUNCNAME} "$@"
359
360         case ${CHOST} in
361                 *-aix* | *-winnt*)
362                         # some hosts need full eautoreconf
363                         [[ -e "./configure.ac" || -e "./configure.in" ]] \
364                                 && AUTOTOOLS_AUTORECONF=1
365                         ;;
366                 *)
367                         # elibtoolize required for BSD
368                         [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] \
369                                 && AUTOTOOLS_AUTORECONF=1
370                         ;;
371         esac
372 }
373
374 # @FUNCTION: xorg-2_src_prepare
375 # @DESCRIPTION:
376 # Prepare a package after unpacking, performing all X-related tasks.
377 xorg-2_src_prepare() {
378         debug-print-function ${FUNCNAME} "$@"
379
380         xorg-2_patch_source
381         xorg-2_reconf_source
382         autotools-utils_src_prepare "$@"
383 }
384
385 # @FUNCTION: xorg-2_font_configure
386 # @DESCRIPTION:
387 # If a font package, perform any necessary configuration steps
388 xorg-2_font_configure() {
389         debug-print-function ${FUNCNAME} "$@"
390
391         if has nls ${IUSE//+} && ! use nls; then
392                 if grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then
393                         FONT_OPTIONS+="
394                                 --disable-all-encodings"
395                 else
396                         FONT_OPTIONS+="
397                                 --disable-iso8859-2
398                                 --disable-iso8859-3
399                                 --disable-iso8859-4
400                                 --disable-iso8859-5
401                                 --disable-iso8859-6
402                                 --disable-iso8859-7
403                                 --disable-iso8859-8
404                                 --disable-iso8859-9
405                                 --disable-iso8859-10
406                                 --disable-iso8859-11
407                                 --disable-iso8859-12
408                                 --disable-iso8859-13
409                                 --disable-iso8859-14
410                                 --disable-iso8859-15
411                                 --disable-iso8859-16
412                                 --disable-jisx0201
413                                 --disable-koi8-r"
414                 fi
415         fi
416 }
417
418 # @FUNCTION: xorg-2_flags_setup
419 # @DESCRIPTION:
420 # Set up CFLAGS for a debug build
421 xorg-2_flags_setup() {
422         debug-print-function ${FUNCNAME} "$@"
423
424         # Win32 require special define
425         [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__
426         # hardened ldflags
427         [[ ${PN} = xorg-server || -n ${DRIVER} ]] && append-ldflags -Wl,-z,lazy
428
429         # Quite few libraries fail on runtime without these:
430         if has static-libs ${IUSE//+}; then
431                 filter-flags -Wl,-Bdirect
432                 filter-ldflags -Bdirect
433                 filter-ldflags -Wl,-Bdirect
434         fi
435 }
436
437 # @FUNCTION: xorg-2_src_configure
438 # @DESCRIPTION:
439 # Perform any necessary pre-configuration steps, then run configure
440 xorg-2_src_configure() {
441         debug-print-function ${FUNCNAME} "$@"
442
443         xorg-2_flags_setup
444
445         # @VARIABLE: XORG_CONFIGURE_OPTIONS
446         # @DESCRIPTION:
447         # Array of an additional options to pass to configure.
448         # @DEFAULT_UNSET
449         if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then
450                 # fallback to CONFIGURE_OPTIONS, deprecated.
451                 if [[ -n "${CONFIGURE_OPTIONS}" ]]; then
452                         eqawarn "CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS"
453                         eqawarn "to preserve namespace."
454                 fi
455
456                 local xorgconfadd=(${CONFIGURE_OPTIONS} ${XORG_CONFIGURE_OPTIONS})
457         else
458                 local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}")
459         fi
460
461         [[ -n "${FONT}" ]] && xorg-2_font_configure
462
463         # Check if package supports disabling of dep tracking
464         # Fixes warnings like:
465         #    WARNING: unrecognized options: --disable-dependency-tracking
466         if grep -q -s "disable-depencency-tracking" ${ECONF_SOURCE:-.}/configure; then
467                 local dep_track="--disable-dependency-tracking"
468         fi
469
470         # Check if package supports disabling of selective -Werror=...
471         if grep -q -s "disable-selective-werror" ${ECONF_SOURCE:-.}/configure; then
472                 local selective_werror="--disable-selective-werror"
473         fi
474
475         local myeconfargs=(
476                 ${dep_track}
477                 ${selective_werror}
478                 ${FONT_OPTIONS}
479                 "${xorgconfadd[@]}"
480         )
481
482         if [[ ${XORG_MULTILIB} == yes ]]; then
483                 autotools-multilib_src_configure "$@"
484         else
485                 autotools-utils_src_configure "$@"
486         fi
487 }
488
489 # @FUNCTION: xorg-2_src_compile
490 # @DESCRIPTION:
491 # Compile a package, performing all X-related tasks.
492 xorg-2_src_compile() {
493         debug-print-function ${FUNCNAME} "$@"
494
495         if [[ ${XORG_MULTILIB} == yes ]]; then
496                 autotools-multilib_src_compile "$@"
497         else
498                 autotools-utils_src_compile "$@"
499         fi
500 }
501
502 # @FUNCTION: xorg-2_src_install
503 # @DESCRIPTION:
504 # Install a built package to ${D}, performing any necessary steps.
505 # Creates a ChangeLog from git if using live ebuilds.
506 xorg-2_src_install() {
507         debug-print-function ${FUNCNAME} "$@"
508
509         local install_args=( docdir="${EPREFIX}/usr/share/doc/${PF}" )
510
511         if [[ ${CATEGORY} == x11-proto ]]; then
512                 install_args+=(
513                         ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}"
514                 )
515         fi
516
517         if [[ ${XORG_MULTILIB} == yes ]]; then
518                 autotools-multilib_src_install "${install_args[@]}"
519         else
520                 autotools-utils_src_install "${install_args[@]}"
521         fi
522
523         if [[ -n ${GIT_ECLASS} ]]; then
524                 pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > /dev/null || die
525                 git log ${EGIT_COMMIT} > "${S}"/ChangeLog
526                 popd > /dev/null || die
527         fi
528
529         if [[ -e "${S}"/ChangeLog ]]; then
530                 dodoc "${S}"/ChangeLog || die "dodoc failed"
531         fi
532
533         # Don't install libtool archives (even for modules)
534         prune_libtool_files --all
535
536         [[ -n ${FONT} ]] && remove_font_metadata
537 }
538
539 # @FUNCTION: xorg-2_pkg_postinst
540 # @DESCRIPTION:
541 # Run X-specific post-installation tasks on the live filesystem. The
542 # only task right now is some setup for font packages.
543 xorg-2_pkg_postinst() {
544         debug-print-function ${FUNCNAME} "$@"
545
546         if [[ -n ${FONT} ]]; then
547                 create_fonts_scale
548                 create_fonts_dir
549                 font_pkg_postinst "$@"
550         fi
551 }
552
553 # @FUNCTION: xorg-2_pkg_postrm
554 # @DESCRIPTION:
555 # Run X-specific post-removal tasks on the live filesystem. The only
556 # task right now is some cleanup for font packages.
557 xorg-2_pkg_postrm() {
558         debug-print-function ${FUNCNAME} "$@"
559
560         if [[ -n ${FONT} ]]; then
561                 # if we're doing an upgrade, postinst will do
562                 if [[ ${EAPI} -lt 4 || -z ${REPLACED_BY_VERSION} ]]; then
563                         create_fonts_scale
564                         create_fonts_dir
565                         font_pkg_postrm "$@"
566                 fi
567         fi
568 }
569
570 # @FUNCTION: remove_font_metadata
571 # @DESCRIPTION:
572 # Don't let the package install generated font files that may overlap
573 # with other packages. Instead, they're generated in pkg_postinst().
574 remove_font_metadata() {
575         debug-print-function ${FUNCNAME} "$@"
576
577         if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
578                 einfo "Removing font metadata"
579                 rm -rf "${ED}"/usr/share/fonts/${FONT_DIR}/fonts.{scale,dir,cache-1}
580         fi
581 }
582
583 # @FUNCTION: create_fonts_scale
584 # @DESCRIPTION:
585 # Create fonts.scale file, used by the old server-side fonts subsystem.
586 create_fonts_scale() {
587         debug-print-function ${FUNCNAME} "$@"
588
589         if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
590                 ebegin "Generating fonts.scale"
591                         mkfontscale \
592                                 -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \
593                                 -- "${EROOT}/usr/share/fonts/${FONT_DIR}"
594                 eend $?
595         fi
596 }
597
598 # @FUNCTION: create_fonts_dir
599 # @DESCRIPTION:
600 # Create fonts.dir file, used by the old server-side fonts subsystem.
601 create_fonts_dir() {
602         debug-print-function ${FUNCNAME} "$@"
603
604         ebegin "Generating fonts.dir"
605                         mkfontdir \
606                                 -e "${EROOT}"/usr/share/fonts/encodings \
607                                 -e "${EROOT}"/usr/share/fonts/encodings/large \
608                                 -- "${EROOT}/usr/share/fonts/${FONT_DIR}"
609         eend $?
610 }