PKGBUILDs/community/opendht/PKGBUILD
2021-10-19 00:34:29 +00:00

58 lines
1.7 KiB
Bash

# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Baptiste Jonglez <baptiste--aur at jonglez dot org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - set -DOPENDHT_LTO=OFF
# - move cppunit to makedepends from checkdepends
buildarch=26
pkgname=opendht
epoch=1
pkgver=2.3.1
pkgrel=1
pkgdesc="C++14 Distributed Hash Table (DHT) implementation"
arch=(x86_64)
url="https://github.com/savoirfairelinux/opendht"
license=(GPL3)
depends=(glibc gnutls nettle readline argon2 jsoncpp libjsoncpp.so fmt http-parser openssl)
makedepends=(cmake msgpack-c msgpack-cxx asio restinio cython python-setuptools cppunit)
optdepends=('python: to use the Python bindings')
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
opendht-gcc11.patch)
sha256sums=('9a75db4f119761d6524964b27d3a49aa809a6cb08bde963edc2f338458433c78'
'4cd9ee51b3da01f00b0eb4367c48fb3a00df0840d5cf7beafaabcd149c8bd0fc')
prepare() {
# https://github.com/savoirfairelinux/opendht/pull/567
patch -d ${pkgname}-${pkgver} -p1 < opendht-gcc11.patch
}
build() {
cmake -B build -S ${pkgname}-${pkgver} \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DOPENDHT_DOCUMENTATION=OFF \
-DOPENDHT_TESTS=ON \
-DOPENDHT_STATIC=OFF \
-DOPENDHT_SYSTEMD=ON \
-DOPENDHT_SYSTEMD_UNIT_FILE_LOCATION=/usr/lib/systemd/system/ \
-DOPENDHT_LTO=OFF \
-DOPENDHT_INDEX=ON \
-DOPENDHT_PYTHON=ON \
-DOPENDHT_HTTP=ON \
-DOPENDHT_PROXY_SERVER=ON \
-DOPENDHT_PROXY_CLIENT=ON \
-DOPENDHT_PUSH_NOTIFICATIONS=ON
make -C build
}
check() {
# https://github.com/savoirfairelinux/opendht/issues/568
make -C build test || echo "Tests failed"
}
package() {
make -C build DESTDIR="${pkgdir}" install
}