net-dns/getdns: add 1.7.3

Apart from the version bump, this
- introduces the `minimal` USE flag to build in stub resolution mode
  only, removing the dependency on `net-dns/unbound` (bug 803497)
- fixes installation paths of stubby (bugs 828724 and 857582)
- fixes linking to `dev-libs/gmp` when linking to `net-libs/gnutls`; see
  https://github.com/gentoo/gentoo/pull/29459#pullrequestreview-1314483307

Bug: https://bugs.gentoo.org/803497
Closes: https://bugs.gentoo.org/828724
Closes: https://bugs.gentoo.org/857582
Signed-off-by: Han Mertens <hanmertens@outlook.com>
Closes: https://github.com/gentoo/gentoo/pull/39022
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Han Mertens
2024-10-17 21:09:28 +02:00
committed by Sam James
parent 0b39336c6e
commit df7eb9bcfa
5 changed files with 167 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST getdns-1.7.2.tar.gz 702969 BLAKE2B 668a754200b816790f39a772d89c28e14bc5dbd041e07d9e53605ad44d63d6637078b66881c35dda62ed61622142797cc8f0041522e076cf551651fca688053a SHA512 6c4a75a4696c46ec8bd9e9659a93fd81f3490b43da28a4c95f99a766027c7588fc493a8ac51563afb8f975c0e5b77d5ea67014d80e78ee2bb17fba1d1073d19f
DIST getdns-1.7.3.tar.gz 703262 BLAKE2B 830063fc6f882a624fb7a6bb36fcb4f049a83ddd4515a906152a76d0247f4397b1e12ace7ce07053e7a42432c4f3683fe999ff36d8ede13a005ebecd14a78326 SHA512 d5725a24378b6fe0018daefdaba5565d2d4d51109ef66609fc34270a0a69accb95f5f895d0cdfc5caca51d2ec586db126f367439f05aed12507395af26739e2f

View File

@@ -0,0 +1,40 @@
diff -ur a/cmake/modules/FindGnuTLS.cmake b/cmake/modules/FindGnuTLS.cmake
--- a/cmake/modules/FindGnuTLS.cmake 2024-10-16 21:33:11.113665484 +0200
+++ b/cmake/modules/FindGnuTLS.cmake 2024-10-16 21:33:40.923835214 +0200
@@ -38,8 +38,8 @@
if (PkgGnuTLS_FOUND AND PkgGnuTLSDane_FOUND)
set(GNUTLS_INCLUDE_DIR ${PkgGnuTLS_INCLUDE_DIRS} $PkgGnuTLSDane_INCLUDE_DIRS} CACHE FILEPATH "GnuTLS include path")
- set(NETTLE_LIBRARIES ${PkgGnuTLS_LIBRARIES} ${PkgGnuTLSDane_LIBRARIES} CACHE STRING "GnuTLS libraries")
- set(NETTLE_VERSION ${PkgGnuTLS_VERSION})
+ set(GNUTLS_LIBRARIES ${PkgGnuTLS_LIBRARIES} ${PkgGnuTLSDane_LIBRARIES} CACHE STRING "GnuTLS libraries")
+ set(GNUTLS_VERSION ${PkgGnuTLS_VERSION})
add_library(GnuTLS::GnuTLS ALIAS PkgConfig::PkgGnuTLS)
add_library(GnuTLS::Dane ALIAS PkgConfig::PkgGnuTLSDane)
set(GnuTLS_FOUND ON)
diff -ur a/cmake/modules/FindNettle.cmake b/cmake/modules/FindNettle.cmake
--- a/cmake/modules/FindNettle.cmake 2024-10-16 21:05:17.521591723 +0200
+++ b/cmake/modules/FindNettle.cmake 2024-10-16 21:50:42.414650647 +0200
@@ -34,12 +34,20 @@
if(PKG_CONFIG_FOUND)
pkg_check_modules(PkgNettle IMPORTED_TARGET GLOBAL nettle)
pkg_check_modules(PkgHogweed IMPORTED_TARGET GLOBAL QUIET hogweed)
+ if (UNIX)
+ pkg_check_modules(PkgGmp IMPORTED_TARGET GLOBAL QUIET gmp)
+ endif ()
endif()
-if(PkgNettle_FOUND AND PkHogweed_FOUND)
+if(PkgNettle_FOUND AND PkgHogweed_FOUND)
set(NETTLE_INCLUDE_DIR ${PkgNettle_INCLUDE_DIRS} ${PkgHogweed_INCLUDE_DIRS} CACHE FILEPATH "Nettle include path")
- set(NETTLE_LIBRARIES ${PkgNettle_LIBRARIES} ${PkgHogweed_LIBRARIES} CACHE STRING "Nettle libraries")
+ if (PkgGmp_FOUND)
+ set(NETTLE_LIBRARIES ${PkgNettle_LIBRARIES} ${PkgHogweed_LIBRARIES} ${PkgGmp_LIBRARIES} CACHE STRING "Nettle libraries")
+ else ()
+ set(NETTLE_LIBRARIES ${PkgNettle_LIBRARIES} ${PkgHogweed_LIBRARIES} CACHE STRING "Nettle libraries")
+ endif ()
set(NETTLE_VERSION ${PkgNettle_VERSION})
+ set_target_properties(PkgConfig::PkgNettle PROPERTIES INTERFACE_LINK_LIBRARIES "${NETTLE_LIBRARIES}")
add_library(Nettle::Nettle ALIAS PkgConfig::PkgNettle)
add_library(Nettle::Hogweed ALIAS PkgConfig::PkgHogweed)
set(Nettle_FOUND ON)

