mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-13 11:19:50 +03:00
this test failed on armhf, s390x and build-3-21-x86_64 (but not build-edge-x86_64) armv7, aarch64 and ppc64le are busy building other aports and I cannot stick around, so disable on those too to not leave this for someone else to take care of
249 lines
8.3 KiB
Text
249 lines
8.3 KiB
Text
# Contributor: Isaac Dunham <ibid.ag@gmail.com>
|
|
# Contributor: Aiden Grossman <agrossman154@yahoo.com>
|
|
# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
|
|
maintainer=""
|
|
pkgname=py3-matplotlib
|
|
pkgver=3.9.3
|
|
_ftver=2.13.1
|
|
pkgrel=0
|
|
pkgdesc="Python3 library for plots"
|
|
url="https://matplotlib.org"
|
|
arch="all"
|
|
license="PSF-2.0"
|
|
depends="
|
|
py3-contourpy
|
|
py3-cycler
|
|
py3-dateutil
|
|
py3-fonttools
|
|
py3-kiwisolver
|
|
$pkgname-data
|
|
py3-numpy
|
|
py3-packaging
|
|
py3-parsing
|
|
py3-pillow
|
|
"
|
|
makedepends="
|
|
freetype-dev
|
|
py3-gpep517
|
|
py3-meson-python
|
|
py3-numpy-dev
|
|
py3-pybind11-dev
|
|
py3-setuptools_scm
|
|
python3-dev
|
|
qhull-dev
|
|
"
|
|
checkdepends="
|
|
font-opensans
|
|
ghostscript
|
|
inkscape
|
|
jupyter-nbformat
|
|
jupyter-nbconvert
|
|
py3-pandas
|
|
py3-pikepdf
|
|
py3-psutil
|
|
py3-pytest
|
|
py3-pytest-cov
|
|
py3-pytest-timeout
|
|
py3-pytest-xdist
|
|
py3-pytzdata
|
|
py3-sphinx
|
|
py3-xarray
|
|
"
|
|
subpackages="
|
|
$pkgname-fonts::noarch
|
|
$pkgname-data::noarch
|
|
$pkgname-qt5-pyc:qt5_pyc
|
|
$pkgname-qt5::noarch
|
|
$pkgname-qt6::noarch
|
|
$pkgname-gtk3-pyc:gtk3_pyc
|
|
$pkgname-gtk3::noarch
|
|
$pkgname-gtk4-pyc:gtk4_pyc
|
|
$pkgname-gtk4::noarch
|
|
$pkgname-tk-pyc:tk_pyc
|
|
$pkgname-tk
|
|
$pkgname-wx-pyc:wx_pyc
|
|
$pkgname-wx::noarch
|
|
$pkgname-pyc
|
|
"
|
|
|
|
source="https://github.com/matplotlib/matplotlib/archive/v$pkgver/matplotlib-v$pkgver.tar.gz
|
|
https://github.com/QuLogic/mpl-images/archive/v$pkgver-with-freetype-$_ftver/mpl-images-$pkgver-ft$_ftver.tar.gz
|
|
10-mpl-data_path.patch
|
|
20-unpin_numpy.patch
|
|
30-freetype_version_and_tolerances.patch
|
|
40-32bit_stride_windows_impl.patch
|
|
"
|
|
builddir="$srcdir/matplotlib-$pkgver"
|
|
|
|
build() {
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
|
|
gpep517 build-wheel \
|
|
--wheel-dir .dist \
|
|
--config-json '{"setup-args": ["-Dsystem-freetype=true", "-Dsystem-qhull=true"]}' \
|
|
--output-fd 3 3>&1 >&2
|
|
}
|
|
|
|
check() {
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
python3 -m venv --clear --without-pip --system-site-packages test-env
|
|
test-env/bin/python3 -m installer .dist/*.whl
|
|
mkdir -p test-env/share/matplotlib
|
|
cp -r test-env/lib/python${python_version}/site-packages/matplotlib/mpl-data test-env/share/matplotlib/mpl-data
|
|
|
|
for _module in matplotlib mpl_toolkits
|
|
do
|
|
cp -r lib/$_module/* test-env/lib/python$python_version/site-packages/$_module
|
|
cp -r "$srcdir"/mpl-images-$pkgver-with-freetype-$_ftver/lib/$_module/* test-env/lib/python$python_version/site-packages/$_module
|
|
done
|
|
|
|
# musl locale deficiencies
|
|
local k="not test_locale_comma"
|
|
case "$CARCH" in
|
|
aarch64|arm*|ppc64le|s390x|x86_64)
|
|
# FIXME: failing on at least armhf & s390x package builders
|
|
k="$k and not test_get_font_names"
|
|
;;
|
|
esac
|
|
case "$CARCH" in
|
|
loongarch64|riscv64)
|
|
# some tests fail on loongarch64 and riscv64
|
|
k="$k and not test_imshow_clip and not test_contour_addlines and not test_contour_colorbar and not test_contour3d"
|
|
;;
|
|
esac
|
|
|
|
test-env/bin/python3 -m pytest -n $JOBS -v \
|
|
--pyargs matplotlib mpl_toolkits.axes_grid1 mpl_toolkits.axisartist mpl_toolkits.mplot3d \
|
|
-k "$k"
|
|
}
|
|
|
|
package() {
|
|
python3 -m installer --destdir="$pkgdir" .dist/*.whl
|
|
|
|
# Remove tests from installation
|
|
find "$pkgdir" -type d -name tests -exec rm -r {} \+
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
mkdir -p $pkgdir/usr/share/matplotlib/mpl-data
|
|
mv $pkgdir/usr/lib/python${python_version}/site-packages/matplotlib/mpl-data $pkgdir/usr/share/matplotlib
|
|
}
|
|
|
|
fonts() {
|
|
pkgdesc="Fonts used by $pkgname"
|
|
license="OFL-1.0 AND Bitstream-Vera AND Public-Domain"
|
|
depends=""
|
|
|
|
amove usr/share/matplotlib/mpl-data/fonts
|
|
}
|
|
|
|
data() {
|
|
pkgdesc="Data used by $pkgname"
|
|
depends="$pkgname-fonts=$pkgver-r$pkgrel"
|
|
|
|
amove usr/share/matplotlib/mpl-data
|
|
}
|
|
|
|
qt5() {
|
|
pkgdesc="Qt5 backend for $pkgname"
|
|
depends="$pkgname=$pkgver-r$pkgrel py3-cairocffi py3-qt5"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/backend_qt5*.py
|
|
}
|
|
|
|
qt5_pyc() {
|
|
pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
|
|
install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"
|
|
depends="$pkgname-qt5=$pkgver-r$pkgrel"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/__pycache__/backend_qt5*.pyc
|
|
}
|
|
|
|
qt6() {
|
|
pkgdesc="Qt6 backend for $pkgname"
|
|
depends="$pkgname=$pkgver-r$pkgrel py3-cairocffi py3-qt6"
|
|
|
|
# This is handled by backend_qt*.py (no number), so the package exists only for
|
|
# the dependencies.
|
|
mkdir $subpkgdir
|
|
}
|
|
|
|
gtk3() {
|
|
pkgdesc="GTK3 backend for $pkgname"
|
|
depends="$pkgname=$pkgver-r$pkgrel py3-gobject3"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/backend_gtk3*.py
|
|
}
|
|
|
|
gtk3_pyc() {
|
|
pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
|
|
install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"
|
|
depends="$pkgname-gtk3=$pkgver-r$pkgrel"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/__pycache__/backend_gtk3*.pyc
|
|
}
|
|
|
|
gtk4() {
|
|
pkgdesc="GTK4 backend for $pkgname"
|
|
depends="$pkgname=$pkgver-r$pkgrel py3-gobject3"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/backend_gtk4*.py
|
|
}
|
|
|
|
gtk4_pyc() {
|
|
pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
|
|
install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"
|
|
depends="$pkgname-gtk4=$pkgver-r$pkgrel"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/__pycache__/backend_gtk4*.pyc
|
|
}
|
|
|
|
tk() {
|
|
pkgdesc="Tk backend for $pkgname"
|
|
depends="$pkgname=$pkgver-r$pkgrel python3-tkinter"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/backend_tk*.py
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/_backend_tk.py
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/_tkagg.*
|
|
}
|
|
|
|
tk_pyc() {
|
|
pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
|
|
install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"
|
|
depends="$pkgname-tk=$pkgver-r$pkgrel"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/__pycache__/backend_tk*.pyc
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/__pycache__/_backend_tk*.pyc
|
|
}
|
|
|
|
wx() {
|
|
pkgdesc="WX backend for $pkgname"
|
|
depends="$pkgname=$pkgver-r$pkgrel py3-wxpython"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/backend_wx*.py
|
|
}
|
|
|
|
wx_pyc() {
|
|
pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
|
|
install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"
|
|
depends="$pkgname-wx=$pkgver-r$pkgrel"
|
|
|
|
local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
amove usr/lib/python${python_version}/site-packages/matplotlib/backends/__pycache__/backend_wx*.pyc
|
|
}
|
|
|
|
sha512sums="
|
|
04fe5745eccfaf9060fe93aa6ca61bca05a8966b39e1e14620973e50afdba196a98c146898f444fb302b4157d70c78392b7815921502ab8d68514d8b56de4cb3 matplotlib-v3.9.3.tar.gz
|
|
53cb50ae711ba5ba38d42b7723bbfbd74d022cad6ab91de6c05fb0e971c0b8212ad33359b2ea7ce5a0365cdb1708cd58773bae2e0bf0d4a37696b28206083eed mpl-images-3.9.3-ft2.13.1.tar.gz
|
|
a0856257177addc5bf0c5dceb22d72a08702bfd3a5f401f1cdb3e91e4ac795eaf624370ec070f507cbcc1af57325c500aaf9a43a329efe5a720f6b001ea1f6b3 10-mpl-data_path.patch
|
|
dded9479ed7957b63d40efe95f19f10a360db077a66f0c5fbe6739419043de8d708dc37c2a789d47159e5a7df2ccf8314cd0c5b4232899f038cf955c53981a35 20-unpin_numpy.patch
|
|
586c8da07af097b26ade0a5e420a3b6fa38f7a7be7bca4451b2cc2befbd9bc34f953caa98f08de93c28337bd774186041b9be85da847ba4c0d2a33057ace007d 30-freetype_version_and_tolerances.patch
|
|
515708eef6e9830487bfbfd8becb464a12228ede2917383c97d2addd0b1f0286fb83250f15eead4ae9a3bfc58ee9e31f3fe26dbdf10f519c27e29ef265138242 40-32bit_stride_windows_impl.patch
|
|
"
|