aboutsummaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python/recipes-devtools')
-rw-r--r--meta-python/recipes-devtools/python/python-matplotlib.inc150
-rw-r--r--meta-python/recipes-devtools/python/python-matplotlib/pytest.ini4
-rw-r--r--meta-python/recipes-devtools/python/python-matplotlib/run-ptest2
-rw-r--r--meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb18
-rw-r--r--meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb4
-rw-r--r--meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb2
6 files changed, 162 insertions, 18 deletions
diff --git a/meta-python/recipes-devtools/python/python-matplotlib.inc b/meta-python/recipes-devtools/python/python-matplotlib.inc
new file mode 100644
index 0000000000..3c340dab78
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-matplotlib.inc
@@ -0,0 +1,150 @@
+DESCRIPTION = "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE/LICENSE;md5=afec61498aa5f0c45936687da9a53d74"
+
+SRC_URI[md5sum] = "cd26ba402c5ead6b0ecc00072f6617b4"
+SRC_URI[sha256sum] = "725a3f12739d133adfa381e1b33bd70c6f64db453bfc536e148824816e568894"
+
+DEPENDS += "freetype \
+ libagg \
+ libpng \
+ ${PYTHON_PN}-cycler \
+ ${PYTHON_PN}-dateutil \
+ ${PYTHON_PN}-numpy \
+ ${PYTHON_PN}-numpy-native \
+ ${PYTHON_PN}-pycairo \
+ ${PYTHON_PN}-pytz \
+ qhull \
+ "
+RDEPENDS_${PN} = "freetype \
+ libagg \
+ libpng \
+ ${PYTHON_PN}-core \
+ ${PYTHON_PN}-cycler \
+ ${PYTHON_PN}-dateutil \
+ ${PYTHON_PN}-distutils \
+ ${PYTHON_PN}-numpy \
+ ${PYTHON_PN}-pycairo \
+ ${PYTHON_PN}-pyparsing \
+ ${PYTHON_PN}-pytz \
+ qhull \
+ "
+
+# Use common directory for python2/python3 patches
+FILESEXTRAPATHS_prepend := "${THISDIR}/python-matplotlib:"
+#file://fix_setupext.patch
+SRC_URI += " \
+ file://run-ptest \
+ file://pytest.ini \
+ "
+
+S = "${WORKDIR}/matplotlib-${PV}"
+
+EXTRA_OECONF = "--with-python-includes=${STAGING_INCDIR}/../"
+
+inherit pypi pkgconfig
+
+export MATPLOTLIB_DIR="${libdir}/${PYTHON_DIR}/site-packages/matplotlib"
+
+# Supported backends, one of: Agg, Cairo, GTK, GTKAgg, GTKCairo,
+# GTK3Agg, GTK3Cairo, MacOSX, Pdf, Ps, Qt4Agg, Qt5Agg, SVG, TkAgg,
+# WX, WXAgg.
+#
+# NOTE: not all of these have been implemented in OE, yet
+PACKAGECONFIG ??= "Cairo"
+PACKAGECONFIG[Agg] = ",,libagg"
+PACKAGECONFIG[Cairo] = ",,${PYTHON_PN}-pycairo-native,${PYTHON_PN}-pycairo"
+PACKAGECONFIG[Qt4Agg] = ",,${PYTHON_PN}-pyqt4 libagg"
+PACKAGECONFIG[Qt5Agg] = ",,${PYTHON_PN}-pyqt5 libagg"
+# NOTE:
+# oe-core does not build _tkinter module for python*
+# so python*-tkinter module is actually non-functional,
+# since http://git.openembedded.org/openembedded-core/commit/?id=8cc5e36cd7978186d5ea1fe8af2f2bd6b3df8885
+PACKAGECONFIG[TkAgg] = ",,${PYTHON_PN}-tkinter tk tk-lib libagg"
+PACKAGECONFIG[docs] = "--enable-docs,--disable-docs, \
+ ${PYTHON_PN}-sphinx \
+ ${PYTHON_PN}-colorspacious \
+ ${PYTHON_PN}-ipython \
+ ${PYTHON_PN}-mock \
+ ${PYTHON_PN}-numpydoc \
+ ${PYTHON_PN}-pillow \
+ ${PYTHON_PN}-scipy \
+ ${PYTHON_PN}-sphinx-gallery"
+
+python do_write_setup_cfg() {
+ conf=(d.getVar('PACKAGECONFIG', True) or "").split()
+ bb.debug(1, "PACKAGECONFIG=%s" % conf)
+ if 'Agg' in conf:
+ bb.debug(1, "Configuring Agg backend")
+ if 'Cairo' in conf:
+ bb.debug(1, "Configuring Cairo backend")
+}
+
+# configure the build for cross-compiling and a known supported backend
+do_configure_prepend() {
+ agg=False
+ tkagg=False
+ ignore_qt4=" --ignore tests/test_qt4.py"
+ ignore_qt5=" --ignore tests/test_qt5.py"
+ if ${@bb.utils.contains('PACKAGECONFIG', 'Agg', 'true', 'false', d)}; then
+ backend=Agg
+ agg=True
+ elif ${@bb.utils.contains('PACKAGECONFIG', 'Cairo', 'true', 'false', d)}; then
+ backend=Cairo
+ elif ${@bb.utils.contains('PACKAGECONFIG', 'Qt4Agg', 'true', 'false', d)}; then
+ backend=Qt4Agg
+ agg=True
+ ignore_qt4=''
+ elif ${@bb.utils.contains('PACKAGECONFIG', 'Qt5Agg', 'true', 'false', d)}; then
+ backend=Qt5Agg
+ agg=True
+ ignore_qt5=''
+ elif ${@bb.utils.contains('PACKAGECONFIG', 'TkAgg', 'true', 'false', d)}; then
+ backend=TkAgg
+ agg=True
+ tkagg=True
+ fi
+ cp ${S}/setup.cfg.template ${B}/setup.cfg
+ sed -i -e \
+ "s:#basedirlist = /usr:basedirlist = ${STAGING_EXECPREFIXDIR}:g" \
+ ${B}/setup.cfg
+# matplotlib wants freetype v2.6.1
+# the following tries to download that version to build it
+# sed -i -e "s:#local_freetype = False:local_freetype = True:g" ${B}/setup.cfg
+ sed -i -e "s:#tests = False:tests = True:g" ${B}/setup.cfg
+ sed -i -e "s:#agg = auto:agg = ${agg}:g" ${B}/setup.cfg
+ sed -i -e "s:#tkagg = auto:tkagg = ${tkagg}:g" ${B}/setup.cfg
+ sed -i -e "s:#backend = Agg:backend = ${backend}:g" ${B}/setup.cfg
+ echo "" >> ${B}/setup.cfg
+ echo "verbose = True" >> ${B}/setup.cfg
+}
+
+RDEPENDS_${PN}-ptest += " \
+ libagg \
+ ${PN} \
+ ${PYTHON_PN}-mock \
+ ${PYTHON_PN}-nose \
+ ${PYTHON_PN}-pytest \
+"
+
+addtask do_write_setup_cfg after do_configure before do_populate_lic
+
+inherit ptest
+
+do_install_ptest_prepend() {
+ sed -i -e "s:\@MATPLOTLIB_DIR\@:${MATPLOTLIB_DIR}:g" ${WORKDIR}/run-ptest
+ sed -i -e "s:\@MATPLOTLIB_DIR\@:${MATPLOTLIB_DIR}:g" ${WORKDIR}/pytest.ini
+}
+
+do_install_ptest() {
+ install -m 0644 ${WORKDIR}/pytest.ini ${D}${MATPLOTLIB_DIR}/
+}
+
+FILES_${PN}-ptest += " \
+ ${MATPLOTLIB_DIR}/sphinxext/tests \
+ ${MATPLOTLIB_DIR}/tests \
+ ${MATPLOTLIB_DIR}/testing \
+"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-python/recipes-devtools/python/python-matplotlib/pytest.ini b/meta-python/recipes-devtools/python/python-matplotlib/pytest.ini
new file mode 100644
index 0000000000..746aa2d57c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-matplotlib/pytest.ini
@@ -0,0 +1,4 @@
+[pytest]
+; test_agg.py test case 4 causes Out of Memory error on qemu
+argopts = --ignore @MATPLOTLIB_DIR@/test_agg.py
+; --ignore @MATPLOTLIB_DIR@/test_backend_pdf.py --ignore @MATPLOTLIB_DIR@/test_text.py
diff --git a/meta-python/recipes-devtools/python/python-matplotlib/run-ptest b/meta-python/recipes-devtools/python/python-matplotlib/run-ptest
new file mode 100644
index 0000000000..3015cd93e4
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-matplotlib/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+py.test @MATPLOTLIB_DIR@ --junit-xml matplotlib.xml
diff --git a/meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb b/meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb
deleted file mode 100644
index 5b1c3f05b9..0000000000
--- a/meta-python/recipes-devtools/python/python-matplotlib_2.0.2.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-DESCRIPTION = "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats"
-SECTION = "devel/python"
-LICENSE = "PSF"
-LIC_FILES_CHKSUM = "file://LICENSE/LICENSE;md5=afec61498aa5f0c45936687da9a53d74"
-
-DEPENDS += "python-numpy freetype libpng python-dateutil python-pytz"
-RDEPENDS_${PN} = "python-core python-distutils python-numpy freetype libpng python-dateutil python-pytz"
-
-SRC_URI = "https://github.com/matplotlib/matplotlib/archive/v${PV}.tar.gz \
- file://fix_setupext.patch \
-"
-SRC_URI[md5sum] = "89717c1ef3c6fdcd6fb1f3b597a4858c"
-SRC_URI[sha256sum] = "aebed23921562792b68b8ca355de5abc176af4424f1987e2fa95f65e5c5e7e89"
-S = "${WORKDIR}/matplotlib-${PV}"
-EXTRA_OECONF = "--disable-docs"
-
-inherit setuptools pkgconfig
-
diff --git a/meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb b/meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb
new file mode 100644
index 0000000000..ba9700d03d
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-matplotlib_2.1.2.bb
@@ -0,0 +1,4 @@
+require python-matplotlib.inc
+inherit setuptools python-dir
+
+RDEPENDS_${PN} += "python-backports-functools-lru-cache python-functools32"
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb b/meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb
new file mode 100644
index 0000000000..fd52622b0a
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-matplotlib_2.1.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools3 python3-dir
+require python-matplotlib.inc