aboutsummaryrefslogtreecommitdiffstats
path: root/community/libtorrent-rasterbar/APKBUILD
blob: 226dc4ae928fe3448113ef4f91500f6ae377cc1c (plain) (blame)
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
# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: August Klein <amatcoder@gmail.com>
pkgname=libtorrent-rasterbar
pkgver=1.2.14
pkgrel=0
pkgdesc="Feature complete C++ bittorrent implementation"
url="https://www.rasterbar.com/products/libtorrent"
arch="all !armv7"
license="BSD-3-Clause"
depends_dev="boost-build boost-dev openssl-dev python3-dev py3-setuptools automake autoconf"
makedepends="$depends_dev linux-headers"
subpackages="py3-$pkgname:_py3 $pkgname-static $pkgname-dev"
source="
	https://github.com/arvidn/libtorrent/releases/download/v$pkgver/libtorrent-rasterbar-$pkgver.tar.gz
	"

build() {
	local _py3ver=$(python3 -c 'import sys; print("{}{}".format(sys.version_info.major, sys.version_info.minor))')
	PYTHON=/usr/bin/python3 \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-tests \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-python-binding \
		--with-boost-system=boost_python$_py3ver \
		--with-std=c++14
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	cd bindings/python
	python3 setup.py install --prefix /usr --root "$pkgdir/python"
}

dev() {
	default_dev

	mkdir -p "$subpkgdir/usr/share"
	mv "$pkgdir/usr/share/cmake" "$subpkgdir/usr/share"
}

_py3() {
	pkgdesc="Python3 bindings for $pkgname"

	rm -rfv "$pkgdir"/usr/lib/python*
	mv "$pkgdir/python" "$subpkgdir"
}

sha512sums="
9d23184785597a11f96e9d68ac7bd2ba73a9dbc0568c3fd81ba2f1ef2381f6ee290b48a77f1db6f7ee82aa1f6640a6a54dbfbfa7b236bb3be8a6e083dce6cd69  libtorrent-rasterbar-1.2.14.tar.gz
"