View File

@@ -0,0 +1,28 @@
diff -ur a/stubby/CMakeLists.txt b/stubby/CMakeLists.txt
--- a/stubby/CMakeLists.txt 2024-10-14 20:08:06.950985143 +0200
+++ b/stubby/CMakeLists.txt 2024-10-14 20:09:29.408454887 +0200
@@ -58,13 +58,6 @@
else ()
set(RUNSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run")
endif ()
-install(DIRECTORY
- DESTINATION ${RUNSTATEDIR}
- DIRECTORY_PERMISSIONS
- OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
- )
set(STUBBYCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/stubby")
find_package(Libyaml REQUIRED)
@@ -187,8 +180,8 @@
if (ENABLE_WINDOWS_SERVICE)
install(TARGETS stubres LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif ()
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/stubby.1 DESTINATION share/man/man1)
-install(FILES AUTHORS COPYING ChangeLog NEWS README.md DESTINATION share/doc/stubby)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/stubby.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+install(FILES AUTHORS COPYING ChangeLog NEWS README.md DESTINATION ${CMAKE_INSTALL_DOCDIR}/stubby)
# Ensure the file gets CRLF line endings on Windows.
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/stubby.yml INPUT ${CMAKE_CURRENT_SOURCE_DIR}/stubby.yml.example)

View File

@@ -0,0 +1,97 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
_SRCURI_P="${P/%_beta1/-beta.1}"
inherit cmake fcaps systemd tmpfiles
DESCRIPTION="Modern asynchronous DNS API"
HOMEPAGE="https://getdnsapi.net/"
SRC_URI="https://getdnsapi.net/releases/${_SRCURI_P//./-}/${_SRCURI_P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc examples +getdns-query +getdns-server-mon gnutls +idn libev libevent libuv minimal static-libs stubby test +unbound"
S="${WORKDIR}/${_SRCURI_P}"
# https://bugs.gentoo.org/661760
# https://github.com/getdnsapi/getdns/issues/407
# (As of 1.7.0, seems to need network)
RESTRICT="test"
#RESTRICT="!test? ( test )"
DEPEND="
dev-libs/libbsd
dev-libs/libyaml
dev-libs/openssl:=
idn? ( net-dns/libidn2:= )
gnutls? (
net-libs/gnutls:0=[dane,openssl]
dev-libs/nettle:0=
)
libev? ( dev-libs/libev:= )
libevent? ( dev-libs/libevent:= )
libuv? ( dev-libs/libuv:= )
test? ( dev-libs/check )
!minimal? ( >=net-dns/unbound-1.5.9:= )
"
RDEPEND="
${DEPEND}
stubby? (
acct-group/stubby
acct-user/stubby
sys-libs/libcap
)
"
BDEPEND="
doc? ( app-text/doxygen )
"
PATCHES=(
"${FILESDIR}/${PN}-1.4.2-stubby.service.patch"
"${FILESDIR}/${PN}-1.7.3-cmake-linking.patch"
"${FILESDIR}/stubby-0.4.3-install-dir.patch"
)
src_configure() {
local mycmakeargs=(
-DCMAKE_INSTALL_RUNSTATEDIR=/var/run/stubby
-DBUILD_DOXYGEN=$(usex doc)
-DBUILD_GETDNS_QUERY=$(usex getdns-query)
-DBUILD_GETDNS_SERVER_MON=$(usex getdns-server-mon)
-DBUILD_STUBBY=$(usex stubby)
-DENABLE_STATIC=$(usex static-libs)
-DBUILD_TESTING:BOOL=$(usex test)
-DENABLE_UNBOUND_EVENT_API=$(usex unbound)
-DENABLE_STUB_ONLY=$(usex minimal)
-DUSE_GNUTLS=$(usex gnutls)
-DUSE_LIBEV=$(usex libev)
-DUSE_LIBEVENT2=$(usex libevent)
-DUSE_LIBIDN2=$(usex idn)
-DUSE_LIBUV=$(usex libuv)
)
cmake_src_configure
}
src_install() {
cmake_src_install
if use stubby; then
newinitd "${FILESDIR}"/stubby.initd-r2 stubby
newconfd "${FILESDIR}"/stubby.confd-r1 stubby
insinto /etc/logrotate.d
newins "${FILESDIR}"/stubby.logrotate stubby
systemd_dounit "${S}"/stubby/systemd/stubby.service
dotmpfiles "${S}"/stubby/systemd/stubby.conf
fi
}
pkg_postinst() {
if use stubby; then
fcaps cap_net_bind_service=ei usr/bin/stubby
tmpfiles_process stubby.conf
fi
}

View File

@@ -10,5 +10,6 @@
<flag name="libevent">Enable <pkg>dev-libs/libevent</pkg> support</flag>
<flag name="libev">Enable <pkg>dev-libs/libev</pkg> support</flag>
<flag name="libuv">Enable <pkg>dev-libs/libuv</pkg> support</flag>
<flag name="minimal">Only build stub resolution mode</flag>
</use>
</pkgmetadata>