1 # Maintainer: Brett Cornwall <ainola@archlinux.org>
2 # Contributor: Solomon Choina <shlomochoina@gmail.com>
7 pkgdesc='BitTorrent DHT library'
9 url='https://github.com/jech/dht'
12 source=(https://github.com/jech/dht/archive/refs/tags/$pkgname-$pkgver.tar.gz
13 dht-cmake.patch::https://github.com/transmission/dht/commit/b02da598.patch)
14 sha256sums=('caba469a784a5c359c084099fdc025cfe09b1faec2ba9ba257b7384351c43c0a'
15 '91fb75029bf04456bb7fd9c7cc14d544e906d35a309cc8de5be081049aeb7649')
18 patch -d dht-dht-$pkgver -p1 < dht-cmake.patch # Add cmake support
22 cmake -B build -S dht-dht-$pkgver \
23 -DCMAKE_INSTALL_PREFIX=/usr \
24 -DCMAKE_INSTALL_INCLUDEDIR=include/dht \
25 -DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects"
30 DESTDIR="$pkgdir" cmake --install build
31 install -Dm644 dht-dht-$pkgver/LICENCE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE