Skip to content

Commit 10c8c39

Browse files
krajshr-project
authored andcommitted
python-matplotlib: Upgrade to 2.0.2
Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Martin Jansa <[email protected]>
1 parent 59cbb1d commit 10c8c39

File tree

4 files changed

+121
-95
lines changed

4 files changed

+121
-95
lines changed

meta-python/recipes-devtools/python/python-matplotlib/fix_setup.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 103 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,110 @@
11
This fixes the numpy import problem in setupext.py using a hard-coded path.
22

3-
Index: matplotlib-1.1.0/setupext.py
3+
Index: matplotlib-2.0.2/setupext.py
44
===================================================================
5-
--- matplotlib-1.1.0.orig/setupext.py
6-
+++ matplotlib-1.1.0/setupext.py
7-
@@ -122,8 +122,8 @@ numpy_inc_dirs = []
8-
# matplotlib build options, which can be altered using setup.cfg
9-
options = {'display_status': True,
10-
'verbose': False,
11-
- 'provide_pytz': 'auto',
12-
- 'provide_dateutil': 'auto',
13-
+ 'provide_pytz': False,
14-
+ 'provide_dateutil': False,
15-
'build_agg': True,
16-
'build_gtk': 'auto',
17-
'build_gtkagg': 'auto',
18-
@@ -176,10 +176,7 @@ if os.path.exists(setup_cfg):
19-
except: pass
5+
--- matplotlib-2.0.2.orig/setupext.py
6+
+++ matplotlib-2.0.2/setupext.py
7+
@@ -148,6 +148,7 @@ def has_include_file(include_dirs, filen
8+
Returns `True` if `filename` can be found in one of the
9+
directories in `include_dirs`.
10+
"""
11+
+ return True
12+
if sys.platform == 'win32':
13+
include_dirs += os.environ.get('INCLUDE', '.').split(';')
14+
for dir in include_dirs:
15+
@@ -172,7 +173,7 @@ def get_base_dirs():
16+
Returns a list of standard base directories on this platform.
17+
"""
18+
if options['basedirlist']:
19+
- return options['basedirlist']
20+
+ return [os.environ['STAGING_LIBDIR']]
2021

21-
# For get_base_flags:
22-
-if options['basedirlist']:
23-
- basedirlist = options['basedirlist'].split()
24-
-else:
25-
- basedirlist = basedir[sys.platform]
26-
+basedirlist = [os.environ['STAGING_LIBDIR']]
27-
print("basedirlist is: %s" % basedirlist)
22+
basedir_map = {
23+
'win32': ['win32_static', ],
24+
@@ -260,14 +261,6 @@ def make_extension(name, files, *args, *
25+
`distutils.core.Extension` constructor.
26+
"""
27+
ext = DelayedExtension(name, files, *args, **kwargs)
28+
- for dir in get_base_dirs():
29+
- include_dir = os.path.join(dir, 'include')
30+
- if os.path.exists(include_dir):
31+
- ext.include_dirs.append(include_dir)
32+
- for lib in ('lib', 'lib64'):
33+
- lib_dir = os.path.join(dir, lib)
34+
- if os.path.exists(lib_dir):
35+
- ext.library_dirs.append(lib_dir)
36+
ext.include_dirs.append('.')
2837

29-
if options['display_status']:
30-
@@ -555,8 +552,8 @@ def check_for_numpy():
38+
return ext
39+
@@ -314,6 +307,7 @@ class PkgConfig(object):
40+
" matplotlib may not be able to find some of its dependencies")
3141

32-
def add_numpy_flags(module):
33-
"Add the modules flags to build extensions which use numpy"
34-
- import numpy
35-
- module.include_dirs.append(numpy.get_include())
36-
+ # Hard-coded path for OE since I know this is where numpy's include dir will be
37-
+ module.include_dirs.append(os.path.join(os.environ['STAGING_LIBDIR'], 'python2.7/site-packages/numpy/core/include/'))
42+
def set_pkgconfig_path(self):
43+
+ return
44+
pkgconfig_path = sysconfig.get_config_var('LIBDIR')
45+
if pkgconfig_path is None:
46+
return
47+
@@ -875,14 +869,14 @@ class Numpy(SetupPackage):
48+
reload(numpy)
3849

39-
def add_png_flags(module):
40-
try_pkgconfig(module, 'libpng', 'png')
50+
ext = Extension('test', [])
51+
- ext.include_dirs.append(numpy.get_include())
52+
+ ext.include_dirs.append(os.path.join(os.environ['STAGING_LIBDIR'], 'python2.7/site-packages/numpy/core/include/'))
53+
if not has_include_file(
54+
ext.include_dirs, os.path.join("numpy", "arrayobject.h")):
55+
warnings.warn(
56+
"The C headers for numpy could not be found. "
57+
"You may need to install the development package")
58+
59+
- return [numpy.get_include()]
60+
+ return [os.path.join(os.environ['STAGING_LIBDIR'], 'python2.7/site-packages/numpy/core/include/')]
61+
62+
def check(self):
63+
min_version = extract_versions()['__version__numpy__']
64+
Index: matplotlib-2.0.2/setup.py
65+
===================================================================
66+
--- matplotlib-2.0.2.orig/setup.py
67+
+++ matplotlib-2.0.2/setup.py
68+
@@ -66,28 +66,6 @@ mpl_packages = [
69+
setupext.Python(),
70+
setupext.Platform(),
71+
'Required dependencies and extensions',
72+
- setupext.Numpy(),
73+
- setupext.Six(),
74+
- setupext.Dateutil(),
75+
- setupext.FuncTools32(),
76+
- setupext.Subprocess32(),
77+
- setupext.Pytz(),
78+
- setupext.Cycler(),
79+
- setupext.Tornado(),
80+
- setupext.Pyparsing(),
81+
- setupext.LibAgg(),
82+
- setupext.FreeType(),
83+
- setupext.FT2Font(),
84+
- setupext.Png(),
85+
- setupext.Qhull(),
86+
- setupext.Image(),
87+
- setupext.TTConv(),
88+
- setupext.Path(),
89+
- setupext.ContourLegacy(),
90+
- setupext.Contour(),
91+
- setupext.Delaunay(),
92+
- setupext.QhullWrap(),
93+
- setupext.Tri(),
94+
'Optional subpackages',
95+
setupext.SampleData(),
96+
setupext.Toolkits(),
97+
@@ -100,13 +78,8 @@ mpl_packages = [
98+
setupext.BackendMacOSX(),
99+
setupext.BackendQt5(),
100+
setupext.BackendQt4(),
101+
- setupext.BackendGtk3Agg(),
102+
setupext.BackendGtk3Cairo(),
103+
- setupext.BackendGtkAgg(),
104+
- setupext.BackendTkAgg(),
105+
- setupext.BackendWxAgg(),
106+
setupext.BackendGtk(),
107+
- setupext.BackendAgg(),
108+
setupext.BackendCairo(),
109+
setupext.Windowing(),
110+
'Optional LaTeX dependencies',

meta-python/recipes-devtools/python/python-matplotlib_1.1.0.bb

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
DESCRIPTION = "matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats"
2+
SECTION = "devel/python"
3+
LICENSE = "PSF"
4+
LIC_FILES_CHKSUM = "file://LICENSE/LICENSE;md5=afec61498aa5f0c45936687da9a53d74"
5+
6+
DEPENDS += "python-numpy freetype libpng python-dateutil python-pytz"
7+
RDEPENDS_${PN} = "python-core python-distutils python-numpy freetype libpng python-dateutil python-pytz"
8+
9+
SRC_URI = "https://github.com/matplotlib/matplotlib/archive/v${PV}.tar.gz \
10+
file://fix_setupext.patch \
11+
"
12+
SRC_URI[md5sum] = "89717c1ef3c6fdcd6fb1f3b597a4858c"
13+
SRC_URI[sha256sum] = "aebed23921562792b68b8ca355de5abc176af4424f1987e2fa95f65e5c5e7e89"
14+
S = "${WORKDIR}/matplotlib-${PV}"
15+
EXTRA_OECONF = "--disable-docs"
16+
17+
inherit setuptools pkgconfig
18+

0 commit comments

Comments
 (0)