aboutsummaryrefslogtreecommitdiff
blob: 43d23fb3d02e25869fa2528944966eb6bdbf006d (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

COMMIT="e33ccf3515cc5b8005a3a50b4163663623649d20"
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_SETUPTOOLS=rdepend
PYTHON_COMPAT=( python3_{8..9} )

inherit distutils-r1

SRC_URI="
	https://github.com/googlefonts/gftools/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/schriftgestalt/GlyphsInfo/archive/${COMMIT}.tar.gz -> GlyphsInfo-${COMMIT}.tar.gz
"
KEYWORDS="~amd64"
DESCRIPTION="Miscellaneous tools for working with the Google Fonts collection"
HOMEPAGE="https://github.com/googlefonts/gftools"
LICENSE="Apache-2.0"
SLOT="0"

RESTRICT="test"
PROPERTIES="test_network"

RDEPEND="
	dev-python/statmake[${PYTHON_SINGLE_USEDEP}]
	$(python_gen_cond_dep '
		app-arch/brotli[python,${PYTHON_USEDEP}]
		dev-python/absl-py[${PYTHON_USEDEP}]
		dev-python/babelfont[${PYTHON_USEDEP}]
		dev-python/browserstack-local-python[${PYTHON_USEDEP}]
		dev-python/fonttools[${PYTHON_USEDEP}]
		dev-python/glyphsLib[${PYTHON_USEDEP}]
		dev-python/ots-python[${PYTHON_USEDEP}]
		dev-python/protobuf-python[${PYTHON_USEDEP}]
		dev-python/pybrowserstack-screenshots[${PYTHON_USEDEP}]
		dev-python/pygit2[${PYTHON_USEDEP}]
		dev-python/PyGithub[${PYTHON_USEDEP}]
		dev-python/pyyaml[${PYTHON_USEDEP}]
		dev-python/strictyaml[${PYTHON_USEDEP}]
		dev-python/requests[${PYTHON_USEDEP}]
		dev-python/tabulate[${PYTHON_USEDEP}]
		dev-python/ttfautohint-py[${PYTHON_USEDEP}]
		dev-python/unidecode[${PYTHON_USEDEP}]
		dev-python/vttlib[${PYTHON_USEDEP}]
		dev-util/fontmake[${PYTHON_USEDEP}]
	')
"
DEPEND="${RDEPEND}"
BDEPEND="
	$(python_gen_cond_dep '
		dev-python/setuptools_scm[${PYTHON_USEDEP}]
	')
	test? (
		$(python_gen_cond_dep '
			dev-python/tabulate[${PYTHON_USEDEP}]
			media-gfx/fontforge[python,${PYTHON_SINGLE_USEDEP}]
		')
	)
"

PATCHES=(
	"${FILESDIR}/${PN}-setup.diff"
	"${FILESDIR}/${PN}-tests.diff"
)

distutils_enable_tests pytest

python_prepare_all() {
	mv "${WORKDIR}/GlyphsInfo"/*.xml "Lib/${PN}/util/GlyphsInfo"
	export SETUPTOOLS_SCM_PRETEND_VERSION="${PV/_p/.post}"
	distutils-r1_python_prepare_all
}

python_test() {
	local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
	local -x PATH="${S}:${PATH}"
	distutils_install_for_testing
	epytest -vv
}