author | George Rawlinson
<grawlinson@archlinux.org> 2023-07-18 09:42:15 UTC |
committer | George Rawlinson
<grawlinson@archlinux.org> 2023-07-18 09:42:15 UTC |
parent | bc18e818517fe72f8e3848e5c5ca30327867ba45 |
PKGBUILD | +41 | -16 |
diff --git a/PKGBUILD b/PKGBUILD index f4dd662..748426b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,33 +1,58 @@ -# Maintainer: Felix Yan <felixonmars@archlinux.org> +# Maintainer: George Rawlinson <grawlinson@archlinux.org> +# Contributor: Felix Yan <felixonmars@archlinux.org> # Contributor: Tobias Roettger <toroettg@gmail.com> pkgname=python-platformdirs -pkgver=3.8.1 +pkgver=3.9.1 pkgrel=1 -pkgdesc='A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir"' +pkgdesc='A library to determine platform-specific system directories' arch=('any') -url="https://github.com/platformdirs/platformdirs" +url='https://github.com/platformdirs/platformdirs' license=('MIT') -depends=('python-typing_extensions') -makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs') -checkdepends=('python-pytest-mock' 'python-appdirs') -source=("https://pypi.io/packages/source/p/platformdirs/platformdirs-$pkgver.tar.gz") -sha512sums=('85d7781e4ef0755bf9a7a4d90b92ea06f497081ec4c5438780f12876a1006b2e591c1b182f6648cad19039d1bd7611cf0c2215015653bafbad2cc529f27d94e7') +depends=('python' 'python-typing_extensions') +makedepends=( + 'git' + 'python-build' + 'python-installer' + 'python-hatchling' + 'python-hatch-vcs' +) +checkdepends=( + 'python-pytest' + 'python-pytest-mock' + 'python-appdirs' +) +_commit='aadc9d01acc067131c4ea52da36624c1fe2ed001' +source=("$pkgname::git+$url#commit=$_commit") +b2sums=('SKIP') + +pkgver() { + cd "$pkgname" + + git describe --tags | sed 's/^v//' +} build() { - cd platformdirs-$pkgver + cd "$pkgname" + python -m build --wheel --no-isolation } check() { - cd platformdirs-$pkgver - PYTHONPATH="$PWD"/src pytest + cd "$pkgname" + + PYTHONPATH="$(pwd)/src" pytest -v } package() { - cd platformdirs-$pkgver - python -m installer --destdir="$pkgdir/" dist/*.whl - install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/ -} + cd "$pkgname" + python -m installer --destdir="$pkgdir" dist/*.whl + + # 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/${pkgname#python-}-$pkgver.dist-info/licenses/LICENSE" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} # vim:set ts=2 sw=2 et: