summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2021-04-05 20:16:07 +0200
committerDavid Seifert <soap@gentoo.org>2021-04-05 20:16:07 +0200
commitdd33b3da11edd5bcaa3fd7eb55ad650e2f38ac59 (patch)
tree91375012e6f4d3b833bb1e7e7afb336956a9cf60 /eclass
parentdev-python/astroid: Remove old (diff)
downloadgentoo-dd33b3da11edd5bcaa3fd7eb55ad650e2f38ac59.tar.gz
gentoo-dd33b3da11edd5bcaa3fd7eb55ad650e2f38ac59.tar.bz2
gentoo-dd33b3da11edd5bcaa3fd7eb55ad650e2f38ac59.zip
font-ebdftopcf.eclass: Modernise
Closes: https://github.com/gentoo/gentoo/pull/20261 Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/font-ebdftopcf.eclass52
1 files changed, 31 insertions, 21 deletions
diff --git a/eclass/font-ebdftopcf.eclass b/eclass/font-ebdftopcf.eclass
index 889f821c2572..9b4538525449 100644
--- a/eclass/font-ebdftopcf.eclass
+++ b/eclass/font-ebdftopcf.eclass
@@ -3,7 +3,8 @@
# @ECLASS: font-ebdftopcf.eclass
# @MAINTAINER:
-# maintainer-needed@gentoo.org
+# fonts@gentoo.org
+# @SUPPORTED_EAPIS: 7
# @AUTHOR:
# Robin H. Johnson <robbat2@gentoo.org>
# @BLURB: Eclass to make PCF font generator from BDF uniform and optimal
@@ -11,39 +12,48 @@
# The manpage for this eclass is in media-gfx/ebdftopcf.
# Inherit this eclass after font.eclass
-# if USE="-X", this eclass is basically a no-op, since bdftopcf requires Xorg.
-IUSE="X"
+case ${EAPI} in
+ 7) ;;
+ *) die "EAPI=${EAPI:-0} is not supported" ;;
+esac
+
+EXPORT_FUNCTIONS src_compile
-# Variable declarations
-DEPEND="X? ( media-gfx/ebdftopcf )"
-RDEPEND=""
+if [[ -z ${_FONT_EBDFTOPCF_ECLASS} ]]; then
+_FONT_EBDFTOPCF_ECLASS=1
+
+# Make dependence on Xorg optional
+IUSE="X"
-#
-# Public functions
-#
+BDEPEND="X? ( media-gfx/ebdftopcf )"
+# @FUNCTION: ebdftopcf
+# @USAGE: <list of BDF files to convert>
+# @DESCRIPTION:
+# Convert BDF to PCF. This implicitly requires USE="X" to be enabled.
ebdftopcf() {
- local bdffiles
- bdffiles="$@"
- [ -z "$bdffiles" ] && die "No BDF files specified."
- emake -f "${EPREFIX}"/usr/share/ebdftopcf/Makefile.ebdftopcf \
+ debug-print-function ${FUNCNAME} "$@"
+
+ local bdffiles="$@"
+ [[ -z ${bdffiles} ]] && die "No BDF files specified"
+ emake -f "${BROOT}"/usr/share/ebdftopcf/Makefile.ebdftopcf \
BDFFILES="${bdffiles}" \
BDFTOPCF_PARAMS="${BDFTOPCF_PARAMS}" \
|| die "Failed to build PCF files"
}
-#
-# Public inheritable functions
-#
-
+# @FUNCTION: font-ebdftopcf_src_compile
+# @DESCRIPTION:
+# Default phase function to convert BDF to PCF. If USE="-X", this amounts to
+# a no-op, since bdftopcf requires Xorg.
font-ebdftopcf_src_compile() {
- use X && FONT_SUFFIX="pcf.gz"
- use X || FONT_SUFFIX="bdf"
+ debug-print-function ${FUNCNAME} "$@"
+ FONT_SUFFIX=$(usex X "pcf.gz" "bdf")
if use X; then
- [ -z "${BDFFILES}" ] && BDFFILES="$(find . -name '*.bdf')"
+ [[ -z ${BDFFILES} ]] && local BDFFILES="$(find . -name '*.bdf')"
ebdftopcf ${BDFFILES}
fi
}
-EXPORT_FUNCTIONS src_compile
+fi