464b2a00d2af00a87a36c72885c9b6766cb3e9d3
[gentoo.git] / media-fonts / liberation-fonts / liberation-fonts-2.00.5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7} )
7
8 inherit font python-any-r1
9
10 DESCRIPTION="A Helvetica/Times/Courier replacement TrueType font set, courtesy of Red Hat"
11 HOMEPAGE="https://github.com/liberationfonts/liberation-fonts"
12 SRC_URI="!fontforge? ( https://github.com/liberationfonts/liberation-fonts/files/2926169/${PN}-ttf-${PV}.tar.gz )
13 fontforge? ( https://github.com/liberationfonts/liberation-fonts/files/2926167/${P}.tar.gz )"
14
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~x64-solaris"
16 SLOT="0"
17 LICENSE="OFL-1.1"
18 IUSE="fontforge X"
19
20 FONT_SUFFIX="ttf"
21
22 FONT_CONF=( "${FILESDIR}/60-liberation.conf" )
23
24 BDEPEND="
25         fontforge? (
26                 ${PYTHON_DEPS}
27                 media-gfx/fontforge
28                 $(python_gen_any_dep 'dev-python/fonttools[${PYTHON_USEDEP}]')
29         )"
30
31 python_check_deps() {
32         has_version -b "dev-python/fonttools[${PYTHON_USEDEP}]"
33 }
34
35 src_prepare() {
36         default
37         if use fontforge ; then
38                 sed -i "s/= python3/= ${EPYTHON}/" Makefile || die
39         fi
40 }
41
42 pkg_setup() {
43         if use fontforge; then
44                 FONT_S="${S}/${PN}-ttf-${PV}"
45                 python-any-r1_pkg_setup
46         else
47                 FONT_S="${WORKDIR}/${PN}-ttf-${PV}"
48                 S="${FONT_S}"
49         fi
50         font_pkg_setup
51 }