void-packages/srcpkgs/python-matplotlib/template
2019-04-12 19:17:26 -03:00

55 lines
1.8 KiB
Bash

# Template file for 'python-matplotlib'
pkgname=python-matplotlib
version=2.2.3
revision=2
archs=noarch
wrksrc="matplotlib-${version}"
build_style=python2-module
pycompile_module="matplotlib mpl_toolkits pylab.py"
hostmakedepends="pkg-config python-setuptools"
# XXX: use internal copy of agg, highly patched
makedepends="python-devel python-numpy python-PyQt5-devel 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"
short_desc="Python2 2D/3D plotting library"
maintainer="Alessio Sergi <al3hex@gmail.com>"
license="custom: matplotlib, BSD-3-Clause, MIT"
homepage="https://matplotlib.org/"
distfiles="https://github.com/matplotlib/matplotlib/archive/v${version}.tar.gz"
checksum=da5b804222864a8e854ed68f16dcbc8b2fa096537d84f879cc8289db368735c8
export XDG_RUNTIME_DIR=/tmp
pre_build() {
# set Agg as default backend
cat > setup.cfg <<-EOF
[rc_options]
backend = Agg
EOF
# adjust path
sed -i 's,\(site-packages/matplotlib/mpl-data\),/etc,' matplotlibrc.template
# adjust qhull path
sed -i "s|'libqhull',|'qhull',|" setupext.py
}
post_install() {
vlicense LICENSE/LICENSE
# remove data files
rm -rf ${DESTDIR}/usr/lib/python2*/site-packages/matplotlib/mpl-data
}
python-matplotlib-data_package() {
archs=noarch
conf_files="/etc/matplotlibrc"
short_desc+=" - data files"
pkg_install() {
vmkdir usr/share/matplotlib
vcopy ${wrksrc}/lib/matplotlib/mpl-data usr/share/matplotlib
vsconf ${wrksrc}/matplotlibrc.template
vconf ${PKGDESTDIR}/usr/share/matplotlib/mpl-data/matplotlibrc
rm -f ${PKGDESTDIR}/usr/share/matplotlib/mpl-data/matplotlibrc
}
}