Skip to content

Commit

Permalink
media-fonts/liberation-fonts: Fix python-any-r1 usage
Browse files Browse the repository at this point in the history
Non-maintainer commit.

The usage of python-any-r1 was incomplete.  This commit fixes:

* Adding python_gen_any_dep so valid USE are connected to python deps
* Adding python_check_deps to validate if a dep is actually installed
* sed the Makefile to use EPYTHON for consistent builds instead of user pref
* Changing DEPEND to BDEPEND on EAPI7 as they are tools run by the build

Closes: https://bugs.gentoo.org/698128
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Brian Evans <[email protected]>
  • Loading branch information
Brian Evans committed Dec 10, 2019
1 parent 07d90af commit bc165d7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
15 changes: 13 additions & 2 deletions media-fonts/liberation-fonts/liberation-fonts-2.00.1-r3.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
Expand All @@ -25,10 +25,21 @@ DEPEND="
fontforge? (
${PYTHON_DEPS}
media-gfx/fontforge
dev-python/fonttools
$(python_gen_any_dep '<dev-python/fonttools-4.0[${PYTHON_USEDEP}]')
)"
RDEPEND=""

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

src_prepare() {
default
if use fontforge ; then
sed -i "s/= python/= ${EPYTHON}/" Makefile || die
fi
}

pkg_setup() {
if use fontforge; then
FONT_S="${S}/${PN}-ttf-${PV}"
Expand Down
19 changes: 15 additions & 4 deletions media-fonts/liberation-fonts/liberation-fonts-2.00.5.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ inherit font python-any-r1

DESCRIPTION="A Helvetica/Times/Courier replacement TrueType font set, courtesy of Red Hat"
HOMEPAGE="https://github.com/liberationfonts/liberation-fonts"
SRC_URI="!fontforge? ( ${HOMEPAGE}/files/2926169/${PN}-ttf-${PV}.tar.gz )
fontforge? ( ${HOMEPAGE}/files/2926167/${P}.tar.gz )"
SRC_URI="!fontforge? ( https://github.com/liberationfonts/liberation-fonts/files/2926169/${PN}-ttf-${PV}.tar.gz )
fontforge? ( https://github.com/liberationfonts/liberation-fonts/files/2926167/${P}.tar.gz )"

KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~x64-solaris"
SLOT="0"
Expand All @@ -21,13 +21,24 @@ FONT_SUFFIX="ttf"

FONT_CONF=( "${FILESDIR}/60-liberation.conf" )

DEPEND="
BDEPEND="
fontforge? (
${PYTHON_DEPS}
media-gfx/fontforge
dev-python/fonttools
$(python_gen_any_dep 'dev-python/fonttools[${PYTHON_USEDEP}]')
)"

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

src_prepare() {
default
if use fontforge ; then
sed -i "s/= python3/= ${EPYTHON}/" Makefile || die
fi
}

pkg_setup() {
if use fontforge; then
FONT_S="${S}/${PN}-ttf-${PV}"
Expand Down

0 comments on commit bc165d7

Please sign in to comment.