From 2114656575e644ca49500c4987041d5b114b2f2f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 18 Apr 2012 16:25:06 -0400 Subject: [PATCH] 1.0.1-20: remove wx support for rhel >= 7 * Wed Apr 18 2012 David Malcolm - 1.0.1-20 - remove wx support for rhel >= 7 --- disable-wx-in-setup.cfg.patch | 12 ++++++++++++ python-matplotlib.spec | 24 +++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 disable-wx-in-setup.cfg.patch diff --git a/disable-wx-in-setup.cfg.patch b/disable-wx-in-setup.cfg.patch new file mode 100644 index 0000000..46520bf --- /dev/null +++ b/disable-wx-in-setup.cfg.patch @@ -0,0 +1,12 @@ +diff -up matplotlib-1.0.1/setup.cfg.disable-wx-in-setup.cfg matplotlib-1.0.1/setup.cfg +--- matplotlib-1.0.1/setup.cfg.disable-wx-in-setup.cfg 2012-04-18 15:54:40.408040980 -0400 ++++ matplotlib-1.0.1/setup.cfg 2012-04-18 15:54:40.412040931 -0400 +@@ -57,7 +57,7 @@ configobj = False + gtk = True + gtkagg = True + tkagg = True +-wxagg = True ++wxagg = False + + [rc_options] + # User-configurable options diff --git a/python-matplotlib.spec b/python-matplotlib.spec index ac66200..29958cd 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -17,9 +17,16 @@ # from this package. %global withhtmldocs 1 +# On RHEL 7 onwards, don't build the wx: +%if 0%{?rhel} >= 7 +%global with_wx 0 +%else +%global with_wx 1 +%endif + Name: python-matplotlib Version: 1.0.1 -Release: 19%{?dist} +Release: 20%{?dist} Summary: Python plotting library Group: Development/Libraries @@ -47,6 +54,9 @@ Patch3: matplotlib-1.0.1-tkinter.patch # https://github.com/matplotlib/matplotlib/commit/45c46672648e3b4a277bf7ff42b3baf56a98bcec Patch4: use-png-accessor-functions.patch +# Conditionally applied, when disabling wx support: +Patch5: disable-wx-in-setup.cfg.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel, freetype-devel, libpng-devel, zlib-devel BuildRequires: pygtk2-devel, gtk2-devel @@ -76,6 +86,7 @@ Requires: tkinter %description tk %{summary} +%if 0%{with_wx} %package wx Summary: wxPython backend for python-matplotlib Group: Development/Libraries @@ -85,6 +96,7 @@ BuildRequires: wxPython-devel %description wx %{summary} +%endif # if 0%{with_wx} %package doc Summary: Documentation files for python-matplotlib @@ -126,6 +138,10 @@ sed -i -e s/matplotlib\.pyparsing/pyparsing/g lib/matplotlib/*.py chmod -x lib/matplotlib/mpl-data/images/*.svg cp %{SOURCE2} ./setup.cfg +%if !0%{with_wx} +# Patch the new copy of setup.cfg to remove wx support: +%patch5 -p1 +%endif %if %{withhtmldocs} pushd doc @@ -190,10 +206,13 @@ rm -rf $RPM_BUILD_ROOT %{python_sitearch}/matplotlib/backends/tkagg.py* %{python_sitearch}/matplotlib/backends/_tkagg.so +%if 0%{with_wx} %files wx %defattr(-,root,root,-) %{python_sitearch}/matplotlib/backends/backend_wx.py* %{python_sitearch}/matplotlib/backends/backend_wxagg.py* +%endif # if 0%{with_wx} + %files doc %defattr(-,root,root,-) @@ -203,6 +222,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Apr 18 2012 David Malcolm - 1.0.1-20 +- remove wx support for rhel >= 7 + * Tue Feb 28 2012 Fedora Release Engineering - 1.0.1-19 - Rebuilt for c++ ABI breakage