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

EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )

inherit font python-any-r1

DESCRIPTION="Google Noto Emoji fonts"
HOMEPAGE="https://www.google.com/get/noto/ https://github.com/googlei18n/noto-emoji"

COMMIT="ac1703e9d7feebbf5443a986e08332b1e1c5afcf"
SRC_URI="https://github.com/googlei18n/noto-emoji/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0 OFL-1.1"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

BDEPEND="${PYTHON_DEPS}
	app-arch/zopfli
	$(python_gen_any_dep '
		dev-python/fonttools[${PYTHON_USEDEP}]
		dev-python/nototools[${PYTHON_USEDEP}]
	')
	media-gfx/pngquant
	x11-libs/cairo
	|| ( media-gfx/imagemagick[png] media-gfx/graphicsmagick[png] )
"

RESTRICT="binchecks strip"

S="${WORKDIR}/${PN}-${COMMIT}"

FONT_S="${S}"
FONT_SUFFIX="ttf"

python_check_deps() {
	has_version -b "dev-python/fonttools[${PYTHON_USEDEP}]" &&
	has_version -b "dev-python/nototools[${PYTHON_USEDEP}]"
}

pkg_setup() {
	font_pkg_setup
}

PATCHES=(
	# From Fedora
	"${FILESDIR}/${PN}-build-all-flags.patch"

	# https://github.com/googlei18n/noto-emoji/issues/240
	"${FILESDIR}/${PN}-20180823-build-path.patch"
)

src_prepare() {
	default

	# Based on Fedora patch to allow graphicsmagick usage
	if has_version media-gfx/graphicsmagick; then
		eapply "${FILESDIR}/${PN}-20190328-use-gm.patch"
	fi
}

src_compile() {
	python_setup
	default
}

src_install() {
	font_src_install

	# Don't lose fancy emoji icons
	insinto /usr/share/icons/"${PN}"/128x128/emotes/
	doins png/128/*.png

	insinto /usr/share/icons/"${PN}"/scalable/emotes/
	doins svg/*.svg
}