aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-cparser/APKBUILD
blob: ed6167d6d63063a7a133456f05670bdf34aa81f6 (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
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=py-cparser
_pkgname=pycparser
pkgver=2.17
pkgrel=1
pkgdesc="A C parser written in Python"
url="https://github.com/eliben/pycparser"
arch="noarch"
license="BSD"
depends=""
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build || return 1
	python3 setup.py build || return 1
}

package() {
	mkdir -p "$pkgdir"
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc ${python#python}"
	depends="$depends $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

_py2() {
	replaces="$pkgname"
	_py python2
}

_py3() {
	_py python3
}

md5sums="ca98dcb50bc1276f230118f6af5a40c7  pycparser-2.17.tar.gz"
sha256sums="0aac31e917c24cb3357f5a4d5566f2cc91a19ca41862f6c3c22dc60a629673b6  pycparser-2.17.tar.gz"
sha512sums="c9caaa8d256748e0623d077b11931abb38d19367136c70a835f7587e1f7ceb64f3acb7a983dcb68bedd2cf187517762a5753844e8ed58d1d9ed6f364c55839b4  pycparser-2.17.tar.gz"