archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / python-pysmf / repos / community-x86_64 / PKGBUILD
blobcafea65e7d226515126d4f8df390510e1ecb0ea3
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
3 pkgname=python-pysmf
4 pkgver=0.1.1
5 pkgrel=4
6 pkgdesc='Python module for reading & writing Standard MIDI Files'
7 arch=('x86_64')
8 url='https://das.nasophon.de/pysmf/'
9 license=('custom:BSD') # some form of 2-clause BSD
10 depends=('python' 'libsmf')
11 makedepends=(
12   'git'
13   'python-build'
14   'python-installer'
15   'python-wheel'
16   'python-setuptools'
17   'cython'
19 checkdepends=('python-pytest')
20 _commit='84806d212c98f56563eacffb472d4114d2ad42a1'
21 source=(
22   "$pkgname::git+https://github.com/dsacre/pysmf#commit=$_commit"
23   'update-pytest-references.patch'
25 sha512sums=('SKIP'
26             '475231e66e77472418571a585c99f4c347d50a4c29f33c3fe5fbe6ab5602b3ea86ec237fc0454a54b8e70304c3726256e4d267ed024fa987bb8b3034c0686142')
27 b2sums=('SKIP'
28         '3eb8d25197e68a352819bdef8a57abe17312c5cc938c61bc9a31cc1064949b036eff314e4a21d50daf81a7749a4424ed7371e7fbaab32eed46ef348ddbc7ee73')
30 pkgver() {
31   cd "$pkgname"
33   git describe --tags | sed 's/^v//'
36 build() {
37   cd "$pkgname"
39   python -m build --wheel --no-isolation
42 check() {
43   cd "$pkgname"
45   # update deprecated references to pytest
46   patch -p1 -i "$srcdir/update-pytest-references.patch"
48   local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
50   PYTHONPATH="build/lib.linux-$CARCH-cpython-$python_version:$PYTHONPATH" pytest -v
53 package() {
54   cd "$pkgname"
56   python -m installer --destdir="$pkgdir" dist/*.whl
58   # documentation
59   install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" NEWS README
60   cp -vr examples "$pkgdir/usr/share/doc/$pkgname"
62   # license
63   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" COPYING