summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 32296006712f6980f546904676745b3ab7073fe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Maintainer : Daniel Bermond < yahoo-com: danielbermond >

pkgname=libtorrent-rasterbar-git
pkgver=1.1.4.r1269.g1d9b10a32
pkgrel=1
pkgdesc="A C++ BitTorrent library that aims to be a good alternative to all the other implementations around (git version)"
url="http://www.rasterbar.com/products/libtorrent/"
arch=('i686' 'x86_64')
license=('BSD')
depends=('boost-libs')
makedepends=('git' 'boost' 'python2' 'python')
optdepends=('python2: for python2 bindings'
            'python: for python3 bindings')
provides=('libtorrent-rasterbar')
conflicts=('libtorrent-rasterbar')
source=("$pkgname"::"git+https://github.com/arvidn/libtorrent.git")
sha256sums=('SKIP')

pkgver() {
    cd "$pkgname"
    
    # git, tags available
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_/./g;s/^libtorrent\.//'
}

build() {
    cd "$pkgname"
    ./autotool.sh
    
    # force C++11 mode (needed by qBittorrent)
    # https://github.com/qbittorrent/qBittorrent/issues/5265#issuecomment-220007436
    CXXFLAGS="${CXXFLAGS} -std=c++11" \
    ./configure \
        --prefix=/usr \
        --enable-shared=yes \
        --enable-static=no \
        --enable-fast-install=yes \
        --enable-largefile \
        --enable-logging \
        --disable-debug \
        --enable-dht \
        --enable-encryption \
        --enable-deprecated-functions \
        --enable-examples \
        --disable-tests \
        --enable-python-binding \
        --with-libiconv
    make
    
    # build python2 bindings (python3 bindings are built during 'make')
    python2 setup.py build
}

package() {
    cd "$pkgname"
    
    # standard install
    make DESTDIR="$pkgdir" install
    
    # python2 bindings (python3 bindings are installed during 'make install')
    python2 setup.py install --root="$pkgdir" --optimize=1
    
    # license
    install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    
    # remove most example binaries
    rm "$pkgdir"/usr/bin/{*_test,*_tester,simple_client,stats_counters}
}