mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2025-07-19 15:29:08 +02:00
python-matplotlib: Upgrade to 2.0.2
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
parent
59cbb1d54d
commit
10c8c39c25
|
@ -1,29 +0,0 @@
|
||||||
This fixes the dependency checks inside of setup.py since things like
|
|
||||||
'import numpy' won't work with bitbake.
|
|
||||||
|
|
||||||
diff --git a/setup.py b/setup.py
|
|
||||||
index 2f13821..e6d6ed0 100644
|
|
||||||
--- a/setup.py
|
|
||||||
+++ b/setup.py
|
|
||||||
@@ -113,12 +113,6 @@ if 1:
|
|
||||||
baseline_images = [chop_package(f) for f in baseline_images]
|
|
||||||
package_data['matplotlib'].extend(baseline_images)
|
|
||||||
|
|
||||||
-if not check_for_numpy():
|
|
||||||
- sys.exit(1)
|
|
||||||
-
|
|
||||||
-if not check_for_freetype():
|
|
||||||
- sys.exit(1)
|
|
||||||
-
|
|
||||||
build_ft2font(ext_modules, packages)
|
|
||||||
build_ttconv(ext_modules, packages)
|
|
||||||
build_contour(ext_modules, packages)
|
|
||||||
@@ -129,7 +123,7 @@ build_tri(ext_modules, packages)
|
|
||||||
|
|
||||||
print_raw("")
|
|
||||||
print_raw("OPTIONAL BACKEND DEPENDENCIES")
|
|
||||||
-has_libpng = check_for_libpng()
|
|
||||||
+has_libpng = True
|
|
||||||
|
|
||||||
if has_libpng and options['build_agg']:
|
|
||||||
build_agg(ext_modules, packages)
|
|
|
@ -1,40 +1,110 @@
|
||||||
This fixes the numpy import problem in setupext.py using a hard-coded path.
|
This fixes the numpy import problem in setupext.py using a hard-coded path.
|
||||||
|
|
||||||
Index: matplotlib-1.1.0/setupext.py
|
Index: matplotlib-2.0.2/setupext.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- matplotlib-1.1.0.orig/setupext.py
|
--- matplotlib-2.0.2.orig/setupext.py
|
||||||
+++ matplotlib-1.1.0/setupext.py
|
+++ matplotlib-2.0.2/setupext.py
|
||||||
@@ -122,8 +122,8 @@ numpy_inc_dirs = []
|
@@ -148,6 +148,7 @@ def has_include_file(include_dirs, filen
|
||||||
# matplotlib build options, which can be altered using setup.cfg
|
Returns `True` if `filename` can be found in one of the
|
||||||
options = {'display_status': True,
|
directories in `include_dirs`.
|
||||||
'verbose': False,
|
"""
|
||||||
- 'provide_pytz': 'auto',
|
+ return True
|
||||||
- 'provide_dateutil': 'auto',
|
if sys.platform == 'win32':
|
||||||
+ 'provide_pytz': False,
|
include_dirs += os.environ.get('INCLUDE', '.').split(';')
|
||||||
+ 'provide_dateutil': False,
|
for dir in include_dirs:
|
||||||
'build_agg': True,
|
@@ -172,7 +173,7 @@ def get_base_dirs():
|
||||||
'build_gtk': 'auto',
|
Returns a list of standard base directories on this platform.
|
||||||
'build_gtkagg': 'auto',
|
"""
|
||||||
@@ -176,10 +176,7 @@ if os.path.exists(setup_cfg):
|
if options['basedirlist']:
|
||||||
except: pass
|
- return options['basedirlist']
|
||||||
|
+ return [os.environ['STAGING_LIBDIR']]
|
||||||
|
|
||||||
# For get_base_flags:
|
basedir_map = {
|
||||||
-if options['basedirlist']:
|
'win32': ['win32_static', ],
|
||||||
- basedirlist = options['basedirlist'].split()
|
@@ -260,14 +261,6 @@ def make_extension(name, files, *args, *
|
||||||
-else:
|
`distutils.core.Extension` constructor.
|
||||||
- basedirlist = basedir[sys.platform]
|
"""
|
||||||
+basedirlist = [os.environ['STAGING_LIBDIR']]
|
ext = DelayedExtension(name, files, *args, **kwargs)
|
||||||
print("basedirlist is: %s" % basedirlist)
|
- for dir in get_base_dirs():
|
||||||
|
- include_dir = os.path.join(dir, 'include')
|
||||||
|
- if os.path.exists(include_dir):
|
||||||
|
- ext.include_dirs.append(include_dir)
|
||||||
|
- for lib in ('lib', 'lib64'):
|
||||||
|
- lib_dir = os.path.join(dir, lib)
|
||||||
|
- if os.path.exists(lib_dir):
|
||||||
|
- ext.library_dirs.append(lib_dir)
|
||||||
|
ext.include_dirs.append('.')
|
||||||
|
|
||||||
if options['display_status']:
|
return ext
|
||||||
@@ -555,8 +552,8 @@ def check_for_numpy():
|
@@ -314,6 +307,7 @@ class PkgConfig(object):
|
||||||
|
" matplotlib may not be able to find some of its dependencies")
|
||||||
|
|
||||||
def add_numpy_flags(module):
|
def set_pkgconfig_path(self):
|
||||||
"Add the modules flags to build extensions which use numpy"
|
+ return
|
||||||
- import numpy
|
pkgconfig_path = sysconfig.get_config_var('LIBDIR')
|
||||||
- module.include_dirs.append(numpy.get_include())
|
if pkgconfig_path is None:
|
||||||
+ # Hard-coded path for OE since I know this is where numpy's include dir will be
|
return
|
||||||
+ module.include_dirs.append(os.path.join(os.environ['STAGING_LIBDIR'], 'python2.7/site-packages/numpy/core/include/'))
|
@@ -875,14 +869,14 @@ class Numpy(SetupPackage):
|
||||||
|
reload(numpy)
|
||||||
|
|
||||||
def add_png_flags(module):
|
ext = Extension('test', [])
|
||||||
try_pkgconfig(module, 'libpng', 'png')
|
- ext.include_dirs.append(numpy.get_include())
|
||||||
|
+ ext.include_dirs.append(os.path.join(os.environ['STAGING_LIBDIR'], 'python2.7/site-packages/numpy/core/include/'))
|
||||||
|
if not has_include_file(
|
||||||
|
ext.include_dirs, os.path.join("numpy", "arrayobject.h")):
|
||||||
|
warnings.warn(
|
||||||
|
"The C headers for numpy could not be found. "
|
||||||
|
"You may need to install the development package")
|
||||||
|
|
||||||
|
- return [numpy.get_include()]
|
||||||
|
+ return [os.path.join(os.environ['STAGING_LIBDIR'], 'python2.7/site-packages/numpy/core/include/')]
|
||||||
|
|
||||||
|
def check(self):
|
||||||
|
min_version = extract_versions()['__version__numpy__']
|
||||||
|
Index: matplotlib-2.0.2/setup.py
|
||||||
|
===================================================================
|
||||||
|
--- matplotlib-2.0.2.orig/setup.py
|
||||||
|
+++ matplotlib-2.0.2/setup.py
|
||||||
|
@@ -66,28 +66,6 @@ mpl_packages = [
|
||||||
|
setupext.Python(),
|
||||||
|
setupext.Platform(),
|
||||||
|
'Required dependencies and extensions',
|
||||||
|
- setupext.Numpy(),
|
||||||
|
- setupext.Six(),
|
||||||
|
- setupext.Dateutil(),
|
||||||
|
- setupext.FuncTools32(),
|
||||||
|
- setupext.Subprocess32(),
|
||||||
|
- setupext.Pytz(),
|
||||||
|
- setupext.Cycler(),
|
||||||
|
- setupext.Tornado(),
|
||||||
|
- setupext.Pyparsing(),
|
||||||
|
- setupext.LibAgg(),
|
||||||
|
- setupext.FreeType(),
|
||||||
|
- setupext.FT2Font(),
|
||||||
|
- setupext.Png(),
|
||||||
|
- setupext.Qhull(),
|
||||||
|
- setupext.Image(),
|
||||||
|
- setupext.TTConv(),
|
||||||
|
- setupext.Path(),
|
||||||
|
- setupext.ContourLegacy(),
|
||||||
|
- setupext.Contour(),
|
||||||
|
- setupext.Delaunay(),
|
||||||
|
- setupext.QhullWrap(),
|
||||||
|
- setupext.Tri(),
|
||||||
|
'Optional subpackages',
|
||||||
|
setupext.SampleData(),
|
||||||
|
setupext.Toolkits(),
|
||||||
|
@@ -100,13 +78,8 @@ mpl_packages = [
|
||||||
|
setupext.BackendMacOSX(),
|
||||||
|
setupext.BackendQt5(),
|
||||||
|
setupext.BackendQt4(),
|
||||||
|
- setupext.BackendGtk3Agg(),
|
||||||
|
setupext.BackendGtk3Cairo(),
|
||||||
|
- setupext.BackendGtkAgg(),
|
||||||
|
- setupext.BackendTkAgg(),
|
||||||
|
- setupext.BackendWxAgg(),
|
||||||
|
setupext.BackendGtk(),
|
||||||
|
- setupext.BackendAgg(),
|
||||||
|
setupext.BackendCairo(),
|
||||||
|
setupext.Windowing(),
|
||||||
|
'Optional LaTeX dependencies',
|
||||||
|
|
|
@ -1,33 +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://README.txt;md5=83c5bf8b16a5f99507f2f47a21ae3b81"
|
|
||||||
PR = "r1"
|
|
||||||
|
|
||||||
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 = "${SOURCEFORGE_MIRROR}/matplotlib/matplotlib-${PV}.tar.gz \
|
|
||||||
file://fix_setup.patch \
|
|
||||||
file://fix_setupext.patch \
|
|
||||||
"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/matplotlib-${PV}"
|
|
||||||
|
|
||||||
EXTRA_OECONF = "--disable-docs --with-python-includes=${STAGING_INCDIR}/../"
|
|
||||||
|
|
||||||
inherit distutils
|
|
||||||
|
|
||||||
do_compile_prepend() {
|
|
||||||
${STAGING_BINDIR_NATIVE}/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
# need to export these variables for python-config to work
|
|
||||||
export PYTHONPATH
|
|
||||||
export STAGING_INCDIR
|
|
||||||
export STAGING_LIBDIR
|
|
||||||
|
|
||||||
|
|
||||||
SRC_URI[md5sum] = "57a627f30b3b27821f808659889514c2"
|
|
||||||
SRC_URI[sha256sum] = "be37e1d86c65ecacae6683f8805e051e9904e5f2e02bf2b7a34262c46a6d06a7"
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user