PKGBUILD 1.18 KB
Newer Older
1 2 3

pkgbase=python-cffi
pkgname=(python3-cffi python2-cffi)
4
pkgver=1.11.2
5
pkgrel=1
6
pkgdesc="Foreign Function Interface for Python calling C code"
7
arch=('x86_64')
8 9
url="http://cffi.readthedocs.org/"
license=('MIT')
10
makedepends=('python3-setuptools' 'python2-setuptools' 'python3-pycparser' 'python2-pycparser' 'mercurial')
11
checkdepends=('python3-pytest-runner' 'python2-pytest-runner')
12 13
source=("hg+https://felixonmars@bitbucket.org/cffi/cffi#revision=$_revision")
sha512sums=('SKIP')
14 15

prepare() {
16 17
  mv cffi cffi-$pkgver
  cp -a cffi-$pkgver{,-py2}
18 19 20
}

build() {
21
  cd "$srcdir"/cffi-$pkgver
22 23
  python3 setup.py build

24
  cd "$srcdir"/cffi-$pkgver-py2
25 26 27
  python2 setup.py build
}

28 29 30 31 32 33 34
check() {
  cd "$srcdir"/cffi-$pkgver
  python3 setup.py test

  cd "$srcdir"/cffi-$pkgver-py2
  python2 setup.py test
}
35 36 37 38

package_python3-cffi() {
  depends=('python3-pycparser')

39 40 41
  cd cffi-$pkgver
  python3 setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
42 43 44 45 46
}

package_python2-cffi() {
  depends=('python2-pycparser')

47 48 49
  cd cffi-$pkgver-py2
  python2 setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
50
}
51