[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] font.eclass: Drop EAPI-5 and EAPI-6 support
From:       Andreas Sturmlechner <asturm () gentoo ! org>
Date:       2021-03-26 20:50:33
Message-ID: 2537287.vuYhMxLoTh () 192 ! 168 ! 1 ! 8
[Download RAW message or body]


diff --git a/eclass/font.eclass b/eclass/font.eclass
index e9e448a8155..ec1b6ca9358 100644
--- a/eclass/font.eclass
+++ b/eclass/font.eclass
@@ -1,19 +1,19 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: font.eclass
 # @MAINTAINER:
 # fonts@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 7
 # @BLURB: Eclass to make font installation uniform
 
 case ${EAPI:-0} in
-	[56]) inherit eutils ;;
 	7) ;;
 	*) die "EAPI ${EAPI} is not supported by font.eclass." ;;
 esac
 
 if [[ ! ${_FONT_ECLASS} ]]; then
+_FONT_ECLASS=1
 
 EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm
 
@@ -46,21 +46,12 @@ FONTDIR=${FONTDIR:-/usr/share/fonts/${FONT_PN}}
 # Array containing fontconfig conf files to install.
 FONT_CONF=( "" )
 
-# @ECLASS-VARIABLE: DOCS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Space delimited list of docs to install.
-# We always install these:
-# COPYRIGHT README{,.txt} NEWS AUTHORS BUGS ChangeLog FONTLOG.txt
-DOCS=${DOCS:-}
-
 if [[ ${CATEGORY}/${PN} != media-fonts/encodings ]]; then
 	IUSE="X"
-	DEPEND="X? (
+	BDEPEND="X? (
 			>=x11-apps/mkfontscale-1.2.0
 			media-fonts/encodings
 	)"
-	RDEPEND=""
 fi
 
 # @FUNCTION: font_xfont_config
@@ -70,14 +61,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"
+			-e "${EPREFIX}"/usr/share/fonts/encodings \
+			-e "${EPREFIX}"/usr/share/fonts/encodings/large \
+			"${ED}${FONTDIR}/${1//${S}/}" || eerror "failed to create fonts.dir"
 		[[ -e fonts.alias ]] && doins fonts.alias
 	fi
 }
@@ -137,7 +128,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
 }
 
@@ -148,8 +139,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
 }
 
@@ -170,19 +161,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"
@@ -209,10 +187,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
@@ -236,7 +214,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
@@ -254,5 +232,4 @@ font_pkg_postrm() {
 	_update_fontcache
 }
 
-_FONT_ECLASS=1
 fi

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic