# Contributor: Isaac Dunham # Maintainer: Aiden Grossman pkgname=py3-matplotlib _pyname=matplotlib pkgver=3.5.1 pkgrel=4 pkgdesc="Python3 library for plots" url="https://matplotlib.org" # riscv64: ftbfs arch="all !riscv64" license="Python-2.0" depends=" py3-cairo py3-certifi py3-cycler py3-dateutil py3-fonttools py3-kiwisolver py3-numpy py3-packaging py3-parsing py3-pillow py3-tz python3-tkinter " makedepends=" python3-dev gfortran py3-numpy-dev freetype-dev libpng-dev tk-dev py3-setuptools qhull-dev py3-wheel py3-setuptools-scm-git-archive " checkdepends=" py3-pytest py3-pytest-xdist ttf-opensans " source="https://github.com/matplotlib/$_pyname/archive/v$pkgver/matplotlib-v$pkgver.tar.gz https://github.com/boomanaiden154/matplotlib-test-images/releases/download/matplotlib-$pkgver/matplotlib-images.tar.gz freetype.patch test.patch " builddir="$srcdir/$_pyname-$pkgver" replaces="py-matplotlib" # Backwards compatibility provides="py-matplotlib=$pkgver-r$pkgrel" # Backwards compatibility prepare() { default_prepare # Use system freetype and qhull sed -e 's|#system_freetype = False|system_freetype = True|' -e 's|#system_qhull = False|system_qhull = True|' mplsetup.cfg.template > mplsetup.cfg # Install tests sed -i 's|#tests = False|tests = True|' mplsetup.cfg # Copy images from freetype mpl images repo cp -r ../matplotlib-images/matplotlib-$CARCH/* lib/matplotlib/tests/baseline_images/ cp -r ../matplotlib-images/mpl_toolkits-$CARCH/* lib/matplotlib/tests/baseline_images/ } build() { python3 setup.py build } check() { python3 -m venv --system-site-packages test-env test-env/bin/python3 setup.py install --skip-build test-env/bin/python3 -m pytest -n $JOBS -v --pyargs matplotlib -m "not (nonfunctional or $CARCH)" } package() { python3 setup.py install --prefix=/usr --root="$pkgdir" --skip-build # Remove tests from installation rm -r "$pkgdir/usr/lib/python3.10/site-packages/matplotlib/tests/" rm -r "$pkgdir/usr/lib/python3.10/site-packages/mpl_toolkits/tests/" } sha512sums=" c6cee81a9d06b879eb64204d64f8cdedea2533927ab1023202ab999e2503bc41a40716901679eb79b131fff3e413942d501e3c6ef82b053170088b56d0a7ce26 matplotlib-v3.5.1.tar.gz 157324ac666a95e213a99a6f2ae2626dac161178e8e5f3d1f64030a139ca99a71d6c0581a17c40ccc37ba894194865bdbb81eb97b242fa865054da9737f02124 matplotlib-images.tar.gz b56a3c6c2e4f0ec6db42df794b29184e0c1a2661ce443ac9e029aa7fd541a668df2244b8b6c26cc9a03cb818334551a817d5793d21fb14e63f324538dc54fdc3 freetype.patch fdadf88a5fd04924e1b07e291e0d4805d1aaabf09a92fa7d3e5d63f612f3492035a46432b123e2e4fc4552effb17618949731da552067a4c512afdbccd2928e6 test.patch "