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.11
pkgrel=1
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=('756fb24c44b5dcf22d0bbc06a812abc28be7388a409e577c71fb02b1ca3005040947244c0ae83bd3388264dd518119736b869397fedd7bdbcd60699b04a19969'
'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/
}