gentoo/net-dns/redis-knot/redis-knot-3.5.0.ebuild
Nicolas PARLANT 05eb112a79
net-dns/redis-knot: fix configure w/ libbpf
automagic trap: if libbpf is detected, xdp is enabled w/o checking if
libxdp (xdp-tools) is installed

disable xdp because nothing is needed here

Closes: https://bugs.gentoo.org/963176
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/43888
Closes: https://github.com/gentoo/gentoo/pull/43888
Signed-off-by: Sam James <sam@gentoo.org>
2025-09-22 03:40:14 +01:00

74 lines
1.8 KiB
Bash

# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools edo toolchain-funcs verify-sig
MY_PN="knot"
MY_P="${MY_PN}-${PV}"
DESCRIPTION="Redis module for Knot DNS"
HOMEPAGE="https://www.knot-dns.cz/ https://gitlab.nic.cz/knot/knot-dns"
SRC_URI="
https://knot-dns.nic.cz/release/${MY_P}.tar.xz
verify-sig? ( https://knot-dns.nic.cz/release/${MY_P}.tar.xz.asc )
"
S="${WORKDIR}/${MY_P}"
LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
# no test, it requires a Redis instance and RLTest (not packaged)
BDEPEND="
dev-build/libtool
verify-sig? ( sec-keys/openpgp-keys-knot )
"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/${MY_PN}.asc
PATCHES=(
# PR merged https://gitlab.nic.cz/knot/knot-dns/-/merge_requests/1808.patch
"${FILESDIR}"/${PN}-3.5.0-full_redis_opt.patch
# https://gitlab.nic.cz/knot/knot-dns/-/merge_requests/1809.patch
"${FILESDIR}"/${PN}-3.5.0-opt_gnutls.patch
)
# Used to check cpuset_t in sched.h with NetBSD.
# False positive because linux have sched.h too but with cpu_set_t
QA_CONFIG_IMPL_DECL_SKIP=( cpuset_create cpuset_destroy )
# because configure.ac is patched
src_prepare() {
default
eautoconf
}
src_configure() {
econf --disable-daemon --disable-modules --disable-utilities --disable-xdp --enable-redis=module
}
src_compile() {
pushd src/redis || die
# mimic src/redis/Makefile.am
edo ${LIBTOOL:=libtool} --tag=CC --mode=compile $(tc-getCC) \
${CFLAGS} -fvisibility=hidden \
-I../../src -include ../../src/config.h \
-c -o knot_la-knot.lo knot.c
edo ${LIBTOOL:=libtool} --tag=CC --mode=link $(tc-getCC) \
-module -shared -avoid-version \
${LDFLAGS} \
-o knot.la \
-rpath "${EPREFIX}"/usr/$(get_libdir)/knot/redis \
knot_la-knot.lo
popd || die
}
src_install() {
exeinto /usr/$(get_libdir)/knot/redis
doexe src/redis/.libs/knot.so
}