summaryrefslogtreecommitdiff
blob: 899fa682a7110c3d4d0a39085f0f0936978425d6 (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
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools qmake-utils

DESCRIPTION="Application and libary for hinting TrueType fonts"
HOMEPAGE="https://freetype.org/ttfautohint"
SRC_URI="https://download.savannah.gnu.org/releases/freetype/${P}.tar.gz"

LICENSE="|| ( FTL GPL-2+ )"
SLOT="0/1.0.3"
KEYWORDS="amd64"
IUSE="qt5"

RDEPEND="
	media-libs/freetype
	media-libs/harfbuzz:=[truetype]
	qt5? (
		dev-qt/qtcore:5
		dev-qt/qtgui:5
		dev-qt/qtwidgets:5
	)
"
DEPEND="${RDEPEND}"
BDEPEND="
	sys-apps/help2man
	virtual/pkgconfig
"

# libttfautohint is versioned separately, check lib/local.mk.
QA_PKGCONFIG_VERSION="1.3.0"

src_prepare() {
	default

	# Don't invoke git to get the version number.
	sed "s|m4_esyscmd.*VERSION)|${PV//_/-}|" -i configure.ac || die

	# musl does not define _Bool for c++, bug #836426
	sed 's/_Bool/bool/' -i lib/llrb.h || die

	eautoreconf
}

src_configure() {
	local myeconfargs=(
		--disable-static
		--without-doc
		--with-qt="$(usex qt5 $(qt5_get_bindir) no)"
	)

	econf "${myeconfargs[@]}"
}

src_install() {
	default

	doman frontend/ttfautohint.1
	use qt5 && doman frontend/ttfautohintGUI.1

	find "${ED}" -name '*.la' -delete || die
}