font.eclass: Drop EAPI-6 support

Drop FONT_S space-delimited-list fallback support.

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2021-03-21 18:02:23 +01:00
parent 9e2e8a5ce4
commit 1305a4ac64

View File

@@ -4,11 +4,10 @@
# @ECLASS: font.eclass
# @MAINTAINER:
# fonts@gentoo.org
# @SUPPORTED_EAPIS: 6 7
# @SUPPORTED_EAPIS: 7
# @BLURB: Eclass to make font installation uniform
case ${EAPI:-0} in
6) inherit eutils ;;
7) ;;
*) die "EAPI ${EAPI} is not supported by font.eclass." ;;
esac
@@ -71,14 +70,14 @@ font_xfont_config() {
local dir_name
if in_iuse X && use X ; then
dir_name="${1:-${FONT_PN}}"
rm -f "${ED%/}/${FONTDIR}/${1//${S}/}"/{fonts.{dir,scale},encodings.dir} \
rm -f "${ED}/${FONTDIR}/${1//${S}/}"/{fonts.{dir,scale},encodings.dir} \
|| die "failed to prepare ${FONTDIR}/${1//${S}/}"
einfo "Creating fonts.scale & fonts.dir in ${dir_name##*/}"
mkfontscale "${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.scale"
mkfontscale "${ED}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.scale"
mkfontdir \
-e "${EPREFIX}"/usr/share/fonts/encodings \
-e "${EPREFIX}"/usr/share/fonts/encodings/large \
"${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.dir"
"${ED}/${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.dir"
[[ -e fonts.alias ]] && doins fonts.alias
fi
}
@@ -138,7 +137,7 @@ font_cleanup_dirs() {
# if there's nothing left remove the directory
find "${d}" -maxdepth 0 -type d -empty -delete || eerror "failed to purge ${d}"
fi
done < <(find -L "${EROOT%/}"/usr/share/fonts/ -type d -print0)
done < <(find -L "${EROOT}"/usr/share/fonts/ -type d -print0)
eend 0
}
@@ -149,8 +148,8 @@ font_cleanup_dirs() {
font_pkg_setup() {
# make sure we get no collisions
# setup is not the nicest place, but preinst doesn't cut it
if [[ -e "${EROOT%/}/${FONTDIR}/fonts.cache-1" ]] ; then
rm "${EROOT%/}/${FONTDIR}/fonts.cache-1" || die "failed to remove fonts.cache-1"
if [[ -e "${EROOT}/${FONTDIR}/fonts.cache-1" ]] ; then
rm "${EROOT}/${FONTDIR}/fonts.cache-1" || die "failed to remove fonts.cache-1"
fi
}
@@ -171,19 +170,6 @@ font_src_install() {
font_xfont_config "${dir}"
popd > /dev/null || die
done
elif [[ ${FONT_S/[[:space:]]} != "${FONT_S}" ]]; then
# backwards compatibility code, can be removed after 2021-02-14
eqawarn "Using a space-separated list for FONT_S is deprecated."
eqawarn "Use a bash array instead if there are multiple directories."
for dir in ${FONT_S}; do
pushd "${dir}" > /dev/null || die "pushd ${dir} failed"
insinto "${FONTDIR}/${dir//${S}/}"
for suffix in ${FONT_SUFFIX}; do
doins *.${suffix}
done
font_xfont_config "${dir}"
popd > /dev/null || die
done
else
pushd "${FONT_S:-${S}}" > /dev/null \
|| die "pushd ${FONT_S:-${S}} failed"
@@ -210,10 +196,10 @@ font_src_install() {
# Updates fontcache if !prefix and media-libs/fontconfig installed
_update_fontcache() {
# unreadable font files = fontconfig segfaults
find "${EROOT%/}"/usr/share/fonts/ -type f '!' -perm 0644 \
find "${EROOT}"/usr/share/fonts/ -type f '!' -perm 0644 \
-exec chmod -v 0644 2>/dev/null {} + || die "failed to fix font files perms"
if [[ -z ${ROOT%/} ]] ; then
if [[ -z ${ROOT} ]] ; then
if has_version media-libs/fontconfig ; then
ebegin "Updating global fontcache"
fc-cache -fs
@@ -237,7 +223,7 @@ font_pkg_postinst() {
elog "The following fontconfig configuration files have been installed:"
elog
for conffile in "${FONT_CONF[@]}"; do
[[ -e "${EROOT%/}"/etc/fonts/conf.avail/${conffile##*/} ]] &&
[[ -e "${EROOT}"/etc/fonts/conf.avail/${conffile##*/} ]] &&
elog " ${conffile##*/}"
done
elog