summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e4fe52b6e150bdfccdd723be4ba1c2cf8c2edad7 (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
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgname=libktorrent-git
pkgver=25.03.70.r750.96c2b7a
pkgrel=1
pkgdesc="A BitTorrent protocol implementation. (GIT version)"
arch=('x86_64')
url='https://invent.kde.org/network/libktorrent'
license=('GPL')
depends=(
  'gcc-libs' # libgcc_s.so libstdc++.so
  'glibc' # libc.so
  'qt6-base' # libQt6Core.so libQt6Network.so libQt6Xml.so
  'kconfig' # libKF6ConfigCore.so
  'kcoreaddons' # libKF6CoreAddons.so
  'kio' # libKF6KIOCore.so
  'karchive' # libKF6Archive.so
  'ki18n' # libKF6I18n.so
  'libgcrypt' # libgcrypt.so
  'gmp' # libgmp.so
)
makedepends=(
  'extra-cmake-modules'
  'kdoctools5'
  'git'
  'python'
  'boost'
#   'kdoctools'
)
checkdepends=('appstream')
provides=(
  'libktorrent'
  'libKTorrent6.so'
)
conflicts=('libktorrent')
source=('git+https://invent.kde.org/network/libktorrent.git')
sha256sums=('SKIP')
options=('debug')

pkgver() {
  cd libktorrent
  _ver="$(cat CMakeLists.txt | grep -m3 -e RELEASE_SERVICE_VERSION_MAJOR -e RELEASE_SERVICE_VERSION_MINOR -e RELEASE_SERVICE_VERSION_MICRO | grep -o "[[:digit:]]*" | paste -sd'.')"
  echo "${_ver}.r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

prepare() {
  # skip 'IPv6 -> IPv6' polltest
  sed '/IPv6 -> IPv6/s/^/\/\//g' -i libktorrent/src/net/tests/polltest.cpp
}

build() {
  cmake -S libktorrent -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DKDE_INSTALL_LIBDIR=lib \
    -DBUILD_TESTING=ON

  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="${pkgdir}" cmake --install build
}