summaryrefslogtreecommitdiff
path: root/media-fonts/unifont/unifont-18.0.01.ebuild
blob: fce54c25d98aca23cd358045d4f4d1e71e651efa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright 2003-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit font optfeature toolchain-funcs verify-sig

DESCRIPTION="Unicode bitmap font with full Basic Multilingual Plane coverage"
HOMEPAGE="https://unifoundry.com/"
SRC_URI="
	mirror://gnu/${PN}/${P}/${P}.tar.gz
	verify-sig? ( mirror://gnu/${PN}/${P}/${P}.tar.gz.sig )
"

LICENSE="GPL-2+ || ( GPL-2+-with-font-exception OFL-1.1 ) public-domain utils? ( FDL-1.3+ )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="ttf utils"
REQUIRED_USE="ttf? ( utils )"

BDEPEND="
	media-libs/fontconfig
	utils? (
		app-text/bdf2psf
		x11-apps/bdftopcf
		ttf? ( media-gfx/fontforge )
	)
	verify-sig? ( sec-keys/openpgp-keys-paulhardy )
"

VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/paulhardy.asc

PATCHES=(
	"${FILESDIR}"/${PN}-17.0.03-Makefile.patch
	"${FILESDIR}"/${PN}-17.0.05-Makefile.patch
)

src_compile() {
	if use utils; then
		tc-export CC
		emake bindir libdir

		local font_targets=(
			opentype
			pcf
			psf
			$(usev ttf truetype)
			# compile unifont_all.hex
			$(usev utils coverage)
		)
		emake -C font "${font_targets[@]}"
	fi
}

src_install() {
	local installargs=(
		DESTDIR="${ED}"
		OTFDEST="${ED}${FONTDIR}"
		PCFDEST="${ED}${FONTDIR}"
	)
	emake "${installargs[@]}" -C font install

	if use ttf; then
		pushd "${S}"/font/compiled >/dev/null || die
		insinto /usr/share/fonts/unifont
		local files
		for files in *.ttf; do
			newins "${files}" "${files/-${PV}/}"
		done
		popd >/dev/null || die
	fi

	if use utils; then
		emake DESTDIR="${ED}" install

		local HTML_DOCS=( doxygen/html/. )
		find "${HTML_DOCS[@]}" \( -iname '*.md5' -o -iname '*.map' \) -delete || die

		doman man/*.{1,5}
	fi

	einstalldocs

	font_xfont_config
	font_fontconfig
}

pkg_postinst() {
	font_pkg_postinst

	use utils && optfeature "unifont-viewer" dev-perl/Wx
	use utils && optfeature "unipng2hex"  dev-perl/GD virtual/perl-Getopt-Long
}