update to new version

- use xz to compress sources
- drop fontconfig patch (upstream)
- drop tk patch (upstream solved build issue differently)
- redo use system agg patch
- delete bundled python-pycxx headers
- fix requires of python3-matplotlib-qt (fixes #988412)
This commit is contained in:
Thomas Spura 2013-08-02 10:31:00 +02:00
parent 0a7be6ae46
commit 81fc2e8024
8 changed files with 78 additions and 202 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ matplotlib-1.0.0-without-gpc.tar.gz
/matplotlib-1.0.1-without-gpc.tar.gz
/mpl_sampledata-1.0.1.tar.gz
/matplotlib-1.2.0-without-gpc.tar.gz
/matplotlib-1.3.0-without-gpc.tar.xz

View File

@ -6,7 +6,7 @@ version=$1
dir=matplotlib-${version}
file=matplotlib-${version}.tar.gz
result=matplotlib-${version}-without-gpc.tar.gz
result=matplotlib-${version}-without-gpc.tar.xz
wget -vc http://downloads.sourceforge.net/matplotlib/$file
@ -16,4 +16,4 @@ tar xzf $file
rm matplotlib-${version}/agg24/include/agg_conv_gpc.h
rm -f $result
tar czf $result $dir
tar cJf $result $dir

View File

@ -1,64 +0,0 @@
diff -ur matplotlib-1.2.0.orig/lib/matplotlib/font_manager.py matplotlib-1.2.0/lib/matplotlib/font_manager.py
--- matplotlib-1.2.0.orig/lib/matplotlib/font_manager.py 2012-10-31 01:11:14.000000000 +0100
+++ matplotlib-1.2.0/lib/matplotlib/font_manager.py 2013-04-03 01:50:34.433802284 +0200
@@ -62,7 +62,7 @@
except ImportError:
import pickle
-USE_FONTCONFIG = False
+USE_FONTCONFIG = True
verbose = matplotlib.verbose
@@ -771,7 +771,7 @@
return float(self._size)
except ValueError:
pass
- default_size = fontManager.get_default_size()
+ default_size = FontManager.get_default_size()
return default_size * font_scalings.get(self._size)
def get_file(self):
@@ -991,7 +991,10 @@
self.afmfiles = findSystemFonts(paths, fontext='afm') + \
findSystemFonts(fontext='afm')
self.afmlist = createFontList(self.afmfiles, fontext='afm')
- self.defaultFont['afm'] = self.afmfiles[0]
+ try:
+ self.defaultFont['afm'] = self.afmfiles[0]
+ except IndexError:
+ self.defaultFont['afm'] = None
self.ttf_lookup_cache = {}
self.afm_lookup_cache = {}
@@ -1002,7 +1005,8 @@
"""
return self.__default_weight
- def get_default_size(self):
+ @staticmethod
+ def get_default_size():
"""
Return the default font size.
"""
@@ -1276,7 +1280,7 @@
except OSError:
return None
if pipe.returncode == 0:
- for match in _fc_match_regex.finditer(output):
+ for match in _fc_match_regex.finditer(output.decode("utf-8")):
file = match.group(1)
if os.path.splitext(file)[1][1:] in fontexts:
return file
diff -ur matplotlib-1.2.0.orig/lib/matplotlib/mpl-data/matplotlibrc matplotlib-1.2.0/lib/matplotlib/mpl-data/matplotlibrc
--- matplotlib-1.2.0.orig/lib/matplotlib/mpl-data/matplotlibrc 2012-11-08 17:39:20.000000000 +0100
+++ matplotlib-1.2.0/lib/matplotlib/mpl-data/matplotlibrc 2013-04-03 01:50:03.693755542 +0200
@@ -198,7 +198,7 @@
#mathtext.it : serif:italic
#mathtext.bf : serif:bold
#mathtext.sf : sans
-#mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
+mathtext.fontset : stix # Should be 'cm' (Computer Modern), 'stix',
# 'stixsans' or 'custom'
#mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern
# fonts when a symbol can not be found in one of

View File

@ -1,73 +1,26 @@
diff -up matplotlib-1.2.0/setupext.py.orig matplotlib-1.2.0/setupext.py
--- matplotlib-1.2.0/setupext.py.orig 2012-11-23 14:49:21.295712608 -0200
+++ matplotlib-1.2.0/setupext.py 2012-11-23 14:49:31.508712999 -0200
@@ -96,7 +96,6 @@ BUILT_GDK = False
BUILT_PATH = False
BUILT_TRI = False
--- setupext.py.orig 2013-08-02 09:39:43.914247832 +0200
+++ setupext.py 2013-08-02 09:40:14.785304342 +0200
@@ -749,22 +749,7 @@
return str(e) + ' Using local copy.'
-AGG_VERSION = 'agg24'
TCL_TK_CACHE = None
# for nonstandard installation/build with --prefix variable
@@ -621,7 +620,8 @@ def add_agg_flags(module):
# before adding the freetype flags since -z comes later
add_base_flags(module)
add_numpy_flags(module)
- module.include_dirs.extend(['src', '%s/include'%AGG_VERSION, '.'])
+ module.include_dirs.extend(['src', '/usr/include/agg2', '.'])
+ module.libraries.append('agg')
# put these later for correct link order
module.libraries.extend(std_libs)
@@ -1220,17 +1220,7 @@ def build_agg(ext_modules, packages):
global BUILT_AGG
if BUILT_AGG: return # only build it if you you haven't already
- agg = (
- 'agg_trans_affine.cpp',
def add_flags(self, ext):
- if self.found_external:
- pkg_config.setup_extension(ext, 'libagg')
- else:
- ext.include_dirs.append('agg24/include')
- agg_sources = [
- 'agg_bezier_arc.cpp',
- 'agg_curves.cpp',
- 'agg_image_filters.cpp',
- 'agg_trans_affine.cpp',
- 'agg_vcgen_contour.cpp',
- 'agg_vcgen_dash.cpp',
- 'agg_vcgen_stroke.cpp',
- 'agg_image_filters.cpp',
- )
-
- deps = ['%s/src/%s'%(AGG_VERSION, name) for name in agg]
- deps.extend(['src/mplutils.cpp', 'src/agg_py_transforms.cpp'])
+ deps = ['src/mplutils.cpp', 'src/agg_py_transforms.cpp']
deps.extend(glob.glob('CXX/*.cxx'))
deps.extend(glob.glob('CXX/*.c'))
temp_copy('src/_backend_agg.cpp', 'src/backend_agg.cpp')
@@ -1253,16 +1243,7 @@ def build_path(ext_modules, packages):
global BUILT_PATH
if BUILT_PATH: return # only build it if you you haven't already
- 'agg_vpgen_segmentator.cpp'
- ]
- ext.sources.extend(
- os.path.join('agg24', 'src', x) for x in agg_sources)
+ pkg_config.setup_extension(ext, 'libagg', default_include_dirs=["/usr/include/agg2"])
- agg = (
- 'agg_vcgen_contour.cpp',
- 'agg_curves.cpp',
- 'agg_bezier_arc.cpp',
- 'agg_trans_affine.cpp',
- 'agg_vcgen_stroke.cpp',
- )
-
- deps = ['%s/src/%s'%(AGG_VERSION, name) for name in agg]
- deps.extend(glob.glob('CXX/*.cxx'))
+ deps = glob.glob('CXX/*.cxx')
deps.extend(glob.glob('CXX/*.c'))
temp_copy('src/_path.cpp', 'src/path.cpp')
@@ -1287,14 +1268,8 @@ def build_image(ext_modules, packages):
global BUILT_IMAGE
if BUILT_IMAGE: return # only build it if you you haven't already
- agg = ('agg_trans_affine.cpp',
- 'agg_image_filters.cpp',
- 'agg_bezier_arc.cpp',
- )
-
temp_copy('src/_image.cpp', 'src/image.cpp')
deps = ['src/image.cpp', 'src/mplutils.cpp']
- deps.extend(['%s/src/%s'%(AGG_VERSION,name) for name in agg])
deps.extend(glob.glob('CXX/*.cxx'))
deps.extend(glob.glob('CXX/*.c'))
class FreeType(SetupPackage):

View File

@ -0,0 +1,22 @@
diff --git a/setupext.py b/setupext.py
index 7b629b6..8131bb1 100644
--- a/setupext.py
+++ b/setupext.py
@@ -674,16 +674,9 @@ class CXX(SetupPackage):
name = 'pycxx'
def check(self):
- if sys.version_info[0] >= 3:
- # There is no version of PyCXX in the wild that will work
- # with Python 3.x
- self.__class__.found_external = False
- return ("Official versions of PyCXX are not compatible with "
- "Python 3.x. Using local copy")
-
self.__class__.found_external = True
old_stdout = sys.stdout
- sys.stdout = io.BytesIO()
+ #sys.stdout = io.BytesIO()
try:
import CXX
except ImportError:

View File

@ -1,35 +0,0 @@
diff -up matplotlib-1.2.0/setupext.py.orig matplotlib-1.2.0/setupext.py
--- matplotlib-1.2.0/setupext.py.orig 2012-11-23 14:50:48.954715965 -0200
+++ matplotlib-1.2.0/setupext.py 2012-11-23 14:55:53.731727636 -0200
@@ -898,12 +898,12 @@ def parse_tcl_config(tcl_lib_dir, tk_lib
tcl_poss = [tcl_lib_dir,
os.path.normpath(os.path.join(tcl_lib_dir, '..')),
- "/usr/lib/tcl"+str(Tkinter.TclVersion),
- "/usr/lib"]
+ "@@libdir@@/tcl"+str(Tkinter.TclVersion),
+ "@@libdir@@"]
tk_poss = [tk_lib_dir,
os.path.normpath(os.path.join(tk_lib_dir, '..')),
- "/usr/lib/tk"+str(Tkinter.TkVersion),
- "/usr/lib"]
+ "@@libdir@@/tk"+str(Tkinter.TkVersion),
+ "@@libdir@@"]
for ptcl, ptk in zip(tcl_poss, tk_poss):
tcl_config = os.path.join(ptcl, "tclConfig.sh")
tk_config = os.path.join(ptk, "tkConfig.sh")
@@ -974,10 +974,10 @@ def guess_tcl_config(tcl_lib_dir, tk_lib
return tcl_lib, tcl_inc, 'tcl' + tk_ver, tk_lib, tk_inc, 'tk' + tk_ver
def hardcoded_tcl_config():
- tcl_inc = "/usr/local/include"
- tk_inc = "/usr/local/include"
- tcl_lib = "/usr/local/lib"
- tk_lib = "/usr/local/lib"
+ tcl_inc = "/usr/include"
+ tk_inc = "/usr/include"
+ tcl_lib = "@@libdir@@"
+ tk_lib = "@@libdir@@"
return tcl_lib, tcl_inc, 'tcl', tk_lib, tk_inc, 'tk'
def add_tk_flags(module):

View File

@ -16,24 +16,21 @@
Name: python-matplotlib
Version: 1.2.0
Release: 15%{?dist}
Version: 1.3.0
Release: 1%{?dist}
Summary: Python 2D plotting library
Group: Development/Libraries
License: Python
# qt4_editor backend is MIT
License: Python and MIT
URL: http://matplotlib.org
#Modified Sources to remove the one undistributable file
#See generate-tarball.sh in fedora cvs repository for logic
#sha1sum matplotlib-1.2.0-without-gpc.tar.gz
#92ada4ef4e7374d67e46e30bfb08c3fed068d680 matplotlib-1.2.0-without-gpc.tar.gz
Source0: matplotlib-%{version}-without-gpc.tar.gz
Source0: matplotlib-%{version}-without-gpc.tar.xz
Patch0: %{name}-noagg.patch
Patch1: %{name}-tk.patch
# http://sourceforge.net/mailarchive/message.php?msg_id=30202451
# https://github.com/matplotlib/matplotlib/pull/1666
# https://bugzilla.redhat.com/show_bug.cgi?id=896182
Patch2: %{name}-fontconfig.patch
Patch1: %{name}-system-cxx.patch
BuildRequires: agg-devel
BuildRequires: freetype-devel
@ -43,7 +40,9 @@ BuildRequires: numpy
BuildRequires: pycairo-devel
BuildRequires: pygtk2-devel
BuildRequires: pyparsing
BuildRequires: python-pycxx-devel
BuildRequires: python-dateutil
BuildRequires: python-setuptools
BuildRequires: python2-devel
BuildRequires: pytz
BuildRequires: xorg-x11-server-Xvfb
@ -127,8 +126,10 @@ Group: Development/Libraries
BuildRequires: python3-cairo
BuildRequires: python3-dateutil
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-gobject
BuildRequires: python3-numpy
BuildRequires: python3-pycxx-devel
BuildRequires: python3-pyparsing
BuildRequires: python3-pytz
BuildRequires: python3-six
@ -157,7 +158,7 @@ errorcharts, scatterplots, etc, with just a few lines of code.
%package -n python3-matplotlib-qt4
Summary: Qt4 backend for python3-matplotlib
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3-matplotlib%{?_isa} = %{version}-%{release}
BuildRequires: python3-PyQt4-devel
Requires: python3-PyQt4
@ -179,18 +180,11 @@ Requires: python3-tkinter
%setup -q -n matplotlib-%{version}
# Remove bundled libraries
rm -r agg24 lib/matplotlib/pyparsing_py?.py
rm -r agg24 CXX
# Remove references to bundled libraries
%patch0 -p1 -b .noagg
sed -i -e s/matplotlib\.pyparsing_py./pyparsing/g lib/matplotlib/*.py
# Correct tcl/tk detection
%patch1 -p1 -b .tk
sed -i -e 's|@@libdir@@|%{_libdir}|' setupext.py
# Use fontconfig by default
%patch2 -p1 -b .fontconfig
%patch0 -b .noagg
%patch1 -p1 -b .cxx
chmod -x lib/matplotlib/mpl-data/images/*.svg
@ -235,16 +229,14 @@ popd
%endif
%files
%doc README.txt
%doc lib/dateutil_py2/LICENSE
%doc lib/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX
%doc lib/pytz/LICENSE.txt
%doc README.rst
%doc LICENSE/
%doc CHANGELOG
%doc CXX
%doc INSTALL
%doc PKG-INFO
%doc TODO
%{python_sitearch}/*egg-info
%{python_sitearch}/matplotlib-*-nspkg.pth
%{python_sitearch}/matplotlib/
%{python_sitearch}/mpl_toolkits/
%{python_sitearch}/pylab.py*
@ -279,16 +271,14 @@ popd
%if %{with_python3}
%files -n python3-matplotlib
%doc %{basepy3dir}/README.txt
%doc %{basepy3dir}/lib/dateutil_py3/LICENSE
%doc %{basepy3dir}/lib/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX
%doc %{basepy3dir}/lib/pytz/LICENSE.txt
%doc %{basepy3dir}/README.rst
%doc %{basepy3dir}/LICENSE/
%doc %{basepy3dir}/CHANGELOG
%doc %{basepy3dir}/CXX
%doc %{basepy3dir}/INSTALL
%doc %{basepy3dir}/PKG-INFO
%doc %{basepy3dir}/TODO
%{python3_sitearch}/*egg-info
%{python3_sitearch}/matplotlib-*-nspkg.pth
%{python3_sitearch}/matplotlib/
%{python3_sitearch}/mpl_toolkits/
%{python3_sitearch}/pylab.py*
@ -319,6 +309,15 @@ popd
%endif
%changelog
* Fri Aug 2 2013 Thomas Spura <tomspur@fedoraproject.org> - 1.3.0-1
- update to new version
- use xz to compress sources
- drop fontconfig patch (upstream)
- drop tk patch (upstream solved build issue differently)
- redo use system agg patch
- delete bundled python-pycxx headers
- fix requires of python3-matplotlib-qt (fixes #988412)
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

View File

@ -1 +1 @@
2add984c264ecdfc4a212f914736b78c matplotlib-1.2.0-without-gpc.tar.gz
54c01e06ccdb213bde4ce39881016aec matplotlib-1.3.0-without-gpc.tar.xz