From e461fe631eeb21c447d78ecf9ffba4755f9639c6 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: May 20 2011 22:44:50 +0000 Subject: Add Requires dvipng (Bug 684836) Build against system agg (Bug 612807) Use system pyparsing (Bug 702160) --- diff --git a/matplotlib-1.0.1-noagg.patch b/matplotlib-1.0.1-noagg.patch new file mode 100644 index 0000000..687f8b2 --- /dev/null +++ b/matplotlib-1.0.1-noagg.patch @@ -0,0 +1,82 @@ +diff -up matplotlib-1.0.1/MANIFEST.in.noagg matplotlib-1.0.1/MANIFEST.in +--- matplotlib-1.0.1/MANIFEST.in.noagg 2010-07-06 19:41:55.000000000 -0600 ++++ matplotlib-1.0.1/MANIFEST.in 2011-05-20 15:45:38.337580769 -0600 +@@ -18,6 +18,5 @@ recursive-include examples * + recursive-include doc * + recursive-include src *.cpp *.c *.h *.m + recursive-include CXX *.cxx *.hxx *.c *.h +-recursive-include agg24 * + recursive-include lib * + recursive-include ttconv *.cpp *.h +diff -up matplotlib-1.0.1/setupext.py.noagg matplotlib-1.0.1/setupext.py +--- matplotlib-1.0.1/setupext.py.noagg 2010-07-06 19:41:55.000000000 -0600 ++++ matplotlib-1.0.1/setupext.py 2011-05-20 16:11:56.977764688 -0600 +@@ -104,7 +104,6 @@ BUILT_GDK = False + BUILT_PATH = False + BUILT_TRI = False + +-AGG_VERSION = 'agg24' + TCL_TK_CACHE = None + + # for nonstandard installation/build with --prefix variable +@@ -551,7 +550,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) +@@ -1251,17 +1251,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', +- 'agg_bezier_arc.cpp', +- 'agg_curves.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') +@@ -1284,15 +1274,7 @@ def build_path(ext_modules, packages): + global BUILT_PATH + if BUILT_PATH: return # only build it if you you haven't already + +- agg = ( +- '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') +@@ -1317,14 +1299,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')) + diff --git a/python-matplotlib.spec b/python-matplotlib.spec index f18b93f..08b87ea 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -19,7 +19,7 @@ Name: python-matplotlib Version: 1.0.1 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Python plotting library Group: Development/Libraries @@ -36,13 +36,18 @@ Source1: http://downloads.sourceforge.net/matplotlib/mpl_sampledata-%{ver Source2: setup.cfg # This patch taken from upstream SVN and will not be needed for releases later than 1.0.1 Patch0: matplotlib-1.0.1-plot_directive.patch +Patch1: matplotlib-1.0.1-noagg.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel, freetype-devel, libpng-devel, zlib-devel BuildRequires: pygtk2-devel, gtk2-devel BuildRequires: pytz, python-dateutil, numpy +BuildRequires: agg-devel +BuildRequires: pyparsing Requires: numpy, pytz, python-dateutil Requires: pycairo >= 1.2.0 Requires: dejavu-sans-fonts +Requires: dvipng +Requires: pyparsing %description Matplotlib is a pure python plotting library with the goal of making @@ -96,8 +101,15 @@ BuildRequires: python-basemap %else %setup -q -n matplotlib-%{version} %endif - %patch0 -p1 + +# Remove bundled libraries +rm -r agg24 lib/matplotlib//pyparsing.py + +# Remove references to bundled libraries +%patch1 -p1 -b .noagg +sed -i -e s/matplotlib\.pyparsing/pyparsing/g lib/matplotlib/*.py + chmod -x lib/matplotlib/mpl-data/images/*.svg cp %{SOURCE2} ./setup.cfg @@ -178,6 +190,11 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Fri May 20 2011 Orion Poplawski - 1.0.1-12 +- Add Requires dvipng (Bug 684836) +- Build against system agg (Bug 612807) +- Use system pyparsing (Bug 702160) + * Sat Feb 26 2011 Jonathan G. Underwood - 1.0.1-11 - Set PYTHONPATH during html doc building using find to prevent broken builds