summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2020-01-18 14:17:30 +0000
committerDaniel Bermond2020-01-18 14:17:30 +0000
commite9c80b1c36e3d36b48a4bfddce9313fb7b77be83 (patch)
tree9791163cc0c3e8875c9e43e7bb6d26481dc7e41e
parentc762bf25df2c229782e90cfcaaa0027aefb91d2f (diff)
downloadaur-e9c80b1c36e3d36b48a4bfddce9313fb7b77be83.tar.gz
Fix build. Drop i686. General improvements.
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD75
2 files changed, 31 insertions, 47 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d41e1771ba30..d1a91cd7f0bf 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = libtorrent-rasterbar-git
pkgdesc = A C++ BitTorrent library that aims to be a good alternative to all the other implementations around (git version)
- pkgver = 1.2.0.r24.g30b8a06bd
+ pkgver = 1.2.3.r319.g9dfff3677
pkgrel = 1
url = https://www.rasterbar.com/products/libtorrent/
- arch = i686
arch = x86_64
license = BSD
makedepends = git
diff --git a/PKGBUILD b/PKGBUILD
index d025064400d6..924a5ca57a0c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,11 +1,11 @@
-# Maintainer : Daniel Bermond < gmail-com: danielbermond >
+# Maintainer : Daniel Bermond <dbermond@archlinux.org>
pkgname=libtorrent-rasterbar-git
-pkgver=1.2.0.r24.g30b8a06bd
+pkgver=1.2.3.r319.g9dfff3677
pkgrel=1
pkgdesc='A C++ BitTorrent library that aims to be a good alternative to all the other implementations around (git version)'
url='https://www.rasterbar.com/products/libtorrent/'
-arch=('i686' 'x86_64')
+arch=('x86_64')
license=('BSD')
makedepends=('git' 'cmake' 'boost' 'python2' 'python2-setuptools'
'python' 'python-setuptools')
@@ -23,9 +23,6 @@ sha256sums=('SKIP'
prepare() {
cd libtorrent-rasterbar
-
- mkdir -p py2 py3
-
git submodule init
git config --local "submodule.simulation/libsimulator.url" "${srcdir}/libsimulator"
git config --local "submodule.deps/try_signal.url" "${srcdir}/try_signal"
@@ -34,73 +31,61 @@ prepare() {
pkgver() {
cd libtorrent-rasterbar
-
- # git, tags available
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_/./g;s/^libtorrent\.//'
}
-_build() {
+_build_common() {
local _pyver="$1"
- local _pylibver="$1"
-
- [ "${_pyver%%.*}" -gt '2' ] && _pylibver+='m'
-
- cd "${srcdir}/libtorrent-rasterbar/py${_pyver%%.*}"
printf '%s\n' "Building for python${_pyver%%.*}..."
- # force C++11 mode (needed by qBittorrent)
- # https://github.com/qbittorrent/qBittorrent/issues/5265#issuecomment-220007436
+ # NOTE: needs -Dboost-python-module-name to specify the correct boost python cmake config file
+ # https://github.com/arvidn/libtorrent/blob/9dfff3677f1a7291e03febc4724511da5b6a89b9/bindings/python/CMakeLists.txt#L1-L8
- cmake \
- -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} -std=c++11 -DNDEBUG=1" \
- -DCMAKE_INSTALL_LIBDIR:PATH='lib' \
+ cmake -B "build-py${_pyver%%.*}" -S libtorrent-rasterbar \
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \
-DCMAKE_SKIP_RPATH:BOOL='YES' \
-Dbuild_examples:BOOL='ON' \
-Dbuild_tools:BOOL='ON' \
-Dpython-bindings:BOOL='ON' \
+ -Dboost-python-module-name='python' \
-DPYTHON_EXECUTABLE:FILEPATH="/usr/bin/python${_pyver}" \
- -DPYTHON_INCLUDE_DIR:PATH="/usr/include/python${_pylibver}" \
- -DPYTHON_LIBRARY:FILEPATH="/usr/lib/libpython${_pylibver}.so" \
- -Wno-dev \
- ..
-
- make
+ -DPYTHON_INCLUDE_DIR:PATH="/usr/include/python${_pyver}" \
+ -DPYTHON_LIBRARY:FILEPATH="/usr/lib/libpython${_pyver}.so" \
+ -Wno-dev
+ make -C "build-py${_pyver%%.*}"
}
build() {
local _py2ver
- local _py3ver
+ local _pyver
_py2ver="$(python2 -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
- _py3ver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
+ _pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
- _build "$_py2ver"
- _build "$_py3ver"
+ _build_common "$_py2ver"
+ _build_common "$_pyver"
}
package() {
- cd libtorrent-rasterbar
+ local _py2ver
+ local _pyver
- make -C py2 DESTDIR="$pkgdir" install
- make -C py3 DESTDIR="$pkgdir" install
+ _py2ver="$(python2 -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
+ _pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
+
+ make -C "build-py${_py2ver%%.*}" DESTDIR="$pkgdir" install
+ make -C "build-py${_pyver%%.*}" DESTDIR="$pkgdir" install
# binaries
- local _binary
- cd py3/examples
- for _binary in client_test connection_tester dump_torrent make_torrent \
- simple_client stats_counters upnp_test
- do
- install -D -m755 "${_binary}" -t "${pkgdir}/usr/bin"
- done
- cd "${srcdir}/libtorrent-rasterbar/py3/tools"
- for _binary in dht session_log_alerts
+ local _bin
+ while read -r -d '' _bin
do
- install -D -m755 "${_binary}" -t "${pkgdir}/usr/bin"
- done
+ install -D -m755 "$_bin" -t "${pkgdir}/usr/bin"
+ done < <(find "build-py${_pyver%%.*}/examples" "build-py${_pyver%%.*}/tools" \
+ -maxdepth 1 -type f ! -name '*_test*' ! -name 'simple_client' \
+ ! -name 'stats_counters' -executable -print0)
# license
- cd "${srcdir}/libtorrent-rasterbar"
- install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -D -m644 libtorrent-rasterbar/COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}