summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 27dcf92d0bd67b1c419c507a60bd02f8f47fda4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Maintainer: Fernando Ortiz <nandub+arch [at] nandub.info>
# Contributor: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG

pkgbase=python-pyalsaaudio-git
pkgname=(python-pyalsaaudio-git python2-pyalsaaudio-git)
_pkgname=pyalsaaudio
pkgver=0.8.4.r25.g12f8076
pkgrel=2
pkgdesc="ALSA wrappers for Python (development version)"
arch=('i686' 'x86_64')
url="http://larsimmisch.github.io/pyalsaaudio/"
license=('custom: PSF')
makedepends=('python-setuptools' 'python2-setuptools' 'alsa-lib')
source=("git+https://github.com/larsimmisch/${_pkgname}.git")
md5sums=('SKIP')

pkgver() {
  cd ${_pkgname}
  git describe --long --tags | sed 's/^v//; s/-/.r/; s/-/./g'
}

prepare() {
  # copy folder, so we can cleanly build for both python versions
  cp -rup ${_pkgname} python2-pyalsaaudio
}

build() {
  # build for python 3
  cd ${_pkgname}
  python setup.py build

  # build for python 2
  cd ../python2-pyalsaaudio
  python2 setup.py build
}

# package for python 3
package_python-pyalsaaudio-git() {
  depends=('python' 'alsa-lib')
  pkgdesc="${pkgdesc/Python/Python 3}"
  conflicts=('python-pyalsaaudio')
  provides=('python-pyalsaaudio')

  cd ${_pkgname}

  python setup.py install --root="$pkgdir/" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# package for python 2
package_python2-pyalsaaudio-git() {
  depends=('python2' 'alsa-lib')
  pkgdesc="${pkgdesc/Python/Python 2}"
  conflicts=('python2-pyalsaaudio')
  provides=('python2-pyalsaaudio')

  cd python2-pyalsaaudio

  python2 setup.py install --root="$pkgdir/" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}