diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 70 |
1 files changed, 34 insertions, 36 deletions
@@ -1,46 +1,44 @@ -# Maintainer: Clint Valentine <valentine.clint@gmail.com> -# Co-maintainer: Dmitriy Morozov <archlinux@foxcub.org> +# Maintainer: Luis Martinez <luis dot martinez at disroot dot org> +# Contributor: Clint Valentine <valentine.clint@gmail.com> +# Contributor: Dmitriy Morozov <archlinux@foxcub.org> -_name=fastcluster -pkgbase='python-fastcluster' -pkgname=('python-fastcluster' 'python2-fastcluster') -pkgver=1.1.24 +pkgname=python-fastcluster +_pkg="${pkgname#python-}" +pkgver=1.2.6 pkgrel=2 pkgdesc="Fast hierarchical clustering routines for R and Python" -arch=('any') -url="https://pypi.python.org/pypi/fastcluster" +arch=('x86_64') +url="https://pypi.org/project/fastcluster" license=('BSD') +depends=('python-numpy') makedepends=( - 'python' 'python-setuptools' - 'python2' 'python2-setuptools') -options=(!emptydirs) -source=("${pkgname}"-"${pkgver}".tar.gz::https://pypi.python.org/packages/1e/00/9910dd324f32582051d0ee6922c3cd4727234aae96366f3867c46a70cd78/fastcluster-1.1.24.tar.gz) -sha256sums=('a5d1922b1db6f4c3012416e7dc14de2984b9335a48c895e1698afd5c718312b0') - -prepare() { - cp -a "${_name}"-"${pkgver}"{,-py2} -} - -build(){ - cd "${srcdir}"/"${_name}"-"${pkgver}" - python setup.py build - - cd "${srcdir}"/"${_name}"-"${pkgver}"-py2 - python2 setup.py build + 'python-setuptools' + 'python-build' + 'python-installer' + 'python-oldest-supported-numpy' + 'python-wheel') +checkdepends=('python-pytest' 'python-scipy') +changelog=NEWS.txt +source=("$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/${_pkg::1}/$_pkg/$_pkg-$pkgver.tar.gz") +sha256sums=('aab886efa7b6bba7ac124f4498153d053e5a08b822d2254926b7206cdf5a8aa6') + +build() { + cd "$_pkg-$pkgver" + python -m build --wheel --no-isolation } -package_python2-fastcluster() { - depends=('python2' 'python2-numpy') - - cd "${_name}"-"${pkgver}"-py2 - python2 setup.py install --root="${pkgdir}"/ --optimize=1 --skip-build - install -Dm644 COPYING.txt "${pkgdir}"/usr/share/licenses/"${pkgname}"/COPYING.txt +check() { + cd "$_pkg-$pkgver" + local _py="$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')" + PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_py" python setup.py test } -package_python-fastcluster() { - depends=('python' 'python-numpy') - - cd "${_name}"-"${pkgver}" - python setup.py install --root="${pkgdir}"/ --optimize=1 --skip-build - install -Dm644 COPYING.txt "${pkgdir}"/usr/share/licenses/"${pkgname}"/COPYING.txt +package() { + cd "$_pkg-$pkgver" + PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir/" dist/*.whl + local _site="$(python -c 'import site; print(site.getsitepackages()[0])')" + install -d "$pkgdir/usr/share/licenses/$pkgname/" + ln -s \ + "$_site/$_pkg-$pkgver.dist-info/COPYING.txt" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } |