--- terminus-font-4.48.ebuild 2020-05-12 22:58:31.000000000 +0100 +++ terminus-font-4.48-r1.ebuild 2020-05-12 22:58:31.000000000 +0100 @@ -1,31 +1,32 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 PYTHON_COMPAT=( python3_{6,7,8} ) inherit font python-any-r1 DESCRIPTION="A clean fixed font for the console and X11" HOMEPAGE="http://terminus-font.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz" LICENSE="OFL-1.1 GPL-2" SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" -IUSE="a-like-o +center-tilde distinct-l +pcf +pcf-unicode-only +psf quote +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" +IUSE="a-like-o +center-tilde distinct-l otf +pcf +pcf-unicode-only +psf quote ru-dv +ru-g ru-i ru-k" DEPEND="app-arch/gzip ${PYTHON_DEPS} virtual/awk + otf? ( x11-apps/fonttosfnt ) pcf? ( x11-apps/bdftopcf )" RDEPEND="" FONTDIR=/usr/share/fonts/terminus FONT_CONF=( 75-yes-terminus.conf ) DOCS=( README README-BG AUTHORS CHANGES ) REQUIRED_USE="X? ( pcf )" pkg_setup() { @@ -59,33 +60,42 @@ # selfwritten configure script ./configure "${configure_args[@]}" || die } src_compile() { local args=( $(usex psf 'psf psf-vgaw' '') $(usex pcf 'pcf pcf-8bit' '') ) [[ ${#args[@]} -gt 0 ]] && emake "${args[@]}" + + # Follow https://fedoraproject.org/wiki/BitmapFontConversion#Steps: + # build ".otf" (bitmap-only) fonts out of .bdf ones + if use otf; then + # use unicode only bitmaps + fonttosfnt -v -b -c -g 2 -m 2 -o Terminus.otb ter-u*n.bdf || die + fonttosfnt -v -b -c -g 2 -m 2 -o Terminus-Bold.otb ter-u*b.bdf || die + fi } src_install() { local args=( $(usex psf 'install-psf install-psf-vgaw install-psf-ref' '') $(usex pcf 'install-pcf' '') ) # Set the CHECKDIR to a dummy location so we always get the same set of # files installed regardless of what is in / or ROOT or wherever. [[ ${#args[@]} -gt 0 ]] && emake DESTDIR="${D}" CHECKDIR="${D}" "${args[@]}" # Remove trans files that the kbd package takes care of installing. rm -f "${ED}"/usr/share/consoletrans/*.trans if use pcf-unicode-only; then # Only the ter-x* fonts are unicode (ISO-10646-1) based rm -f "${ED}"/usr/share/fonts/terminus/ter-[0-9a-wy-z]* || die fi + use otf && FONT_SUFFIX=otb font_src_install einstalldocs }