blob: 2d31c4c23a4fd9fae0de217f376e70cc00d76ef8 (
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9..10} )
inherit font python-any-r1
DESCRIPTION="Google Noto Emoji fonts"
HOMEPAGE="https://www.google.com/get/noto/ https://github.com/googlefonts/noto-emoji"
COMMIT="e8073ab740292f8d5f19b5de144087ac58044d06"
SRC_URI="https://github.com/googlefonts/noto-emoji/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0 OFL-1.1"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv x86"
IUSE="buildfont"
BDEPEND="
buildfont? (
${PYTHON_DEPS}
app-arch/zopfli
$(python_gen_any_dep '
>=dev-python/fonttools-4.7.0[${PYTHON_USEDEP}]
>=dev-python/nototools-0.2.13[${PYTHON_USEDEP}]
')
media-gfx/pngquant
x11-libs/cairo
|| ( media-gfx/imagemagick[png] media-gfx/graphicsmagick[png] )
)
"
RESTRICT="binchecks strip"
S="${WORKDIR}/${PN}-${COMMIT}"
python_check_deps() {
python_has_version ">=dev-python/fonttools-4.7.0[${PYTHON_USEDEP}]" \
">=dev-python/nototools-0.2.13[${PYTHON_USEDEP}]"
}
pkg_setup() {
font_pkg_setup
use buildfont && python-any-r1_pkg_setup
}
src_prepare() {
default
# Drop font for Windows 10
rm fonts/NotoColorEmoji_WindowsCompatible.ttf || die
if use buildfont; then
# From Fedora
eapply "${FILESDIR}/${PN}-build-all-flags.patch"
# https://github.com/googlei18n/noto-emoji/issues/240
eapply "${FILESDIR}/${PN}-20180823-build-path.patch"
# Be more verbose, bug #717654
eapply "${FILESDIR}"/${PN}-pngquant-verbose.patch
sed -i -e 's:@$(ZOPFLIPNG) -y "$<" "$@" 1> /dev/null 2>&1:@$(ZOPFLIPNG) -y "$<" "$@":g' Makefile || die
# Based on Fedora patch to allow graphicsmagick usage
if has_version -b media-gfx/graphicsmagick[png]; then
eapply "${FILESDIR}/${PN}-20190328-use-gm.patch"
fi
fi
}
src_compile() {
if ! use buildfont; then
einfo "Installing pre-built fonts provided by upstream."
einfo "They could be not fully updated or miss some items."
einfo "To build fonts based on latest images enable 'buildfont'"
einfo "USE (that will require more time and resources too)."
else
python_setup
einfo "Building fonts..."
# From Debian:
# The build requires a VIRTUAL_ENV variable and sequence check isn't working
VIRTUAL_ENV=true \
BYPASS_SEQUENCE_CHECK=true \
default
fi
}
src_install() {
if ! use buildfont; then
FONT_S="${S}/fonts"
# Drop non used fonts
rm -f fonts/*COLR*.ttf || die
else
# Drop Windows compatible fonts and temporal files
rm -f *tmpl.ttf *Windows*.ttf *COLR*.ttf || die
# Built fonts
FONT_S="${S}"
# Don't lose fancy emoji icons
for i in 32 72 128 512; do
insinto "/usr/share/icons/${PN}/${i}/emotes/"
doins png/"${i}"/*.png
done
insinto /usr/share/icons/"${PN}"/scalable/emotes/
doins svg/*.svg
fi
FONT_SUFFIX="ttf"
font_src_install
dodoc README.md
}
|