From 3ce9ec917b620e04f65739e2ee196162b8d503d7 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Tue, 1 Jan 2019 18:30:30 +0100 Subject: [PATCH] python3-matplotlib: update to 3.0.2 --- srcpkgs/python-matplotlib/template | 30 +++---------- srcpkgs/python3-matplotlib | 1 - srcpkgs/python3-matplotlib-data | 1 + .../INSTALL.msg} | 1 - .../matplotlibrc-path-search-fix.patch | 19 ++++++++ srcpkgs/python3-matplotlib/template | 45 +++++++++++++++++++ 6 files changed, 71 insertions(+), 26 deletions(-) delete mode 120000 srcpkgs/python3-matplotlib create mode 120000 srcpkgs/python3-matplotlib-data rename srcpkgs/{python-matplotlib/python3-matplotlib.INSTALL.msg => python3-matplotlib/INSTALL.msg} (92%) create mode 100644 srcpkgs/python3-matplotlib/patches/matplotlibrc-path-search-fix.patch create mode 100644 srcpkgs/python3-matplotlib/template diff --git a/srcpkgs/python-matplotlib/template b/srcpkgs/python-matplotlib/template index 29d76c8044b..b03f8a81cca 100644 --- a/srcpkgs/python-matplotlib/template +++ b/srcpkgs/python-matplotlib/template @@ -3,18 +3,12 @@ pkgname=python-matplotlib version=2.2.3 revision=1 wrksrc="matplotlib-${version}" -build_style=python-module -hostmakedepends="pkg-config python-setuptools python3-setuptools" +build_style=python2-module +hostmakedepends="pkg-config python-setuptools" # XXX: use internal copy of agg, highly patched -makedepends=" - python-devel python3-devel python-numpy python3-numpy - python-six python3-six python-dateutil python3-dateutil - python-functools32 python-subprocess32 python-pytz python3-pytz - python-cycler python3-cycler python-tornado python3-tornado - python-parsing python3-parsing python-PyQt5-devel python-PyQt4-devel - python-pyside python3-pyside python-cairocffi python3-cairocffi - python-gobject-devel pygtk-devel gtk+3-devel tk-devel python-tkinter - python3-tkinter wxPython-devel freetype-devel libpng-devel libqhull-devel" +makedepends="python-devel python-numpy python-PyQt5-devel python-PyQt4-devel + python-pyside python-cairocffi python-gobject-devel pygtk-devel gtk+3-devel + wxPython-devel freetype-devel libpng-devel libqhull-devel" depends="python-matplotlib-data>=${version}_${revision} python-numpy python-six python-dateutil python-parsing python-pytz python-cycler python-kiwisolver python-backports.functools_lru_cache python-subprocess32" @@ -31,8 +25,6 @@ export XDG_RUNTIME_DIR=/tmp pre_build() { # set Agg as default backend cat > setup.cfg <<-EOF - [packages] - tests = False [rc_options] backend = Agg EOF @@ -44,7 +36,7 @@ pre_build() { post_install() { vlicense LICENSE/LICENSE # remove data files - rm -rf ${DESTDIR}/usr/lib/python*/site-packages/matplotlib/mpl-data + rm -rf ${DESTDIR}/usr/lib/python2*/site-packages/matplotlib/mpl-data } python-matplotlib-data_package() { @@ -59,13 +51,3 @@ python-matplotlib-data_package() { rm -f ${PKGDESTDIR}/usr/share/matplotlib/mpl-data/matplotlibrc } } -python3-matplotlib_package() { - depends="python-matplotlib-data>=${version}_${revision} python3-numpy - python3-six python3-dateutil python3-parsing python3-pytz python3-cycler - python3-kiwisolver" - short_desc="${short_desc/Python2/Python3}" - pycompile_module="matplotlib mpl_toolkits pylab.py" - pkg_install() { - vmove usr/lib/python3* - } -} diff --git a/srcpkgs/python3-matplotlib b/srcpkgs/python3-matplotlib deleted file mode 120000 index 9552ac1974c..00000000000 --- a/srcpkgs/python3-matplotlib +++ /dev/null @@ -1 +0,0 @@ -python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3-matplotlib-data b/srcpkgs/python3-matplotlib-data new file mode 120000 index 00000000000..3144788bb3d --- /dev/null +++ b/srcpkgs/python3-matplotlib-data @@ -0,0 +1 @@ +python3-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib/python3-matplotlib.INSTALL.msg b/srcpkgs/python3-matplotlib/INSTALL.msg similarity index 92% rename from srcpkgs/python-matplotlib/python3-matplotlib.INSTALL.msg rename to srcpkgs/python3-matplotlib/INSTALL.msg index 3628d0d3f7c..122b631e246 100644 --- a/srcpkgs/python-matplotlib/python3-matplotlib.INSTALL.msg +++ b/srcpkgs/python3-matplotlib/INSTALL.msg @@ -3,7 +3,6 @@ For interactive graphics, install: - gtk+3 gir-freedesktop python3-gobject python3-cairocffi (for GTK3Agg/GTK3Cairo backend) -- python3-PyQt4|python3-pyside (for Qt4Agg backend) - python3-PyQt5 (for Qt5Agg backend) - python3-tkinter (for TkAgg backend) - python3-tornado (for webagg backend) diff --git a/srcpkgs/python3-matplotlib/patches/matplotlibrc-path-search-fix.patch b/srcpkgs/python3-matplotlib/patches/matplotlibrc-path-search-fix.patch new file mode 100644 index 00000000000..2357130cde1 --- /dev/null +++ b/srcpkgs/python3-matplotlib/patches/matplotlibrc-path-search-fix.patch @@ -0,0 +1,19 @@ +--- lib/matplotlib/__init__.py.orig ++++ lib/matplotlib/__init__.py +@@ -681,6 +681,8 @@ + if path.is_dir(): + return str(path) + ++ return '/usr/share/matplotlib/mpl-data' ++ + raise RuntimeError('Could not find the matplotlib data files') + + +@@ -742,6 +744,7 @@ + yield os.path.join(matplotlibrc, 'matplotlibrc') + yield os.path.join(get_configdir(), 'matplotlibrc') + yield os.path.join(get_data_path(), 'matplotlibrc') ++ yield '/etc/matplotlibrc' + + for fname in gen_candidates(): + if os.path.exists(fname): diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template new file mode 100644 index 00000000000..082df1ee209 --- /dev/null +++ b/srcpkgs/python3-matplotlib/template @@ -0,0 +1,45 @@ +# Template file for 'python3-matplotlib' +pkgname=python3-matplotlib +version=3.0.2 +revision=1 +wrksrc="matplotlib-${version}" +build_style=python3-module +pycompile_module="matplotlib mpl_toolkits pylab.py" +hostmakedepends="pkg-config python3-setuptools" +# XXX use internal copy of agg, highly patched +makedepends="python3-numpy python3-devel freetype-devel libpng-devel libqhull-devel" +depends="python3-matplotlib-data>=${version}_${revision} python3-numpy + python3-dateutil python3-parsing python3-cycler python3-kiwisolver" +short_desc="Python3 2D/3D plotting library" +maintainer="Alessio Sergi " +homepage="https://matplotlib.org/" +license="matplotlib, BSD-3-Clause, MIT" +distfiles="https://github.com/matplotlib/matplotlib/archive/v${version}.tar.gz" +checksum=4682a2a4e66eed054d78a1eae5936d2174e8c145486db59f12a585aef991fad5 + +pre_build() { + # adjust qhull path + sed -i "s|'libqhull',|'qhull',|" setupext.py + # adjust conf file path + sed -i 's,\(site-packages/matplotlib/mpl-data\),/etc,' matplotlibrc.template +} + +post_install() { + vlicense LICENSE/LICENSE + # remove data files + rm -rf ${DESTDIR}/usr/lib/python3*/site-packages/matplotlib/mpl-data +} + +python3-matplotlib-data_package() { + noarch=yes + short_desc+=" - data files" + conf_files="/etc/matplotlibrc" + replaces="python-matplotlib-data<3.0.0" + pkg_install() { + vmkdir usr/share/matplotlib + vcopy lib/matplotlib/mpl-data usr/share/matplotlib + vsconf matplotlibrc.template + vconf ${PKGDESTDIR}/usr/share/matplotlib/mpl-data/matplotlibrc + rm -f ${PKGDESTDIR}/usr/share/matplotlib/mpl-data/matplotlibrc + } +}