45 lines
1.6 KiB
Bash

# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>
pkgname=libtorrent-rasterbar
pkgver=2.0.10
pkgrel=2
epoch=1
pkgdesc="A C++ BitTorrent library that aims to be a good alternative to all the other implementations around"
url="https://www.rasterbar.com/products/libtorrent/"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('BSD')
depends=('boost-libs' 'openssl')
makedepends=('boost' 'cmake' 'ninja' 'python-setuptools')
options=('!emptydirs')
source=(https://github.com/arvidn/libtorrent/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
fortify-source-3.patch)
sha512sums=('a6406ccdd1d0c8d42543419a3b9edca880ab85e0849bfba29e3b1bd98f9630244aa3e88110cdf95e476792c9ea87a141fcb16a8c3b3e0c44c0076ebf6f9adbee'
'0687883a84f4395afaa824f5a2a9ee5366d654d84f546045b202297084ff24c445e4b95e92df63a8d9d2cd28cbd665933f3c649de91ab13334507f7a7d2c3c5d')
prepare() {
# remove usage of malloc_usable_size for _FORTIFY_SOURCE=3 compatibility
# https://github.com/arvidn/libtorrent/issues/7519
cd $pkgname-$pkgver
patch -Np1 -i ../fortify-source-3.patch
}
build() {
cmake -B build -S $pkgname-$pkgver \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-Dpython-bindings=ON \
-Dboost-python-module-name="python" \
-Dpython-egg-info=ON \
-Wno-dev
cmake --build build
}
package() {
DESTDIR="$pkgdir" cmake --install build
install -Dm644 $pkgname-$pkgver/COPYING -t "$pkgdir"/usr/share/licenses/$pkgname/
}