PKGBUILDs/aur/python-matplotx/PKGBUILD
2022-01-30 12:59:48 -05:00

40 lines
1.4 KiB
Bash

# Maintainer: graysky <graysky AT archlinux DOT us>
# Contributer: Carlos Aznarán <caznaranl@uni.pe>
# ALARM:
# - remove check function and check deps as most do not exist for us
_base=matplotx
pkgname=python-${_base}
pkgdesc="Useful styles and extensions for Matplotlib"
pkgver=0.3.2
pkgrel=1
arch=(any)
url="https://github.com/nschloe/${_base}"
license=(MIT)
depends=(python-matplotlib)
makedepends=(python-build python-flit-core python-install)
optdepends=('python-networkx: for creation of graphs'
'python-pypng: for iterator support')
source=(https://pypi.org/packages/source/${_base::1}/${_base}/${_base}-${pkgver}.tar.gz)
sha512sums=('fb34db28157bbd975a46960a76b718a7a4d1ee1df5dbfed653f07a9a483ee77f67dae71f835285438501c7f0a475d48c284ead3e911dc1ef1811acc399c01046')
build() {
cd "${_base}-${pkgver}"
export PYTHONHASHSEED=0
python -m build --wheel --skip-dependency-check --no-isolation
}
package() {
cd "${_base}-${pkgver}"
PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m install --optimize=1 --destdir="${pkgdir}" dist/*.whl
# https://github.com/FFY00/python-install/pull/6
chmod +x ${pkgdir}/usr/bin/*
# Symlink license file
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
install -d "${pkgdir}/usr/share/licenses/${pkgname}"
ln -s "${site_packages}/${_base}-$pkgver.dist-info/LICENSE" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}