summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d52199497cd26f5b0ef5d495e882281924aa8e2c (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
# Maintainer: xsmile <>

# Based on the current libtorrent version with the following additions:
# - updated pyroscope/rtorrent-ps patchset with several fixes from chros73/rtorrent-ps-ch
# - patches to fix compilation issues and crashes
_pkgname=libtorrent
pkgname=libtorrent-ps
_pkgver=0.13.8
pkgver=1.1.r71.gee296b1
pkgrel=2
pkgdesc='BitTorrent library written in C++ for use with rtorrent-ps'
url='https://github.com/rakshasa/libtorrent'
license=('GPL-2.0-only')
arch=('any')
depends=('glibc' 'openssl' 'zlib')
provides=('libtorrent')
conflicts=('libtorrent')
source=("$_pkgname-$_pkgver.tar.gz::https://github.com/rakshasa/$_pkgname/archive/v$_pkgver.tar.gz"
        'lt-ps-better-bencode-errors_all.patch'
        'lt-ps-honor_system_file_allocate_all.patch')
sha256sums=('0f6c2e7ffd3a1723ab47fdac785ec40f85c0a5b5a42c1d002272205b988be722'
            '3c0f802deecb15b93d8b569f00fdefe9e614f9688cfaabfbe567b8da70d2e93d'
            '5219bba547aff9ff3b2b6bd937284c3fed7c324473db20ff479e38302bdbda52')
prepare() {
  cd "$srcdir/$_pkgname-$_pkgver"

  LT_BASE_PATCHES=()
  LT_PATCHES=()

  # Patch libtorrent
  for corepatch in "${LT_BASE_PATCHES[@]/#/$srcdir/}" \
                   "$srcdir"/lt-ps-*_{${_pkgver},all}.patch "${LT_PATCHES[@]/#/$srcdir/}"; do
    test ! -e "$corepatch" || { msg2 "$(basename $corepatch)"; patch -uNp1 -i "$corepatch"; }
  done

  for backport in "$srcdir"/backport*_{${_pkgver},all}_*.patch; do
    test ! -e "$backport" || { msg2 "$(basename $backport)"; patch -uNp1 -i "$backport"; }
  done

  autoreconf -fiv
}

build() {
  cd "$srcdir/$_pkgname-$_pkgver"

   # https://github.com/rakshasa/libtorrent/issues/244
  ./configure \
    --prefix=/usr \
    --disable-debug \
    --enable-aligned
  make
}

package() {
  cd "$srcdir/$_pkgname-$_pkgver"

  make DESTDIR="$pkgdir" install
}