archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-poetry-plugin-tweak-dependencies-version / trunk / PKGBUILD
blob72543aa3dfb9d37a134342500809314d08f77f09
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
3 pkgname=python-poetry-plugin-tweak-dependencies-version
4 pkgver=1.3.0
5 pkgrel=1
6 pkgdesc='Poetry plugin used to tweak dependency versions'
7 arch=('any')
8 url='https://github.com/sbrunner/poetry-plugin-tweak-dependencies-version'
9 license=('BSD')
10 depends=(
11   'python'
12   'python-poetry'
13   'python-poetry-core'
14   'python-cleo'
16 makedepends=(
17   'git'
18   'python-build'
19   'python-installer'
20   'python-poetry-dynamic-versioning'
22 _commit='c5bf57c55ee0c998ee1ef49173238946c55566ac'
23 source=(
24   "$pkgname::git+$url#commit=$_commit"
25   'fix-package-version.patch'
27 b2sums=('SKIP'
28         '042afd4ef5458b22aa5fb5463e86ad94790e420a1992cddf926cfc6c68e5a3bfd55f98c45a2ce3a9776c14247eef83f062831ba9e4c371be975bc0737f542254')
30 pkgver() {
31   cd "$pkgname"
33   git describe --tags | sed 's/^v//'
36 prepare() {
37   cd "$pkgname"
39   patch -p1 -i "$srcdir/fix-package-version.patch"
41   # properly set package version
42   sed -e "s/@PKGVER@/$pkgver/" -i pyproject.toml
45 build() {
46   cd "$pkgname"
48   python -m build --wheel --no-isolation
51 package() {
52   cd "$pkgname"
54   python -m installer --destdir="$pkgdir" dist/*.whl
56   # license
57   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
58   install -d "$pkgdir/usr/share/licenses/$pkgname"
59   ln -s "$site_packages/poetry_plugin_tweak_dependencies_version-$pkgver.dist-info/LICENSE" \
60     "$pkgdir/usr/share/licenses/$pkgname/LICENSE"