void-packages/srcpkgs/libtorrent-rasterbar/template

76 lines
2.0 KiB
Bash

# Template file for 'libtorrent-rasterbar'
pkgname=libtorrent-rasterbar
version=1.2.3
revision=1
build_style=gnu-configure
configure_args="--enable-examples --enable-python-binding
--with-boost=${XBPS_CROSS_BASE}/usr
--with-boost-python=boost_python${py3_ver//./}"
hostmakedepends="automake pkg-config intltool libtool python3-devel"
makedepends="libressl-devel boost-devel geoip-devel python3-devel"
short_desc="C++ bittorrent library by Rasterbar Software"
maintainer="Eivind Uggedal <eivind@uggedal.com>"
license="BSD-3-Clause"
homepage="https://libtorrent.org/"
distfiles="https://github.com/arvidn/libtorrent/releases/download/libtorrent-${version//./_}/libtorrent-rasterbar-${version}.tar.gz"
checksum=1582fdbbd0449bcfe4ffae2ccb9e5bf0577459a32bb25604e01accb847da1a2d
case "$XBPS_TARGET_MACHINE" in
armv[56]*|mips*|ppc|ppc-musl)
makedepends+=" libatomic-devel"
LDFLAGS+=" -latomic"
;;
esac
pre_configure() {
local _py3_ver=${py3_ver}${py3_abiver}
export PYTHON_CPPFLAGS="-I${XBPS_CROSS_BASE}/usr/include/python${_py3_ver}"
export PYTHON_CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/include/python${_py3_ver}"
export PYTHON_EXTRA_LDFLAGS="-L${XBPS_CROSS_BASE}/usr/lib -lpython${_py3_ver}"
autoreconf -fi
}
pre_build() {
if [ "$CROSS_BUILD" ]; then
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
f=${f##*/}
export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
done
export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
fi
}
pre_install() {
pre_build
}
post_install() {
vlicense LICENSE
}
libtorrent-rasterbar-python3_package() {
lib32disabled=yes
short_desc+=" - Python3 bindings"
pkg_install() {
vmove usr/lib/python3*
}
}
libtorrent-rasterbar-devel_package() {
depends="${sourcepkg}>=${version}_${revision} libressl-devel boost-devel geoip-devel"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
vmove "usr/lib/*.a"
}
}
libtorrent-rasterbar-examples_package() {
short_desc+=" - example binaries"
pkg_install() {
vmove usr/bin
}
}