desktop/libtorrent-rasterbar/PKGBUILD
2017-09-09 14:49:49 +01:00

58 lines
1.5 KiB
Bash

pkgname=libtorrent-rasterbar
pkgver=1.1.4
_pkgver=${pkgver//./_}
pkgrel=1
pkgdesc="A C++ library that aims to be a good alternative to all the other bittorrent implementations around"
url="http://www.rasterbar.com/products/libtorrent/"
arch=('x86_64')
license=('BSD')
depends=('boost-libs' 'python2' 'python3' 'geoip' 'websocketpp')
makedepends=('boost' 'cmake')
options=('!emptydirs')
source=(https://github.com/arvidn/libtorrent/archive/libtorrent-${_pkgver}/$pkgname-$pkgver.tar.gz)
sha256sums=('9acbb24b47fa91fc1f10bda5853bd1e11b9873c9298baeb6b40e7cf7cf2237e7')
prepare() {
mkdir py2 py3
cd libtorrent-libtorrent-${_pkgver}
# Avoid depending on newer processors
sed -i 's/-msse4.2//' configure.ac
./autotool.sh
}
_build() (
cd py$1
# FS#50745
_boost="boost_python"
if [ $1 -eq 3 ]; then _boost="boost_python3"; fi
# https://github.com/qbittorrent/qBittorrent/issues/5265#issuecomment-220007436
CXXFLAGS="$CXXFLAGS -std=c++11" \
PYTHON=/usr/bin/python$1 \
../libtorrent-libtorrent-${_pkgver}/configure \
--prefix=/usr \
--enable-python-binding \
--enable-examples \
--disable-static \
--with-libiconv \
--with-boost-python=$_boost
)
build() {
_build 2
_build 3
}
package() {
make -C py2 DESTDIR="$pkgdir" install
make -C py3 DESTDIR="$pkgdir" install
install -Dm644 libtorrent-libtorrent-${_pkgver}/COPYING \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Remove most example binaries
rm "$pkgdir"/usr/bin/{*_test,*_tester,simple_client,stats_counters}
}