summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-06-07 10:31:57 +0200
committerMichał Górny <mgorny@gentoo.org>2020-06-07 11:16:12 +0200
commitc8134f595dde0e1d6c2c23e0b52c996d90ff5d8d (patch)
tree27f2c217dad59c85bc959c55cd9a355834d38cf2 /dev-python/matplotlib/matplotlib-3.2.1.ebuild
parentsys-process/glances: x86 stable wrt bug #720368 (diff)
downloadgentoo-c8134f595dde0e1d6c2c23e0b52c996d90ff5d8d.tar.gz
gentoo-c8134f595dde0e1d6c2c23e0b52c996d90ff5d8d.tar.bz2
gentoo-c8134f595dde0e1d6c2c23e0b52c996d90ff5d8d.zip
dev-python/matplotlib: Run tests against bundled freetype
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/matplotlib/matplotlib-3.2.1.ebuild')
-rw-r--r--dev-python/matplotlib/matplotlib-3.2.1.ebuild18
1 files changed, 11 insertions, 7 deletions
diff --git a/dev-python/matplotlib/matplotlib-3.2.1.ebuild b/dev-python/matplotlib/matplotlib-3.2.1.ebuild
index ac48950448ac..42e330b21693 100644
--- a/dev-python/matplotlib/matplotlib-3.2.1.ebuild
+++ b/dev-python/matplotlib/matplotlib-3.2.1.ebuild
@@ -9,9 +9,13 @@ PYTHON_REQ_USE='tk?,threads(+)'
DISTUTILS_USE_SETUPTOOLS=bdepend
inherit distutils-r1 flag-o-matic virtualx toolchain-funcs prefix
+FT_PV=2.6.1
DESCRIPTION="Pure python plotting library with matlab like syntax"
HOMEPAGE="https://matplotlib.org/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
+ test? (
+ https://downloads.sourceforge.net/project/freetype/freetype2/${FT_PV}/freetype-${FT_PV}.tar.gz
+ )"
# Main license: matplotlib
# Some modules: BSD
@@ -140,10 +144,6 @@ python_prepare_all() {
mkdir "${XDG_RUNTIME_DIR}" || die
chmod 0700 "${XDG_RUNTIME_DIR}" || die
- local freetype_version
- freetype_version="$(best_version media-libs/freetype | sed -r -e 's/.*-([0-9].*[0-9])(-r[0-9]+|$)/\1/g')"
- sed -i -r -e "s:(LOCAL_FREETYPE_VERSION =).*:\\1 \"${freetype_version}\":g" setupext.py lib/matplotlib/__init__.py || die
-
distutils-r1_python_prepare_all
}
@@ -213,9 +213,13 @@ python_compile_all() {
}
python_test() {
- wrap_setup distutils_install_for_testing
+ # we need to rebuild mpl against bundled freetype, otherwise
+ # over 1000 tests will fail because of mismatched font rendering
+ local -x MPLLOCALFREETYPE=1
+ ln -s "${WORKDIR}/freetype-${FT_PV}" "${BUILD_DIR}" || die
+ wrap_setup distutils-r1_python_compile --build-lib="${BUILD_DIR}"/test-lib
+ local -x PYTHONPATH=${BUILD_DIR}/test-lib:${PYTHONPATH}
- distutils_install_for_testing
"${EPYTHON}" -c "import sys, matplotlib as m; sys.exit(m.test(verbosity=2))" || die
}