mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-16 17:36:59 +02:00
eclass/xorg-3: Sync with gentoo
It's from gentoo commit 269ac913ff35e9f48124292a896665e5c576733b.
This commit is contained in:
parent
f59e682175
commit
4c89102e5f
@ -1,4 +1,4 @@
|
|||||||
# Copyright 1999-2019 Gentoo Authors
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
# @ECLASS: xorg-3.eclass
|
# @ECLASS: xorg-3.eclass
|
||||||
@ -9,6 +9,7 @@
|
|||||||
# Author: Donnie Berkholz <dberkholz@gentoo.org>
|
# Author: Donnie Berkholz <dberkholz@gentoo.org>
|
||||||
# Author: Matt Turner <mattst88@gentoo.org>
|
# Author: Matt Turner <mattst88@gentoo.org>
|
||||||
# @SUPPORTED_EAPIS: 7
|
# @SUPPORTED_EAPIS: 7
|
||||||
|
# @PROVIDES: multilib-minimal
|
||||||
# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
|
# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# This eclass makes trivial X ebuilds possible for apps, drivers,
|
# This eclass makes trivial X ebuilds possible for apps, drivers,
|
||||||
@ -24,23 +25,39 @@
|
|||||||
GIT_ECLASS=""
|
GIT_ECLASS=""
|
||||||
if [[ ${PV} == *9999* ]]; then
|
if [[ ${PV} == *9999* ]]; then
|
||||||
GIT_ECLASS="git-r3"
|
GIT_ECLASS="git-r3"
|
||||||
XORG_EAUTORECONF="yes"
|
: ${XORG_EAUTORECONF:="yes"}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If we're a font package, but not the font.alias one
|
||||||
|
FONT_ECLASS=""
|
||||||
|
if [[ ${CATEGORY} = media-fonts ]]; then
|
||||||
|
case ${PN} in
|
||||||
|
font-alias|font-util)
|
||||||
|
;;
|
||||||
|
font*)
|
||||||
|
# Activate font code in the rest of the eclass
|
||||||
|
FONT="yes"
|
||||||
|
FONT_ECLASS="font"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_MULTILIB
|
# @ECLASS-VARIABLE: XORG_MULTILIB
|
||||||
|
# @PRE_INHERIT
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# If set to 'yes', the multilib support for package will be enabled. Set
|
# If set to 'yes', the multilib support for package will be enabled. Set
|
||||||
# before inheriting this eclass.
|
# before inheriting this eclass.
|
||||||
: ${XORG_MULTILIB:="no"}
|
: ${XORG_MULTILIB:="no"}
|
||||||
|
|
||||||
# we need to inherit autotools first to get the deps
|
# we need to inherit autotools first to get the deps
|
||||||
inherit autotools libtool multilib toolchain-funcs flag-o-matic ${GIT_ECLASS}
|
inherit autotools libtool multilib toolchain-funcs flag-o-matic \
|
||||||
|
${FONT_ECLASS} ${GIT_ECLASS}
|
||||||
|
|
||||||
if [[ ${XORG_MULTILIB} == yes ]]; then
|
if [[ ${XORG_MULTILIB} == yes ]]; then
|
||||||
inherit multilib-minimal
|
inherit multilib-minimal
|
||||||
fi
|
fi
|
||||||
|
|
||||||
EXPORTED_FUNCTIONS="src_prepare src_configure src_unpack src_compile src_install"
|
EXPORTED_FUNCTIONS="src_prepare src_configure src_unpack src_compile src_install pkg_postinst pkg_postrm"
|
||||||
case "${EAPI:-0}" in
|
case "${EAPI:-0}" in
|
||||||
7) ;;
|
7) ;;
|
||||||
*) die "EAPI=${EAPI} is not supported" ;;
|
*) die "EAPI=${EAPI} is not supported" ;;
|
||||||
@ -52,36 +69,42 @@ EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
|
|||||||
IUSE=""
|
IUSE=""
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_EAUTORECONF
|
# @ECLASS-VARIABLE: XORG_EAUTORECONF
|
||||||
|
# @PRE_INHERIT
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
|
# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
|
||||||
# before inheriting this eclass.
|
# before inheriting this eclass.
|
||||||
: ${XORG_EAUTORECONF:="no"}
|
: ${XORG_EAUTORECONF:="no"}
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI
|
# @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI
|
||||||
|
# @PRE_INHERIT
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Set up SRC_URI for individual modular releases. If set to an empty
|
# Set up SRC_URI for individual modular releases. If set to an empty
|
||||||
# string, no SRC_URI will be provided by the eclass.
|
# string, no SRC_URI will be provided by the eclass.
|
||||||
: ${XORG_BASE_INDIVIDUAL_URI="https://www.x.org/releases/individual"}
|
: ${XORG_BASE_INDIVIDUAL_URI="https://www.x.org/releases/individual"}
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_MODULE
|
# @ECLASS-VARIABLE: XORG_MODULE
|
||||||
|
# @PRE_INHERIT
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# The subdirectory to download source from. Possible settings are app,
|
# The subdirectory to download source from. Possible settings are app,
|
||||||
# doc, data, util, driver, lib, proto, xserver. Set above the
|
# doc, data, util, driver, font, lib, proto, xserver. Set above the
|
||||||
# inherit to override the default autoconfigured module.
|
# inherit to override the default autoconfigured module.
|
||||||
: ${XORG_MODULE:="auto"}
|
: ${XORG_MODULE:="auto"}
|
||||||
if [[ ${XORG_MODULE} == auto ]]; then
|
if [[ ${XORG_MODULE} == auto ]]; then
|
||||||
case ${CATEGORY} in
|
case "${CATEGORY}/${P}" in
|
||||||
app-doc) XORG_MODULE=doc/ ;;
|
app-doc/*) XORG_MODULE=doc/ ;;
|
||||||
x11-apps|x11-wm) XORG_MODULE=app/ ;;
|
media-fonts/*) XORG_MODULE=font/ ;;
|
||||||
x11-misc|x11-themes) XORG_MODULE=util/ ;;
|
x11-apps/*|x11-wm/*) XORG_MODULE=app/ ;;
|
||||||
x11-base) XORG_MODULE=xserver/ ;;
|
x11-misc/*|x11-themes/*) XORG_MODULE=util/ ;;
|
||||||
x11-drivers) XORG_MODULE=driver/ ;;
|
x11-base/*) XORG_MODULE=xserver/ ;;
|
||||||
x11-libs) XORG_MODULE=lib/ ;;
|
x11-drivers/*) XORG_MODULE=driver/ ;;
|
||||||
*) XORG_MODULE= ;;
|
x11-libs/xcb-util-*) XORG_MODULE=xcb/ ;;
|
||||||
|
x11-libs/*) XORG_MODULE=lib/ ;;
|
||||||
|
*) XORG_MODULE= ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_PACKAGE_NAME
|
# @ECLASS-VARIABLE: XORG_PACKAGE_NAME
|
||||||
|
# @PRE_INHERIT
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# For git checkout the git repository might differ from package name.
|
# For git checkout the git repository might differ from package name.
|
||||||
# This variable can be used for proper directory specification
|
# This variable can be used for proper directory specification
|
||||||
@ -89,10 +112,17 @@ fi
|
|||||||
|
|
||||||
HOMEPAGE="https://www.x.org/wiki/ https://gitlab.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}"
|
HOMEPAGE="https://www.x.org/wiki/ https://gitlab.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}"
|
||||||
|
|
||||||
|
# @ECLASS-VARIABLE: XORG_TARBALL_SUFFIX
|
||||||
|
# @PRE_INHERIT
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Most X11 projects provide tarballs as tar.bz2 or tar.xz. This eclass defaults
|
||||||
|
# to bz2.
|
||||||
|
: ${XORG_TARBALL_SUFFIX:="bz2"}
|
||||||
|
|
||||||
if [[ -n ${GIT_ECLASS} ]]; then
|
if [[ -n ${GIT_ECLASS} ]]; then
|
||||||
: ${EGIT_REPO_URI:="https://gitlab.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}.git"}
|
: ${EGIT_REPO_URI:="https://gitlab.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}.git"}
|
||||||
elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
|
elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
|
||||||
SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2"
|
SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.${XORG_TARBALL_SUFFIX}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: ${SLOT:=0}
|
: ${SLOT:=0}
|
||||||
@ -109,44 +139,48 @@ EAUTORECONF_DEPEND+="
|
|||||||
>=sys-devel/libtool-2.2.6a
|
>=sys-devel/libtool-2.2.6a
|
||||||
sys-devel/m4"
|
sys-devel/m4"
|
||||||
if [[ ${PN} != util-macros ]] ; then
|
if [[ ${PN} != util-macros ]] ; then
|
||||||
EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.18 >=media-fonts/font-util-1.2.0"
|
EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.18"
|
||||||
|
# Required even by xorg-server
|
||||||
|
[[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0"
|
||||||
fi
|
fi
|
||||||
WANT_AUTOCONF="latest"
|
WANT_AUTOCONF="latest"
|
||||||
WANT_AUTOMAKE="latest"
|
WANT_AUTOMAKE="latest"
|
||||||
for arch in ${XORG_EAUTORECONF_ARCHES}; do
|
for arch in ${XORG_EAUTORECONF_ARCHES}; do
|
||||||
EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )"
|
EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )"
|
||||||
done
|
done
|
||||||
DEPEND+=" ${EAUTORECONF_DEPENDS}"
|
unset arch
|
||||||
|
BDEPEND+=" ${EAUTORECONF_DEPENDS}"
|
||||||
[[ ${XORG_EAUTORECONF} != no ]] && BDEPEND+=" ${EAUTORECONF_DEPEND}"
|
[[ ${XORG_EAUTORECONF} != no ]] && BDEPEND+=" ${EAUTORECONF_DEPEND}"
|
||||||
unset EAUTORECONF_DEPENDS
|
unset EAUTORECONF_DEPENDS
|
||||||
unset EAUTORECONF_DEPEND
|
unset EAUTORECONF_DEPEND
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_STATIC
|
if [[ ${FONT} == yes ]]; then
|
||||||
# @DESCRIPTION:
|
RDEPEND+=" media-fonts/encodings
|
||||||
# Enables static-libs useflag. Set to no, if your package gets:
|
>=x11-apps/mkfontscale-1.2.0"
|
||||||
#
|
PDEPEND+=" media-fonts/font-alias"
|
||||||
# QA: configure: WARNING: unrecognized options: --disable-static
|
DEPEND+=" >=media-fonts/font-util-1.2.0
|
||||||
: ${XORG_STATIC:="yes"}
|
>=x11-apps/mkfontscale-1.2.0"
|
||||||
|
BDEPEND+=" x11-apps/bdftopcf"
|
||||||
|
|
||||||
# Add static-libs useflag where useful.
|
# @ECLASS-VARIABLE: FONT_DIR
|
||||||
if [[ ${XORG_STATIC} == yes \
|
# @PRE_INHERIT
|
||||||
&& ${CATEGORY} != app-doc \
|
# @DESCRIPTION:
|
||||||
&& ${CATEGORY} != x11-apps \
|
# If you're creating a font package and the suffix of PN is not equal to
|
||||||
&& ${CATEGORY} != x11-drivers \
|
# the subdirectory of /usr/share/fonts/ it should install into, set
|
||||||
&& ${PN} != util-macros \
|
# FONT_DIR to that directory or directories. Set before inheriting this
|
||||||
&& ${PN} != xbitmaps \
|
# eclass.
|
||||||
&& ${PN} != xorg-cf-files \
|
[[ -z ${FONT_DIR} ]] && FONT_DIR=${PN##*-}
|
||||||
&& ${PN/xcursor} = ${PN} ]]; then
|
|
||||||
IUSE+=" static-libs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${XORG_MULTILIB} == yes ]]; then
|
# Fix case of font directories
|
||||||
BDEPEND+=" virtual/pkgconfig[${MULTILIB_USEDEP}]"
|
FONT_DIR=${FONT_DIR/ttf/TTF}
|
||||||
else
|
FONT_DIR=${FONT_DIR/otf/OTF}
|
||||||
BDEPEND+=" virtual/pkgconfig"
|
FONT_DIR=${FONT_DIR/type1/Type1}
|
||||||
|
FONT_DIR=${FONT_DIR/speedo/Speedo}
|
||||||
fi
|
fi
|
||||||
|
BDEPEND+=" virtual/pkgconfig"
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_DRI
|
# @ECLASS-VARIABLE: XORG_DRI
|
||||||
|
# @PRE_INHERIT
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Possible values are "always" or the value of the useflag DRI capabilities
|
# Possible values are "always" or the value of the useflag DRI capabilities
|
||||||
# are required for. Default value is "no"
|
# are required for. Default value is "no"
|
||||||
@ -180,6 +214,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# @ECLASS-VARIABLE: XORG_DOC
|
# @ECLASS-VARIABLE: XORG_DOC
|
||||||
|
# @PRE_INHERIT
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Possible values are "always" or the value of the useflag doc packages
|
# Possible values are "always" or the value of the useflag doc packages
|
||||||
# are required for. Default value is "no"
|
# are required for. Default value is "no"
|
||||||
@ -219,6 +254,15 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
|
|||||||
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
|
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
|
||||||
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: BDEPEND=${BDEPEND}"
|
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: BDEPEND=${BDEPEND}"
|
||||||
|
|
||||||
|
# @FUNCTION: xorg-3_pkg_setup
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Setup prefix compat
|
||||||
|
xorg-3_pkg_setup() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
[[ ${FONT} == yes ]] && font_pkg_setup "$@"
|
||||||
|
}
|
||||||
|
|
||||||
# @FUNCTION: xorg-3_src_unpack
|
# @FUNCTION: xorg-3_src_unpack
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Simply unpack source code.
|
# Simply unpack source code.
|
||||||
@ -230,6 +274,8 @@ xorg-3_src_unpack() {
|
|||||||
else
|
else
|
||||||
unpack ${A}
|
unpack ${A}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[[ -n ${FONT} ]] && einfo "Detected font directory: ${FONT_DIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# @FUNCTION: xorg-3_reconf_source
|
# @FUNCTION: xorg-3_reconf_source
|
||||||
@ -265,6 +311,26 @@ xorg-3_src_prepare() {
|
|||||||
xorg-3_reconf_source
|
xorg-3_reconf_source
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# @FUNCTION: xorg-3_font_configure
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# If a font package, perform any necessary configuration steps
|
||||||
|
xorg-3_font_configure() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
# Pass --with-fontrootdir to override pkgconf SYSROOT behavior.
|
||||||
|
# https://bugs.gentoo.org/815520
|
||||||
|
if grep -q -s "with-fontrootdir" "${ECONF_SOURCE:-.}"/configure; then
|
||||||
|
FONT_OPTIONS+=( --with-fontrootdir="${EPREFIX}"/usr/share/fonts )
|
||||||
|
fi
|
||||||
|
|
||||||
|
if has nls ${IUSE//+} && ! use nls; then
|
||||||
|
if ! grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then
|
||||||
|
die "--disable-all-encodings option not available in configure"
|
||||||
|
fi
|
||||||
|
FONT_OPTIONS+=( --disable-all-encodings --enable-iso8859-1 )
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# @FUNCTION: xorg-3_flags_setup
|
# @FUNCTION: xorg-3_flags_setup
|
||||||
# @DESCRIPTION:
|
# @DESCRIPTION:
|
||||||
# Set up CFLAGS for a debug build
|
# Set up CFLAGS for a debug build
|
||||||
@ -303,6 +369,9 @@ xorg-3_src_configure() {
|
|||||||
# @DEFAULT_UNSET
|
# @DEFAULT_UNSET
|
||||||
local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}")
|
local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}")
|
||||||
|
|
||||||
|
local FONT_OPTIONS=()
|
||||||
|
[[ -n "${FONT}" ]] && xorg-3_font_configure
|
||||||
|
|
||||||
# Check if package supports disabling of dep tracking
|
# Check if package supports disabling of dep tracking
|
||||||
# Fixes warnings like:
|
# Fixes warnings like:
|
||||||
# WARNING: unrecognized options: --disable-dependency-tracking
|
# WARNING: unrecognized options: --disable-dependency-tracking
|
||||||
@ -315,9 +384,16 @@ xorg-3_src_configure() {
|
|||||||
local selective_werror="--disable-selective-werror"
|
local selective_werror="--disable-selective-werror"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if package supports disabling of static libraries
|
||||||
|
if grep -q -s "able-static" ${ECONF_SOURCE:-.}/configure; then
|
||||||
|
local no_static="--disable-static"
|
||||||
|
fi
|
||||||
|
|
||||||
local econfargs=(
|
local econfargs=(
|
||||||
${dep_track}
|
${dep_track}
|
||||||
${selective_werror}
|
${selective_werror}
|
||||||
|
${no_static}
|
||||||
|
"${FONT_OPTIONS[@]}"
|
||||||
"${xorgconfadd[@]}"
|
"${xorgconfadd[@]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -369,6 +445,7 @@ xorg-3_src_install() {
|
|||||||
multilib-minimal_src_install "$@"
|
multilib-minimal_src_install "$@"
|
||||||
else
|
else
|
||||||
emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed"
|
emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed"
|
||||||
|
einstalldocs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Many X11 libraries unconditionally install developer documentation
|
# Many X11 libraries unconditionally install developer documentation
|
||||||
@ -383,4 +460,81 @@ xorg-3_src_install() {
|
|||||||
|
|
||||||
# Don't install libtool archives (even for modules)
|
# Don't install libtool archives (even for modules)
|
||||||
find "${D}" -type f -name '*.la' -delete || die
|
find "${D}" -type f -name '*.la' -delete || die
|
||||||
|
|
||||||
|
[[ -n ${FONT} ]] && remove_font_metadata
|
||||||
|
}
|
||||||
|
|
||||||
|
# @FUNCTION: xorg-3_pkg_postinst
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Run X-specific post-installation tasks on the live filesystem. The
|
||||||
|
# only task right now is some setup for font packages.
|
||||||
|
xorg-3_pkg_postinst() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
if [[ -n ${FONT} ]]; then
|
||||||
|
create_fonts_scale
|
||||||
|
create_fonts_dir
|
||||||
|
font_pkg_postinst "$@"
|
||||||
|
|
||||||
|
ewarn "Installed fonts changed. Run 'xset fp rehash' if you are using non-fontconfig applications."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# @FUNCTION: xorg-3_pkg_postrm
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Run X-specific post-removal tasks on the live filesystem. The only
|
||||||
|
# task right now is some cleanup for font packages.
|
||||||
|
xorg-3_pkg_postrm() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
if [[ -n ${FONT} ]]; then
|
||||||
|
# if we're doing an upgrade, postinst will do
|
||||||
|
if [[ -z ${REPLACED_BY_VERSION} ]]; then
|
||||||
|
create_fonts_scale
|
||||||
|
create_fonts_dir
|
||||||
|
font_pkg_postrm "$@"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# @FUNCTION: remove_font_metadata
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Don't let the package install generated font files that may overlap
|
||||||
|
# with other packages. Instead, they're generated in pkg_postinst().
|
||||||
|
remove_font_metadata() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
|
||||||
|
einfo "Removing font metadata"
|
||||||
|
rm -rf "${ED}"/usr/share/fonts/${FONT_DIR}/fonts.{scale,dir,cache-1}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# @FUNCTION: create_fonts_scale
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Create fonts.scale file, used by the old server-side fonts subsystem.
|
||||||
|
create_fonts_scale() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
|
||||||
|
ebegin "Generating fonts.scale"
|
||||||
|
mkfontscale \
|
||||||
|
-a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \
|
||||||
|
-- "${EROOT}/usr/share/fonts/${FONT_DIR}"
|
||||||
|
eend $?
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# @FUNCTION: create_fonts_dir
|
||||||
|
# @DESCRIPTION:
|
||||||
|
# Create fonts.dir file, used by the old server-side fonts subsystem.
|
||||||
|
create_fonts_dir() {
|
||||||
|
debug-print-function ${FUNCNAME} "$@"
|
||||||
|
|
||||||
|
ebegin "Generating fonts.dir"
|
||||||
|
mkfontdir \
|
||||||
|
-e "${EROOT}"/usr/share/fonts/encodings \
|
||||||
|
-e "${EROOT}"/usr/share/fonts/encodings/large \
|
||||||
|
-- "${EROOT}/usr/share/fonts/${FONT_DIR}"
|
||||||
|
eend $?
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user