*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / media-fonts / terminus-font / terminus-font-4.47.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_{6,7} )
7 inherit font python-any-r1
8
9 DESCRIPTION="A clean fixed font for the console and X11"
10 HOMEPAGE="http://terminus-font.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz"
12
13 LICENSE="OFL-1.1 GPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
16 IUSE="a-like-o +center-tilde distinct-l +pcf +pcf-unicode-only +psf quote
17         ru-dv +ru-g ru-i ru-k"
18
19 DEPEND="app-arch/gzip
20         ${PYTHON_DEPS}
21         virtual/awk
22         pcf? ( x11-apps/bdftopcf )"
23 RDEPEND=""
24
25 FONTDIR=/usr/share/fonts/terminus
26 FONT_CONF=( 75-yes-terminus.conf )
27 DOCS=( README README-BG AUTHORS CHANGES )
28
29 REQUIRED_USE="X? ( pcf )"
30
31 pkg_setup() {
32         python_setup
33 }
34
35 src_prepare() {
36         default
37
38         # Upstream patches. Some of them are suggested to be applied by default
39         # dv - de NOT like latin g, but like caps greek delta
40         #      ve NOT like greek beta, but like caps latin B
41         # ge - ge NOT like "mirrored" latin s, but like caps greek gamma
42         # ka - small ka NOT like minimised caps latin K, but like small latin k
43         use a-like-o            && eapply "${S}"/alt/ao2.diff
44         use center-tilde        && eapply "${S}"/alt/td1.diff
45         use distinct-l          && eapply "${S}"/alt/ll2.diff
46         use ru-i                && eapply "${S}"/alt/ij1.diff
47         use ru-k                && eapply "${S}"/alt/ka2.diff
48         use ru-dv               && eapply "${S}"/alt/dv1.diff
49         use ru-g                && eapply "${S}"/alt/ge2.diff
50         use quote               && eapply "${S}"/alt/gq2.diff
51 }
52
53 src_configure() {
54         local configure_args=(
55                 --prefix="${EPREFIX}"/usr
56                 --psfdir="${EPREFIX}"/usr/share/consolefonts
57                 --x11dir="${EPREFIX}"/${FONTDIR}
58         )
59         # selfwritten configure script
60         ./configure "${configure_args[@]}" || die
61 }
62
63 src_compile() {
64         local args=(
65                 $(usex psf 'psf psf-vgaw' '')
66                 $(usex pcf 'pcf pcf-8bit' '')
67         )
68         [[ ${#args[@]} -gt 0 ]] && emake "${args[@]}"
69 }
70
71 src_install() {
72         local args=(
73                 $(usex psf 'install-psf install-psf-vgaw install-psf-ref' '')
74                 $(usex pcf 'install-pcf' '')
75         )
76         # Set the CHECKDIR to a dummy location so we always get the same set of
77         # files installed regardless of what is in / or ROOT or wherever.
78         [[ ${#args[@]} -gt 0 ]] && emake DESTDIR="${D}" CHECKDIR="${D}" "${args[@]}"
79
80         # Remove trans files that the kbd package takes care of installing.
81         rm -f "${ED}"/usr/share/consoletrans/*.trans
82
83         if use pcf-unicode-only; then
84                 # Only the ter-x* fonts are unicode (ISO-10646-1) based
85                 rm -f "${ED}"/usr/share/fonts/terminus/ter-[0-9a-wy-z]* || die
86         fi
87
88         font_src_install
89
90         einstalldocs
91 }