public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-dns/avahi/, net-dns/avahi/files/
@ 2016-09-22  1:18 Anthony G. Basile
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2016-09-22  1:18 UTC (permalink / raw
  To: gentoo-commits

commit:     c1abde559a2dd280c67e4c78b39eb35da9a15f93
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 01:16:41 2016 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 01:16:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1abde55

net-dns/avahi: update openrc init scripts, bug #594622

Package-Manager: portage-2.2.28

 net-dns/avahi/avahi-0.6.32-r1.ebuild               | 233 +++++++++++++++++++++
 ...ahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch |  18 ++
 2 files changed, 251 insertions(+)

diff --git a/net-dns/avahi/avahi-0.6.32-r1.ebuild b/net-dns/avahi/avahi-0.6.32-r1.ebuild
new file mode 100644
index 00000000..850c800
--- /dev/null
+++ b/net-dns/avahi/avahi-0.6.32-r1.ebuild
@@ -0,0 +1,233 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="gdbm"
+
+WANT_AUTOMAKE=1.11
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal mono-env python-r1 systemd user
+
+DESCRIPTION="System which facilitates service discovery on a local network"
+HOMEPAGE="http://avahi.org/"
+SRC_URI="https://github.com/lathiat/avahi/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+S="${WORKDIR}/${P}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="autoipd bookmarks dbus doc gdbm gtk gtk3 howl-compat +introspection ipv6 kernel_linux mdnsresponder-compat mono nls python qt4 selinux test utils"
+
+REQUIRED_USE="
+	utils? ( || ( gtk gtk3 ) )
+	python? ( dbus gdbm )
+	mono? ( dbus )
+	howl-compat? ( dbus )
+	mdnsresponder-compat? ( dbus )
+"
+
+COMMON_DEPEND="
+	dev-libs/libdaemon
+	dev-libs/expat
+	dev-libs/glib:2[${MULTILIB_USEDEP}]
+	gdbm? ( sys-libs/gdbm[${MULTILIB_USEDEP}] )
+	qt4? ( dev-qt/qtcore:4[${MULTILIB_USEDEP}] )
+	gtk? ( x11-libs/gtk+:2[${MULTILIB_USEDEP}] )
+	gtk3? ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
+	dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+	kernel_linux? ( sys-libs/libcap )
+	introspection? ( dev-libs/gobject-introspection:= )
+	mono? (
+		dev-lang/mono
+		gtk? ( dev-dotnet/gtk-sharp )
+	)
+	python? (
+		${PYTHON_DEPS}
+		gtk? ( dev-python/pygtk )
+		dbus? ( dev-python/dbus-python )
+	)
+	bookmarks? (
+		dev-python/twisted-core
+		dev-python/twisted-web
+	)
+"
+
+DEPEND="
+	${COMMON_DEPEND}
+	doc? ( app-doc/doxygen )
+	app-doc/xmltoman
+	dev-util/intltool
+	virtual/pkgconfig[${MULTILIB_USEDEP}]
+"
+
+RDEPEND="
+	${COMMON_DEPEND}
+	howl-compat? ( !net-misc/howl )
+	mdnsresponder-compat? ( !net-misc/mDNSResponder )
+	selinux? ( sec-policy/selinux-avahi )
+"
+
+pkg_preinst() {
+	enewgroup netdev
+	enewgroup avahi
+	enewuser avahi -1 -1 -1 avahi
+
+	if use autoipd; then
+		enewgroup avahi-autoipd
+		enewuser avahi-autoipd -1 -1 -1 avahi-autoipd
+	fi
+}
+
+pkg_setup() {
+	use mono && mono-env_pkg_setup
+}
+
+src_prepare() {
+	if ! use ipv6; then
+		sed -i \
+			-e s/use-ipv6=yes/use-ipv6=no/ \
+			avahi-daemon/avahi-daemon.conf || die
+	fi
+
+	sed -i\
+		-e "s:\\.\\./\\.\\./\\.\\./doc/avahi-docs/html/:../../../doc/${PF}/html/:" \
+		doxygen_to_devhelp.xsl || die
+
+	# Make gtk utils optional
+	# https://github.com/lathiat/avahi/issues/24
+	epatch "${FILESDIR}"/${PN}-0.6.30-optional-gtk-utils.patch
+
+	# Don't install avahi-discover unless ENABLE_GTK_UTILS, bug #359575
+	# https://github.com/lathiat/avahi/issues/24
+	epatch "${FILESDIR}"/${PN}-0.6.31-fix-install-avahi-discover.patch
+
+	# Fix build under various locales, bug #501664
+	# https://github.com/lathiat/avahi/issues/27
+	epatch "${FILESDIR}"/${PN}-0.6.31-fix-locale-build.patch
+
+	# Update the init scripts for the new openrc, bug #594622
+	epatch "${FILESDIR}"/${PN}-0.6.32-openrc-0.21.7-fix-init-scripts.patch
+
+	# Bug #525832
+	epatch_user
+
+	# Prevent .pyc files in DESTDIR
+	>py-compile
+
+	eautoreconf
+
+	# bundled manpages
+	multilib_copy_sources
+}
+
+src_configure() {
+	# those steps should be done once-per-ebuild rather than per-ABI
+	use sh && replace-flags -O? -O0
+	use python && python_export_best
+
+	# We need to unset DISPLAY, else the configure script might have problems detecting the pygtk module
+	unset DISPLAY
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=( --disable-static )
+
+	if use python; then
+		myconf+=(
+			$(multilib_native_use_enable dbus python-dbus)
+			$(multilib_native_use_enable gtk pygtk)
+		)
+	fi
+
+	if use mono; then
+		myconf+=( $(multilib_native_use_enable doc monodoc) )
+	fi
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# used by daemons only
+			--disable-libdaemon
+			--with-xml=none
+		)
+	fi
+
+	econf \
+		--localstatedir="${EPREFIX}/var" \
+		--with-distro=gentoo \
+		--disable-python-dbus \
+		--disable-pygtk \
+		--enable-manpages \
+		--enable-xmltoman \
+		--disable-monodoc \
+		--enable-glib \
+		--enable-gobject \
+		$(multilib_native_use_enable test tests) \
+		$(multilib_native_use_enable autoipd) \
+		$(use_enable mdnsresponder-compat compat-libdns_sd) \
+		$(use_enable howl-compat compat-howl) \
+		$(multilib_native_use_enable doc doxygen-doc) \
+		$(multilib_native_use_enable mono) \
+		$(use_enable dbus) \
+		$(multilib_native_use_enable python) \
+		$(use_enable gtk) \
+		$(use_enable gtk3) \
+		$(use_enable nls) \
+		$(multilib_native_use_enable introspection) \
+		$(multilib_native_use_enable utils gtk-utils) \
+		--disable-qt3 \
+		$(use_enable qt4) \
+		$(use_enable gdbm) \
+		$(systemd_with_unitdir) \
+		"${myconf[@]}"
+}
+
+multilib_src_compile() {
+	emake
+
+	multilib_is_native_abi && use doc && emake avahi.devhelp
+}
+
+multilib_src_install() {
+	emake install DESTDIR="${D}"
+	use bookmarks && use python && use dbus && use gtk || \
+		rm -f "${ED}"/usr/bin/avahi-bookmarks
+
+	# https://github.com/lathiat/avahi/issues/28
+	use howl-compat && dosym avahi-compat-howl.pc /usr/$(get_libdir)/pkgconfig/howl.pc
+	use mdnsresponder-compat && dosym avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h
+
+	if multilib_is_native_abi && use doc; then
+		dohtml -r doxygen/html/. || die
+		insinto /usr/share/devhelp/books/avahi
+		doins avahi.devhelp || die
+	fi
+}
+
+multilib_src_install_all() {
+	if use autoipd; then
+		insinto /$(get_libdir)/rcscripts/net
+		doins "${FILESDIR}"/autoipd.sh
+
+		insinto /$(get_libdir)/netifrc/net
+		newins "${FILESDIR}"/autoipd-openrc.sh autoipd.sh
+	fi
+
+	dodoc docs/{AUTHORS,NEWS,README,TODO}
+
+	prune_libtool_files --all
+}
+
+pkg_postinst() {
+	if use autoipd; then
+		elog
+		elog "To use avahi-autoipd to configure your interfaces with IPv4LL (RFC3927)"
+		elog "addresses, just set config_<interface>=( autoipd ) in /etc/conf.d/net!"
+		elog
+	fi
+}

diff --git a/net-dns/avahi/files/avahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch b/net-dns/avahi/files/avahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch
new file mode 100644
index 00000000..2b91179
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.6.32-openrc-0.21.7-fix-init-scripts.patch
@@ -0,0 +1,18 @@
+diff -Naur avahi-0.6.32.orig/initscript/gentoo/avahi-daemon.in avahi-0.6.32/initscript/gentoo/avahi-daemon.in
+--- avahi-0.6.32.orig/initscript/gentoo/avahi-daemon.in	2016-02-15 21:13:45.000000000 -0500
++++ avahi-0.6.32/initscript/gentoo/avahi-daemon.in	2016-09-21 20:58:01.999109439 -0400
+@@ -1,4 +1,4 @@
+-#!/sbin/runscript
++#!/sbin/openrc-run
+ # Copyright 1999-2007 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+ 
+diff -Naur avahi-0.6.32.orig/initscript/gentoo/avahi-dnsconfd.in avahi-0.6.32/initscript/gentoo/avahi-dnsconfd.in
+--- avahi-0.6.32.orig/initscript/gentoo/avahi-dnsconfd.in	2016-02-15 21:13:45.000000000 -0500
++++ avahi-0.6.32/initscript/gentoo/avahi-dnsconfd.in	2016-09-21 20:58:12.683109618 -0400
+@@ -1,4 +1,4 @@
+-#!/sbin/runscript
++#!/sbin/openrc-run
+ # Copyright 1999-2007 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+ 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-dns/avahi/, net-dns/avahi/files/
@ 2019-11-09 16:44 Anthony G. Basile
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2019-11-09 16:44 UTC (permalink / raw
  To: gentoo-commits

commit:     45462cc03dbb59f60d3f4d3249d12c31ce8cbe30
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  9 16:44:22 2019 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Nov  9 16:44:22 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45462cc0

net-dns/avahi: fix CVE-2017-6519 and CVE-2018-100084, bug #627020

Package-Manager: Portage-2.3.76, Repoman-2.3.16
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 net-dns/avahi/avahi-0.7-r2.ebuild                 |  5 ++-
 net-dns/avahi/files/avahi-0.7-CVE-2017-6519.patch | 45 +++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/net-dns/avahi/avahi-0.7-r2.ebuild b/net-dns/avahi/avahi-0.7-r2.ebuild
index 481ebbb7827..bd5913ffa79 100644
--- a/net-dns/avahi/avahi-0.7-r2.ebuild
+++ b/net-dns/avahi/avahi-0.7-r2.ebuild
@@ -68,7 +68,10 @@ RDEPEND="
 
 MULTILIB_WRAPPED_HEADERS=( /usr/include/avahi-qt5/qt-watch.h )
 
-PATCHES=( "${FILESDIR}/${P}-qt5.patch" )
+PATCHES=(
+	"${FILESDIR}/${P}-qt5.patch"
+	"${FILESDIR}/${P}-CVE-2017-6519.patch"
+)
 
 pkg_preinst() {
 	enewgroup netdev

diff --git a/net-dns/avahi/files/avahi-0.7-CVE-2017-6519.patch b/net-dns/avahi/files/avahi-0.7-CVE-2017-6519.patch
new file mode 100644
index 00000000000..5fadfbc2892
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.7-CVE-2017-6519.patch
@@ -0,0 +1,45 @@
+From e111def44a7df4624a4aa3f85fe98054bffb6b4f Mon Sep 17 00:00:00 2001
+From: Trent Lloyd <trent@lloyd.id.au>
+Date: Sat, 22 Dec 2018 09:06:07 +0800
+Subject: [PATCH] Drop legacy unicast queries from address not on local link
+
+When handling legacy unicast queries, ensure that the source IP is
+inside a subnet on the local link, otherwise drop the packet.
+
+Fixes #145
+Fixes #203
+CVE-2017-6519
+CVE-2018-100084
+---
+ avahi-core/server.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/avahi-core/server.c b/avahi-core/server.c
+index a2cb19a..a2580e3 100644
+--- a/avahi-core/server.c
++++ b/avahi-core/server.c
+@@ -930,6 +930,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres
+ 
+     if (avahi_dns_packet_is_query(p)) {
+         int legacy_unicast = 0;
++        char t[AVAHI_ADDRESS_STR_MAX];
+ 
+         /* For queries EDNS0 might allow ARCOUNT != 0. We ignore the
+          * AR section completely here, so far. Until the day we add
+@@ -947,6 +948,13 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres
+             legacy_unicast = 1;
+         }
+ 
++        if (!is_mdns_mcast_address(dst_address) &&
++            !avahi_interface_address_on_link(i, src_address)) {
++
++            avahi_log_debug("Received non-local unicast query from host %s on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), i->hardware->name, i->protocol);
++            return;
++        }
++
+         if (legacy_unicast)
+             reflect_legacy_unicast_query_packet(s, p, i, src_address, port);
+ 
+-- 
+2.21.0
+


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-dns/avahi/, net-dns/avahi/files/
@ 2022-08-18 13:27 Anthony G. Basile
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2022-08-18 13:27 UTC (permalink / raw
  To: gentoo-commits

commit:     ca40d8f1bbfd62625a223896fefe4cc0d5284175
Author:     Federico Denkena <federico.denkena <AT> posteo <DOT> de>
AuthorDate: Tue Jun 21 15:33:40 2022 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Aug 18 13:21:57 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca40d8f1

Patches for net-dns/avahi

These patches were pulled from the avahi upstream to fix a vulnerability
and other bugs.
Bug: https://bugs.gentoo.org/793953
Signed-off-by: Federico Denkena <federico.denkena <AT> posteo.de>
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 net-dns/avahi/avahi-0.8-r6.ebuild                  | 217 +++++++++++++++++++++
 .../avahi/files/avahi-0.8-dependency-error.patch   |  15 ++
 .../files/avahi-0.8-disable-avahi-ui-sharp.patch   |  12 --
 .../avahi/files/avahi-0.8-null-pointer-crash.patch | 129 ++++++++++++
 .../avahi-0.8-potentially-undefined-fix.patch      |  25 +++
 5 files changed, 386 insertions(+), 12 deletions(-)

diff --git a/net-dns/avahi/avahi-0.8-r6.ebuild b/net-dns/avahi/avahi-0.8-r6.ebuild
new file mode 100644
index 000000000000..4a301d91cbc8
--- /dev/null
+++ b/net-dns/avahi/avahi-0.8-r6.ebuild
@@ -0,0 +1,217 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_REQ_USE="gdbm"
+inherit autotools flag-o-matic multilib-minimal mono-env python-single-r1 systemd
+
+DESCRIPTION="System which facilitates service discovery on a local network"
+HOMEPAGE="https://avahi.org/"
+SRC_URI="https://github.com/lathiat/avahi/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+IUSE="autoipd bookmarks +dbus doc gdbm gtk howl-compat +introspection ipv6 mdnsresponder-compat mono nls python qt5 selinux systemd test"
+
+REQUIRED_USE="
+	python? ( dbus gdbm ${PYTHON_REQUIRED_USE} )
+	bookmarks? ( python )
+	mono? ( dbus )
+	howl-compat? ( dbus )
+	mdnsresponder-compat? ( dbus )
+	systemd? ( dbus )
+"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="
+	dev-libs/libdaemon
+	dev-libs/libevent:=[${MULTILIB_USEDEP}]
+	dev-libs/expat
+	dev-libs/glib:2[${MULTILIB_USEDEP}]
+	gdbm? ( sys-libs/gdbm:=[${MULTILIB_USEDEP}] )
+	qt5? ( dev-qt/qtcore:5 )
+	gtk?  ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
+	dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+	kernel_linux? ( sys-libs/libcap )
+	introspection? ( dev-libs/gobject-introspection:= )
+	mono? ( dev-lang/mono )
+	python? (
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep '
+			bookmarks? ( >=dev-python/twisted-16.0.0[${PYTHON_USEDEP}] )
+			dbus? ( dev-python/dbus-python[${PYTHON_USEDEP}] )
+			introspection? ( dev-python/pygobject:3[${PYTHON_USEDEP}] )
+		')
+	)
+"
+RDEPEND="
+	acct-user/avahi
+	acct-group/avahi
+	acct-group/netdev
+	autoipd? (
+		acct-user/avahi-autoipd
+		acct-group/avahi-autoipd
+	)
+	${DEPEND}
+	selinux? ( sec-policy/selinux-avahi )
+"
+BDEPEND="
+	dev-util/glib-utils
+	doc? ( app-doc/doxygen )
+	app-doc/xmltoman
+	sys-devel/gettext
+	virtual/pkgconfig
+"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/avahi-qt5/qt-watch.h )
+
+PATCHES=(
+	"${FILESDIR}/${P}-disable-avahi-ui-sharp.patch" # bug 769062
+	"${FILESDIR}/${P}-dependency-error.patch"
+	"${FILESDIR}/${P}-null-pointer-crash.patch"
+	"${FILESDIR}/${P}-potentially-undefined-fix.patch"
+# These patches do not apply cleanly but may need to be re-instated.
+# I'll leave them commented out for now.
+#	"${FILESDIR}/${PN}-0.7-qt5.patch"
+#	"${FILESDIR}/${PN}-0.7-CVE-2017-6519.patch"
+#	"${FILESDIR}/${PN}-0.7-remove-empty-avahi_discover.patch"
+#	"${FILESDIR}/${PN}-0.7-python3.patch"
+#	"${FILESDIR}/${PN}-0.7-python3-unittest.patch"
+#	"${FILESDIR}/${PN}-0.7-python3-gdbm.patch"
+)
+
+pkg_setup() {
+	use mono && mono-env_pkg_setup
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	if ! use ipv6; then
+		sed -i \
+			-e "s/use-ipv6=yes/use-ipv6=no/" \
+			avahi-daemon/avahi-daemon.conf || die
+	fi
+
+	sed -i \
+		-e "s:\\.\\./\\.\\./\\.\\./doc/avahi-docs/html/:../../../doc/${PF}/html/:" \
+		doxygen_to_devhelp.xsl || die
+
+	eautoreconf
+
+	# bundled manpages
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		--disable-gtk
+		--disable-monodoc
+		--disable-python-dbus
+		--disable-qt3
+		--disable-qt4
+		--disable-static
+		--enable-manpages
+		--enable-glib
+		--enable-gobject
+		--enable-xmltoman
+		--localstatedir="${EPREFIX}/var"
+		--with-distro=gentoo
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		$(use_enable dbus)
+		$(use_enable gdbm)
+		$(use_enable gtk gtk3)
+		$(use_enable howl-compat compat-howl)
+		$(use_enable mdnsresponder-compat compat-libdns_sd)
+		$(use_enable nls)
+		$(multilib_native_use_enable autoipd)
+		$(multilib_native_use_enable doc doxygen-doc)
+		$(multilib_native_use_enable introspection)
+		$(multilib_native_use_enable mono)
+		$(multilib_native_use_enable python)
+		$(multilib_native_use_enable test tests)
+	)
+
+	if use python; then
+		myconf+=(
+			$(multilib_native_use_enable dbus python-dbus)
+			$(multilib_native_use_enable introspection pygobject)
+		)
+	fi
+
+	if use mono; then
+		myconf+=( $(multilib_native_use_enable doc monodoc) )
+	fi
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# used by daemons only
+			--disable-libdaemon
+			--with-xml=none
+		)
+	fi
+
+	myconf+=( $(multilib_native_use_enable qt5) )
+
+	econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+	emake
+
+	multilib_is_native_abi && use doc && emake avahi.devhelp
+}
+
+multilib_src_install() {
+	emake install DESTDIR="${D}"
+
+	if ! use bookmarks || ! use python || ! use dbus; then
+		rm -f "${ED}"/usr/bin/avahi-bookmarks || die
+	fi
+
+	# https://github.com/lathiat/avahi/issues/28
+	use howl-compat && dosym avahi-compat-howl.pc /usr/$(get_libdir)/pkgconfig/howl.pc
+	use mdnsresponder-compat && dosym avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h
+
+	if multilib_is_native_abi && use doc; then
+		docinto html
+		dodoc -r doxygen/html/.
+		insinto /usr/share/devhelp/books/avahi
+		doins avahi.devhelp
+	fi
+
+	# The build system creates an empty "/run" directory, so we clean it up here
+	rmdir "${ED}"/run || die
+}
+
+multilib_src_install_all() {
+	use python && python_optimize
+
+	if use autoipd; then
+		insinto /lib/rcscripts/net
+		doins "${FILESDIR}"/autoipd.sh
+
+		insinto /lib/netifrc/net
+		newins "${FILESDIR}"/autoipd-openrc.sh autoipd.sh
+	fi
+
+	dodoc docs/{AUTHORS,NEWS,README,TODO}
+
+	find "${ED}" -name '*.la' -type f -delete || die
+}
+
+pkg_postinst() {
+	if use autoipd; then
+		elog
+		elog "To use avahi-autoipd to configure your interfaces with IPv4LL (RFC3927)"
+		elog "addresses, just set config_<interface>=( autoipd ) in /etc/conf.d/net!"
+		elog
+	fi
+
+	systemd_reenable avahi-daemon.service
+}

diff --git a/net-dns/avahi/files/avahi-0.8-dependency-error.patch b/net-dns/avahi/files/avahi-0.8-dependency-error.patch
new file mode 100644
index 000000000000..1a4025ea2002
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.8-dependency-error.patch
@@ -0,0 +1,15 @@
+https://github.com/lathiat/avahi/commit/366e3798bdbd6b7bf24e59379f4a9a51af575ce9.patch
+From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= <tpgxyz@gmail.com>
+Date: Thu, 20 Feb 2020 16:09:40 +0100
+Subject: [PATCH] fix requires in pc file
+
+--- a/avahi-libevent.pc.in
++++ b/avahi-libevent.pc.in
+@@ -6,6 +6,6 @@ includedir=${prefix}/include
+ Name: avahi-libevent
+ Description: Avahi Multicast DNS Responder (libevent Support)
+ Version: @PACKAGE_VERSION@
+-Requires: libevent-2.1.5
++Requires: libevent >= 2.1.5
+ Libs: -L${libdir} -lavahi-libevent
+ Cflags: -D_REENTRANT -I${includedir}

diff --git a/net-dns/avahi/files/avahi-0.8-disable-avahi-ui-sharp.patch b/net-dns/avahi/files/avahi-0.8-disable-avahi-ui-sharp.patch
index 31b361d4e17f..35f2a15af919 100644
--- a/net-dns/avahi/files/avahi-0.8-disable-avahi-ui-sharp.patch
+++ b/net-dns/avahi/files/avahi-0.8-disable-avahi-ui-sharp.patch
@@ -4,13 +4,6 @@ Date: Sat, 27 Mar 2021 22:49:08 +0100
 Subject: [PATCH] Disable avahi-ui-sharp
 
 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
----
- Makefile.am  | 6 ++----
- configure.ac | 1 -
- 2 files changed, 2 insertions(+), 5 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 33c51f5..0e12120 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -46,7 +46,6 @@ EXTRA_DIST = \
@@ -40,8 +33,6 @@ index 33c51f5..0e12120 100644
  endif
  
  endif
-diff --git a/configure.ac b/configure.ac
-index 58db8c7..844360f 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -1166,7 +1166,6 @@ man/Makefile
@@ -52,6 +43,3 @@ index 58db8c7..844360f 100644
  avahi-compat-libdns_sd/Makefile
  avahi-compat-howl/Makefile
  avahi-compat-howl/samples/Makefile
--- 
-2.31.1
-

diff --git a/net-dns/avahi/files/avahi-0.8-null-pointer-crash.patch b/net-dns/avahi/files/avahi-0.8-null-pointer-crash.patch
new file mode 100644
index 000000000000..93ed513a59cd
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.8-null-pointer-crash.patch
@@ -0,0 +1,129 @@
+https://github.com/lathiat/avahi/commit/fd482a74625b8db8547b8cfca3ee3d3c6c721423.patch
+From: Tommi Rantala <tommi.t.rantala@nokia.com>
+Date: Mon, 8 Feb 2021 11:04:43 +0200
+Subject: [PATCH] Fix NULL pointer crashes from #175
+
+avahi-daemon is crashing when running "ping .local".
+The crash is due to failing assertion from NULL pointer.
+Add missing NULL pointer checks to fix it.
+
+Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd
+--- a/avahi-core/browse-dns-server.c
++++ b/avahi-core/browse-dns-server.c
+@@ -343,7 +343,10 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
+         AvahiSDNSServerBrowser* b;
+ 
+         b = avahi_s_dns_server_browser_prepare(server, interface, protocol, domain, type, aprotocol, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_dns_server_browser_start(b);
+ 
+         return b;
+-}
+\ No newline at end of file
++}
+
+--- a/avahi-core/browse-domain.c
++++ b/avahi-core/browse-domain.c
+@@ -253,7 +253,10 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new(
+         AvahiSDomainBrowser *b;
+ 
+         b = avahi_s_domain_browser_prepare(server, interface, protocol, domain, type, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_domain_browser_start(b);
+ 
+         return b;
+-}
+\ No newline at end of file
++}
+
+--- a/avahi-core/browse-service-type.c
++++ b/avahi-core/browse-service-type.c
+@@ -171,6 +171,9 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
+         AvahiSServiceTypeBrowser *b;
+ 
+         b = avahi_s_service_type_browser_prepare(server, interface, protocol, domain, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_service_type_browser_start(b);
+ 
+         return b;
+
+--- a/avahi-core/browse-service.c
++++ b/avahi-core/browse-service.c
+@@ -184,6 +184,9 @@ AvahiSServiceBrowser *avahi_s_service_browser_new(
+         AvahiSServiceBrowser *b;
+ 
+         b = avahi_s_service_browser_prepare(server, interface, protocol, service_type, domain, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_service_browser_start(b);
+ 
+         return b;
+
+--- a/avahi-core/browse.c
++++ b/avahi-core/browse.c
+@@ -634,6 +634,9 @@ AvahiSRecordBrowser *avahi_s_record_browser_new(
+         AvahiSRecordBrowser *b;
+ 
+         b = avahi_s_record_browser_prepare(server, interface, protocol, key, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_record_browser_start_query(b);
+ 
+         return b;
+
+--- a/avahi-core/resolve-address.c
++++ b/avahi-core/resolve-address.c
+@@ -286,7 +286,10 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
+         AvahiSAddressResolver *b;
+ 
+         b = avahi_s_address_resolver_prepare(server, interface, protocol, address, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_address_resolver_start(b);
+ 
+         return b;
+-}
+\ No newline at end of file
++}
+
+--- a/avahi-core/resolve-host-name.c
++++ b/avahi-core/resolve-host-name.c
+@@ -318,7 +318,10 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
+         AvahiSHostNameResolver *b;
+ 
+         b = avahi_s_host_name_resolver_prepare(server, interface, protocol, host_name, aprotocol, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_host_name_resolver_start(b);
+ 
+         return b;
+-}
+\ No newline at end of file
++}
+
+--- a/avahi-core/resolve-service.c
++++ b/avahi-core/resolve-service.c
+@@ -519,7 +519,10 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
+         AvahiSServiceResolver *b;
+ 
+         b = avahi_s_service_resolver_prepare(server, interface, protocol, name, type, domain, aprotocol, flags, callback, userdata);
++        if (!b)
++            return NULL;
++
+         avahi_s_service_resolver_start(b);
+ 
+         return b;
+-}
+\ No newline at end of file
++}
+

diff --git a/net-dns/avahi/files/avahi-0.8-potentially-undefined-fix.patch b/net-dns/avahi/files/avahi-0.8-potentially-undefined-fix.patch
new file mode 100644
index 000000000000..4419831939e1
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.8-potentially-undefined-fix.patch
@@ -0,0 +1,25 @@
+https://github.com/lathiat/avahi/commit/b897ca43ac100d326d118e5877da710eb7f836f9.patch
+From: traffic-millions <60914101+traffic-millions@users.noreply.github.com>
+Date: Tue, 3 Mar 2020 11:15:48 +0800
+Subject: [PATCH] avahi_dns_packet_consume_uint32: fix potential undefined
+ behavior
+
+avahi_dns_packet_consume_uint32 left shifts uint8_t values by 8, 16 and 24 bits to combine them into a 32-bit value. This produces an undefined behavior warning with gcc -fsanitize when fed input values of 128 or 255 however in testing no actual unexpected behavior occurs in practice and the 32-bit uint32_t is always correctly produced as the final value is immediately stored into a uint32_t and the compiler appears to handle this "correctly".
+
+Cast the intermediate values to uint32_t to prevent this warning and ensure the intended result is explicit.
+
+Closes: #267
+Closes: #268
+Reference: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19304
+--- a/avahi-core/dns.c
++++ b/avahi-core/dns.c
+@@ -455,7 +455,7 @@ int avahi_dns_packet_consume_uint32(AvahiDnsPacket *p, uint32_t *ret_v) {
+         return -1;
+ 
+     d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex);
+-    *ret_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
++    *ret_v = ((uint32_t)d[0] << 24) | ((uint32_t)d[1] << 16) | ((uint32_t)d[2] << 8) | (uint32_t)d[3];
+     p->rindex += sizeof(uint32_t);
+ 
+     return 0;
+


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-dns/avahi/, net-dns/avahi/files/
@ 2025-06-26 19:50 Patrick McLean
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick McLean @ 2025-06-26 19:50 UTC (permalink / raw
  To: gentoo-commits

commit:     2cb38a305bb287c97344443ca4913f86bf30e96d
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 26 19:48:44 2025 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Jun 26 19:49:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cb38a30

net-dns/avahi: Revbump, add patch for CVE-2024-52615 (bug #959127)

Bug: https://bugs.gentoo.org/959127
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 net-dns/avahi/avahi-0.9_rc2-r1.ebuild              | 204 +++++++++++++++++++
 .../avahi/files/avahi-0.9_rc2-CVE-2024-52615.patch | 225 +++++++++++++++++++++
 2 files changed, 429 insertions(+)

diff --git a/net-dns/avahi/avahi-0.9_rc2-r1.ebuild b/net-dns/avahi/avahi-0.9_rc2-r1.ebuild
new file mode 100644
index 000000000000..37bb93805c41
--- /dev/null
+++ b/net-dns/avahi/avahi-0.9_rc2-r1.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+PYTHON_REQ_USE="gdbm"
+inherit autotools multilib-minimal python-single-r1 systemd
+
+DESCRIPTION="System which facilitates service discovery on a local network"
+HOMEPAGE="https://avahi.org/"
+SRC_URI="https://github.com/lathiat/avahi/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="autoipd bookmarks +dbus doc gdbm gtk howl-compat +introspection ipv6 mdnsresponder-compat nls python qt5 selinux systemd test"
+
+REQUIRED_USE="
+	python? ( dbus gdbm ${PYTHON_REQUIRED_USE} )
+	bookmarks? ( python )
+	howl-compat? ( dbus )
+	mdnsresponder-compat? ( dbus )
+	systemd? ( dbus )
+"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="
+	dev-libs/libdaemon
+	dev-libs/libevent:=[${MULTILIB_USEDEP}]
+	dev-libs/expat
+	dev-libs/glib:2[${MULTILIB_USEDEP}]
+	gdbm? ( sys-libs/gdbm:=[${MULTILIB_USEDEP}] )
+	qt5? ( dev-qt/qtcore:5 )
+	gtk?  ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
+	dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+	kernel_linux? ( sys-libs/libcap )
+	introspection? ( dev-libs/gobject-introspection:= )
+	systemd? ( sys-apps/systemd:=[${MULTILIB_USEDEP}] )
+	python? (
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep '
+			bookmarks? ( >=dev-python/twisted-16.0.0[${PYTHON_USEDEP}] )
+			dbus? ( dev-python/dbus-python[${PYTHON_USEDEP}] )
+			introspection? ( dev-python/pygobject:3[${PYTHON_USEDEP}] )
+		')
+	)
+"
+RDEPEND="
+	acct-user/avahi
+	acct-group/avahi
+	acct-group/netdev
+	autoipd? (
+		acct-user/avahi-autoipd
+		acct-group/avahi-autoipd
+	)
+	${DEPEND}
+	selinux? ( sec-policy/selinux-avahi )
+"
+BDEPEND="
+	dev-util/glib-utils
+	doc? ( app-text/doxygen )
+	app-text/xmltoman
+	sys-devel/gettext
+	virtual/pkgconfig
+"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/avahi-qt5/qt-watch.h )
+
+PATCHES=(
+	"${FILESDIR}/avahi-0.9_rc1-disable-avahi-ui-sharp.patch" # bug 769062
+	"${FILESDIR}/avahi-0.9_rc2-CVE-2024-52615.patch"
+)
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	if ! use ipv6; then
+		sed -i \
+			-e "s/use-ipv6=yes/use-ipv6=no/" \
+			avahi-daemon/avahi-daemon.conf || die
+	fi
+
+	sed -i \
+		-e "s:\\.\\./\\.\\./\\.\\./doc/avahi-docs/html/:../../../doc/${PF}/html/:" \
+		doxygen_to_devhelp.xsl || die
+
+	eautoreconf
+
+	# bundled manpages
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		--disable-gtk
+		--disable-mono
+		--disable-monodoc
+		--disable-python-dbus
+		--disable-qt3
+		--disable-qt4
+		--disable-static
+		--enable-manpages
+		--enable-glib
+		--enable-gobject
+		--enable-xmltoman
+		--localstatedir="${EPREFIX}/var"
+		--runstatedir="${EPREFIX}/run"
+		--with-distro=gentoo
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		$(use_enable dbus)
+		$(use_enable gdbm)
+		$(use_enable gtk gtk3)
+		$(use_enable howl-compat compat-howl)
+		$(use_enable mdnsresponder-compat compat-libdns_sd)
+		$(use_enable nls)
+		$(use_enable systemd libsystemd)
+		$(multilib_native_use_enable autoipd)
+		$(multilib_native_use_enable doc doxygen-doc)
+		$(multilib_native_use_enable introspection)
+		$(multilib_native_use_enable python)
+		$(multilib_native_use_enable test tests)
+	)
+
+	if use python; then
+		myconf+=(
+			$(multilib_native_use_enable dbus python-dbus)
+			$(multilib_native_use_enable introspection pygobject)
+		)
+	fi
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# used by daemons only
+			--disable-libdaemon
+			--with-xml=none
+		)
+	fi
+
+	myconf+=( $(multilib_native_use_enable qt5) )
+
+	econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+	emake
+
+	multilib_is_native_abi && use doc && emake avahi.devhelp
+}
+
+multilib_src_install() {
+	emake install DESTDIR="${D}"
+
+	if ! use bookmarks || ! use python || ! use dbus; then
+		rm -f "${ED}"/usr/bin/avahi-bookmarks || die
+	fi
+
+	# https://github.com/lathiat/avahi/issues/28
+	use howl-compat && dosym avahi-compat-howl.pc /usr/$(get_libdir)/pkgconfig/howl.pc
+	use mdnsresponder-compat && dosym avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h
+
+	if multilib_is_native_abi && use doc; then
+		docinto html
+		dodoc -r doxygen/html/.
+		insinto /usr/share/devhelp/books/avahi
+		doins avahi.devhelp
+	fi
+
+	# The build system creates an empty "/run" directory, so we clean it up here
+	rmdir "${ED}"/run || die
+}
+
+multilib_src_install_all() {
+	use python && python_optimize
+
+	if use autoipd; then
+		insinto /lib/rcscripts/net
+		doins "${FILESDIR}"/autoipd.sh
+
+		insinto /lib/netifrc/net
+		newins "${FILESDIR}"/autoipd-openrc.sh autoipd.sh
+	fi
+
+	dodoc docs/{AUTHORS,NEWS,README,TODO}
+
+	find "${ED}" -name '*.la' -type f -delete || die
+}
+
+pkg_postinst() {
+	if use autoipd; then
+		elog
+		elog "To use avahi-autoipd to configure your interfaces with IPv4LL (RFC3927)"
+		elog "addresses, just set config_<interface>=( autoipd ) in /etc/conf.d/net!"
+		elog
+	fi
+
+	systemd_reenable avahi-daemon.service
+}

diff --git a/net-dns/avahi/files/avahi-0.9_rc2-CVE-2024-52615.patch b/net-dns/avahi/files/avahi-0.9_rc2-CVE-2024-52615.patch
new file mode 100644
index 000000000000..40cb5b539e48
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.9_rc2-CVE-2024-52615.patch
@@ -0,0 +1,225 @@
+commit 4e2e1ea0908d7e6ad7f38ae04fdcdf2411f8b942
+Author: Michal Sekletar <msekleta@redhat.com>
+Date:   Wed Nov 27 18:07:32 2024 +0100
+
+    core/wide-area: fix for CVE-2024-52615
+
+diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c
+index 00a1505..06df7af 100644
+--- a/avahi-core/wide-area.c
++++ b/avahi-core/wide-area.c
+@@ -81,6 +81,10 @@ struct AvahiWideAreaLookup {
+ 
+     AvahiAddress dns_server_used;
+ 
++    int fd;
++    AvahiWatch *watch;
++    AvahiProtocol proto;
++
+     AVAHI_LLIST_FIELDS(AvahiWideAreaLookup, lookups);
+     AVAHI_LLIST_FIELDS(AvahiWideAreaLookup, by_key);
+ };
+@@ -88,9 +92,6 @@ struct AvahiWideAreaLookup {
+ struct AvahiWideAreaLookupEngine {
+     AvahiServer *server;
+ 
+-    int fd_ipv4, fd_ipv6;
+-    AvahiWatch *watch_ipv4, *watch_ipv6;
+-
+     /* Cache */
+     AVAHI_LLIST_HEAD(AvahiWideAreaCacheEntry, cache);
+     AvahiHashmap *cache_by_key;
+@@ -125,35 +126,67 @@ static AvahiWideAreaLookup* find_lookup(AvahiWideAreaLookupEngine *e, uint16_t i
+     return l;
+ }
+ 
++static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent events, void *userdata);
++
+ static int send_to_dns_server(AvahiWideAreaLookup *l, AvahiDnsPacket *p) {
++    AvahiWideAreaLookupEngine *e;
+     AvahiAddress *a;
++    AvahiServer *s;
++    AvahiWatch *w;
++    int r;
+ 
+     assert(l);
+     assert(p);
+ 
+-    if (l->engine->n_dns_servers <= 0)
++    e = l->engine;
++    assert(e);
++
++    s = e->server;
++    assert(s);
++
++    if (e->n_dns_servers <= 0)
+         return -1;
+ 
+-    assert(l->engine->current_dns_server < l->engine->n_dns_servers);
++    assert(e->current_dns_server < e->n_dns_servers);
+ 
+-    a = &l->engine->dns_servers[l->engine->current_dns_server];
++    a = &e->dns_servers[e->current_dns_server];
+     l->dns_server_used = *a;
+ 
+-    if (a->proto == AVAHI_PROTO_INET) {
++    if (l->fd >= 0) {
++        /* We are reusing lookup object and sending packet to another server so let's cleanup before we establish connection to new server. */
++        s->poll_api->watch_free(l->watch);
++        l->watch = NULL;
+ 
+-        if (l->engine->fd_ipv4 < 0)
+-            return -1;
+-
+-        return avahi_send_dns_packet_ipv4(l->engine->fd_ipv4, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv4, AVAHI_DNS_PORT);
+-
+-    } else {
+-        assert(a->proto == AVAHI_PROTO_INET6);
+-
+-        if (l->engine->fd_ipv6 < 0)
+-            return -1;
+-
+-        return avahi_send_dns_packet_ipv6(l->engine->fd_ipv6, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv6, AVAHI_DNS_PORT);
++        close(l->fd);
++        l->fd = -EBADF;
+     }
++
++    assert(a->proto == AVAHI_PROTO_INET || a->proto == AVAHI_PROTO_INET6);
++
++    if (a->proto == AVAHI_PROTO_INET)
++        r = s->config.use_ipv4 ? avahi_open_unicast_socket_ipv4() : -1;
++    else
++        r = s->config.use_ipv6 ? avahi_open_unicast_socket_ipv6() : -1;
++
++    if (r < 0) {
++        avahi_log_error(__FILE__ ": Failed to create socket for wide area lookup");
++        return -1;
++    }
++
++    w = s->poll_api->watch_new(s->poll_api, r, AVAHI_WATCH_IN, socket_event, l);
++    if (!w) {
++        close(r);
++        avahi_log_error(__FILE__ ": Failed to create socket watch for wide area lookup");
++        return -1;
++    }
++
++    l->fd = r;
++    l->watch = w;
++    l->proto = a->proto;
++
++    return a->proto == AVAHI_PROTO_INET ?
++                avahi_send_dns_packet_ipv4(l->fd, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv4, AVAHI_DNS_PORT):
++                avahi_send_dns_packet_ipv6(l->fd, AVAHI_IF_UNSPEC, p, NULL, &a->data.ipv6, AVAHI_DNS_PORT);
+ }
+ 
+ static void next_dns_server(AvahiWideAreaLookupEngine *e) {
+@@ -246,6 +279,9 @@ AvahiWideAreaLookup *avahi_wide_area_lookup_new(
+     l->dead = 0;
+     l->key = avahi_key_ref(key);
+     l->cname_key = avahi_key_new_cname(l->key);
++    l->fd = -EBADF;
++    l->watch = NULL;
++    l->proto = AVAHI_PROTO_UNSPEC;
+     l->callback = callback;
+     l->userdata = userdata;
+ 
+@@ -314,6 +350,12 @@ static void lookup_destroy(AvahiWideAreaLookup *l) {
+     if (l->cname_key)
+         avahi_key_unref(l->cname_key);
+ 
++    if (l->watch)
++            l->engine->server->poll_api->watch_free(l->watch);
++
++    if (l->fd >= 0)
++        close(l->fd);
++
+     avahi_free(l);
+ }
+ 
+@@ -572,14 +614,20 @@ finish:
+ }
+ 
+ static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent events, void *userdata) {
+-    AvahiWideAreaLookupEngine *e = userdata;
++    AvahiWideAreaLookup *l = userdata;
++    AvahiWideAreaLookupEngine *e = l->engine;
+     AvahiDnsPacket *p = NULL;
+ 
+-    if (fd == e->fd_ipv4)
+-        p = avahi_recv_dns_packet_ipv4(e->fd_ipv4, NULL, NULL, NULL, NULL, NULL);
++    assert(l);
++    assert(e);
++    assert(l->fd == fd);
++
++    if (l->proto == AVAHI_PROTO_INET)
++        p = avahi_recv_dns_packet_ipv4(l->fd, NULL, NULL, NULL, NULL, NULL);
+     else {
+-        assert(fd == e->fd_ipv6);
+-        p = avahi_recv_dns_packet_ipv6(e->fd_ipv6, NULL, NULL, NULL, NULL, NULL);
++        assert(l->proto == AVAHI_PROTO_INET6);
++
++        p = avahi_recv_dns_packet_ipv6(l->fd, NULL, NULL, NULL, NULL, NULL);
+     }
+ 
+     if (p) {
+@@ -598,32 +646,6 @@ AvahiWideAreaLookupEngine *avahi_wide_area_engine_new(AvahiServer *s) {
+     e->server = s;
+     e->cleanup_dead = 0;
+ 
+-    /* Create sockets */
+-    e->fd_ipv4 = s->config.use_ipv4 ? avahi_open_unicast_socket_ipv4() : -1;
+-    e->fd_ipv6 = s->config.use_ipv6 ? avahi_open_unicast_socket_ipv6() : -1;
+-
+-    if (e->fd_ipv4 < 0 && e->fd_ipv6 < 0) {
+-        avahi_log_error(__FILE__": Failed to create wide area sockets: %s", strerror(errno));
+-
+-        if (e->fd_ipv6 >= 0)
+-            close(e->fd_ipv6);
+-
+-        if (e->fd_ipv4 >= 0)
+-            close(e->fd_ipv4);
+-
+-        avahi_free(e);
+-        return NULL;
+-    }
+-
+-    /* Create watches */
+-
+-    e->watch_ipv4 = e->watch_ipv6 = NULL;
+-
+-    if (e->fd_ipv4 >= 0)
+-        e->watch_ipv4 = s->poll_api->watch_new(e->server->poll_api, e->fd_ipv4, AVAHI_WATCH_IN, socket_event, e);
+-    if (e->fd_ipv6 >= 0)
+-        e->watch_ipv6 = s->poll_api->watch_new(e->server->poll_api, e->fd_ipv6, AVAHI_WATCH_IN, socket_event, e);
+-
+     e->n_dns_servers = e->current_dns_server = 0;
+ 
+     /* Initialize cache */
+@@ -651,18 +673,6 @@ void avahi_wide_area_engine_free(AvahiWideAreaLookupEngine *e) {
+     avahi_hashmap_free(e->lookups_by_id);
+     avahi_hashmap_free(e->lookups_by_key);
+ 
+-    if (e->watch_ipv4)
+-        e->server->poll_api->watch_free(e->watch_ipv4);
+-
+-    if (e->watch_ipv6)
+-        e->server->poll_api->watch_free(e->watch_ipv6);
+-
+-    if (e->fd_ipv6 >= 0)
+-        close(e->fd_ipv6);
+-
+-    if (e->fd_ipv4 >= 0)
+-        close(e->fd_ipv4);
+-
+     avahi_free(e);
+ }
+ 
+@@ -680,7 +690,7 @@ void avahi_wide_area_set_servers(AvahiWideAreaLookupEngine *e, const AvahiAddres
+ 
+     if (a) {
+         for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_WIDE_AREA_SERVERS_MAX; a++, n--)
+-            if ((a->proto == AVAHI_PROTO_INET && e->fd_ipv4 >= 0) || (a->proto == AVAHI_PROTO_INET6 && e->fd_ipv6 >= 0))
++            if (a->proto == AVAHI_PROTO_INET || a->proto == AVAHI_PROTO_INET6)
+                 e->dns_servers[e->n_dns_servers++] = *a;
+     } else {
+         assert(n == 0);


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-dns/avahi/, net-dns/avahi/files/
@ 2025-08-28 19:51 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2025-08-28 19:51 UTC (permalink / raw
  To: gentoo-commits

commit:     cc43a8e0b6cdf35dec9a0e992d68eed8e4c71c54
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 27 15:08:24 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Aug 28 19:50:22 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc43a8e0

net-dns/avahi: Use patch to port to Qt6 (IUSE qt5 -> qt6)

Bug: https://bugs.gentoo.org/961804
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 net-dns/avahi/avahi-0.9_rc2-r3.ebuild       | 207 ++++++++++++++++++
 net-dns/avahi/files/avahi-0.9_rc2-qt6.patch | 318 ++++++++++++++++++++++++++++
 2 files changed, 525 insertions(+)

diff --git a/net-dns/avahi/avahi-0.9_rc2-r3.ebuild b/net-dns/avahi/avahi-0.9_rc2-r3.ebuild
new file mode 100644
index 000000000000..cfd149d8d131
--- /dev/null
+++ b/net-dns/avahi/avahi-0.9_rc2-r3.ebuild
@@ -0,0 +1,207 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..13} )
+PYTHON_REQ_USE="gdbm"
+inherit autotools multilib-minimal python-single-r1 systemd
+
+DESCRIPTION="System which facilitates service discovery on a local network"
+HOMEPAGE="https://avahi.org/"
+SRC_URI="https://github.com/lathiat/avahi/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="autoipd bookmarks +dbus doc gdbm gtk howl-compat +introspection ipv6 mdnsresponder-compat nls python qt6 selinux systemd test"
+
+REQUIRED_USE="
+	python? ( dbus gdbm ${PYTHON_REQUIRED_USE} )
+	bookmarks? ( python )
+	howl-compat? ( dbus )
+	mdnsresponder-compat? ( dbus )
+	systemd? ( dbus )
+"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="
+	dev-libs/libdaemon
+	dev-libs/libevent:=[${MULTILIB_USEDEP}]
+	dev-libs/expat
+	dev-libs/glib:2[${MULTILIB_USEDEP}]
+	gdbm? ( sys-libs/gdbm:=[${MULTILIB_USEDEP}] )
+	qt6? ( dev-qt/qtbase:6 )
+	gtk?  ( x11-libs/gtk+:3[${MULTILIB_USEDEP}] )
+	dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+	kernel_linux? ( sys-libs/libcap )
+	introspection? ( dev-libs/gobject-introspection:= )
+	systemd? ( sys-apps/systemd:=[${MULTILIB_USEDEP}] )
+	python? (
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep '
+			bookmarks? ( >=dev-python/twisted-16.0.0[${PYTHON_USEDEP}] )
+			dbus? ( dev-python/dbus-python[${PYTHON_USEDEP}] )
+			introspection? ( dev-python/pygobject:3[${PYTHON_USEDEP}] )
+		')
+	)
+"
+RDEPEND="
+	acct-user/avahi
+	acct-group/avahi
+	acct-group/netdev
+	autoipd? (
+		acct-user/avahi-autoipd
+		acct-group/avahi-autoipd
+	)
+	${DEPEND}
+	selinux? ( sec-policy/selinux-avahi )
+"
+BDEPEND="
+	dev-util/glib-utils
+	doc? ( app-text/doxygen )
+	app-text/xmltoman
+	sys-devel/gettext
+	virtual/pkgconfig
+"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/avahi-qt6/qt-watch.h )
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.9_rc1-disable-avahi-ui-sharp.patch" # bug 769062
+	"${FILESDIR}/${P}-CVE-2024-52615.patch"
+	"${FILESDIR}/${P}-glibc-2.42.patch"
+	"${FILESDIR}/${P}-qt6.patch" # bug 961804
+)
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	if ! use ipv6; then
+		sed -i \
+			-e "s/use-ipv6=yes/use-ipv6=no/" \
+			avahi-daemon/avahi-daemon.conf || die
+	fi
+
+	sed -i \
+		-e "s:\\.\\./\\.\\./\\.\\./doc/avahi-docs/html/:../../../doc/${PF}/html/:" \
+		doxygen_to_devhelp.xsl || die
+
+	eautoreconf
+
+	# bundled manpages
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	local myconf=(
+		--disable-gtk
+		--disable-mono
+		--disable-monodoc
+		--disable-python-dbus
+		--disable-qt3
+		--disable-qt4
+		--disable-qt5
+		--disable-static
+		--enable-manpages
+		--enable-glib
+		--enable-gobject
+		--enable-xmltoman
+		--localstatedir="${EPREFIX}/var"
+		--runstatedir="${EPREFIX}/run"
+		--with-distro=gentoo
+		--with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+		$(use_enable dbus)
+		$(use_enable gdbm)
+		$(use_enable gtk gtk3)
+		$(use_enable howl-compat compat-howl)
+		$(use_enable mdnsresponder-compat compat-libdns_sd)
+		$(use_enable nls)
+		$(use_enable systemd libsystemd)
+		$(multilib_native_use_enable autoipd)
+		$(multilib_native_use_enable doc doxygen-doc)
+		$(multilib_native_use_enable introspection)
+		$(multilib_native_use_enable python)
+		$(multilib_native_use_enable test tests)
+	)
+
+	if use python; then
+		myconf+=(
+			$(multilib_native_use_enable dbus python-dbus)
+			$(multilib_native_use_enable introspection pygobject)
+		)
+	fi
+
+	if ! multilib_is_native_abi; then
+		myconf+=(
+			# used by daemons only
+			--disable-libdaemon
+			--with-xml=none
+		)
+	fi
+
+	myconf+=( $(multilib_native_use_enable qt6) )
+
+	econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+	emake
+
+	multilib_is_native_abi && use doc && emake avahi.devhelp
+}
+
+multilib_src_install() {
+	emake install DESTDIR="${D}"
+
+	if ! use bookmarks || ! use python || ! use dbus; then
+		rm -f "${ED}"/usr/bin/avahi-bookmarks || die
+	fi
+
+	# https://github.com/lathiat/avahi/issues/28
+	use howl-compat && dosym avahi-compat-howl.pc /usr/$(get_libdir)/pkgconfig/howl.pc
+	use mdnsresponder-compat && dosym avahi-compat-libdns_sd/dns_sd.h /usr/include/dns_sd.h
+
+	if multilib_is_native_abi && use doc; then
+		docinto html
+		dodoc -r doxygen/html/.
+		insinto /usr/share/devhelp/books/avahi
+		doins avahi.devhelp
+	fi
+
+	# The build system creates an empty "/run" directory, so we clean it up here
+	rmdir "${ED}"/run || die
+}
+
+multilib_src_install_all() {
+	use python && python_optimize
+
+	if use autoipd; then
+		insinto /lib/rcscripts/net
+		doins "${FILESDIR}"/autoipd.sh
+
+		insinto /lib/netifrc/net
+		newins "${FILESDIR}"/autoipd-openrc.sh autoipd.sh
+	fi
+
+	dodoc docs/{AUTHORS,NEWS,README,TODO}
+
+	find "${ED}" -name '*.la' -type f -delete || die
+}
+
+pkg_postinst() {
+	if use autoipd; then
+		elog
+		elog "To use avahi-autoipd to configure your interfaces with IPv4LL (RFC3927)"
+		elog "addresses, just set config_<interface>=( autoipd ) in /etc/conf.d/net!"
+		elog
+	fi
+
+	systemd_reenable avahi-daemon.service
+}

diff --git a/net-dns/avahi/files/avahi-0.9_rc2-qt6.patch b/net-dns/avahi/files/avahi-0.9_rc2-qt6.patch
new file mode 100644
index 000000000000..fdff594fd3d3
--- /dev/null
+++ b/net-dns/avahi/files/avahi-0.9_rc2-qt6.patch
@@ -0,0 +1,318 @@
+From: https://github.com/avahi/avahi/pull/704
+
+From fdc30aff1e72ba22aff11e2d9c0ab486ba63d1a6 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <antonio.larrosa@gmail.com>
+Date: Fri, 30 May 2025 11:42:02 +0200
+Subject: [PATCH] Enable building with Qt6
+
+---
+ Makefile.am           | 10 ++++++++
+ acinclude.m4          |  2 +-
+ avahi-qt/Makefile.am  | 22 +++++++++++++++++
+ avahi-qt/qt-watch.cpp | 10 ++++----
+ avahi-qt6.pc.in       | 11 +++++++++
+ common/qt-pie.m4      | 55 +++++++++++++++++++++++++++++++++++++++++++
+ common/qt5-pie.m4     | 27 ---------------------
+ configure.ac          | 31 +++++++++++++++++++++++-
+ 8 files changed, 135 insertions(+), 33 deletions(-)
+ create mode 100644 avahi-qt6.pc.in
+ create mode 100644 common/qt-pie.m4
+ delete mode 100644 common/qt5-pie.m4
+
+diff --git a/Makefile.am b/Makefile.am
+index 352cdcf25..3df371ad3 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -45,6 +45,7 @@ EXTRA_DIST = \
+ 	avahi-qt3.pc.in \
+ 	avahi-qt4.pc.in \
+ 	avahi-qt5.pc.in \
++	avahi-qt6.pc.in \
+ 	avahi-sharp.pc.in \
+ 	avahi-ui-sharp.pc.in \
+ 	avahi-compat-libdns_sd.pc.in \
+@@ -108,6 +109,10 @@ if HAVE_QT5
+ DX_INPUT += \
+ 	$(srcdir)/avahi-qt/qt-watch.h
+ endif
++if HAVE_QT6
++DX_INPUT += \
++	$(srcdir)/avahi-qt/qt-watch.h
++endif
+ endif
+ 
+ if HAVE_GLIB
+@@ -236,6 +241,11 @@ pkgconfig_DATA += avahi-qt5.pc
+ CLEANFILES += avahi-qt5.pc
+ endif
+ 
++if HAVE_QT6
++pkgconfig_DATA += avahi-qt6.pc
++CLEANFILES += avahi-qt6.pc
++endif
++
+ if HAVE_LIBEVENT
+ pkgconfig_DATA += avahi-libevent.pc
+ CLEANFILES += avahi-libevent.pc
+diff --git a/acinclude.m4 b/acinclude.m4
+index ccf2ac616..ac922456e 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1,2 +1,2 @@
+ sinclude(common/doxygen.m4)
+-sincldue(common/qt5-pie.m4)
++sincldue(common/qt-pie.m4)
+diff --git a/avahi-qt/Makefile.am b/avahi-qt/Makefile.am
+index b404810f7..78069b56c 100644
+--- a/avahi-qt/Makefile.am
++++ b/avahi-qt/Makefile.am
+@@ -87,4 +87,26 @@ libavahi_qt5_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT5_LI
+ libavahi_qt5_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBAVAHI_QT5_VERSION_INFO)
+ endif
+ 
++if HAVE_QT6
++
++avahiqt6includedir=$(includedir)/avahi-qt6
++avahiqt6include_HEADERS = \
++	qt-watch.h
++
++lib_LTLIBRARIES += \
++	libavahi-qt6.la
++
++BUILT_SOURCES += qt-watch.moc6
++
++libavahi_qt6_la_SOURCES = \
++	qt-watch.cpp
++
++qt-watch.moc6: qt-watch.cpp
++	$(AM_V_GEN)$(MOC_QT6) $^ > $@
++
++libavahi_qt6_la_CPPFLAGS = $(AM_CFLAGS) --std=gnu++17 $(QT6_CFLAGS) -DQT6 $(VISIBILITY_HIDDEN_CFLAGS)
++libavahi_qt6_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT6_LIBS)
++libavahi_qt6_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBAVAHI_QT6_VERSION_INFO)
++endif
++
+ CLEANFILES = $(BUILT_SOURCES)
+diff --git a/avahi-qt/qt-watch.cpp b/avahi-qt/qt-watch.cpp
+index 14e0c6e6a..cd18bee3d 100644
+--- a/avahi-qt/qt-watch.cpp
++++ b/avahi-qt/qt-watch.cpp
+@@ -18,7 +18,7 @@
+ ***/
+ 
+ #include <sys/time.h>
+-#if defined(QT5) || defined(QT4)
++#if defined(QT6) || defined(QT5) || defined(QT4)
+ #include <QSocketNotifier>
+ #include <QObject>
+ #include <QTimer>
+@@ -114,7 +114,7 @@ AvahiTimeout::AvahiTimeout(const struct timeval* tv, AvahiTimeoutCallback callba
+     m_callback(callback), m_userdata(userdata)
+ {
+     connect(&m_timer, SIGNAL(timeout()), this, SLOT(timeout()));
+-#if defined(QT5) || defined(QT4)
++#if defined(QT6) || defined(QT5) || defined(QT4)
+     m_timer.setSingleShot(true);
+ #endif
+     update(tv);
+@@ -125,7 +125,7 @@ void AvahiTimeout::update(const struct timeval *tv)
+     m_timer.stop();
+     if (tv) {
+     AvahiUsec u = avahi_age(tv)/1000;
+-#if defined(QT5) || defined(QT4)
++#if defined(QT6) || defined(QT5) || defined(QT4)
+     m_timer.start( (u>0) ? 0 : -u);
+ #else
+     m_timer.start( (u>0) ? 0 : -u,true);
+@@ -191,7 +191,9 @@ const AvahiPoll* avahi_qt_poll_get(void)
+     return &qt_poll;
+ }
+ 
+-#if defined(QT5)
++#if defined(QT6)
++#include "qt-watch.moc6"
++#elif defined(QT5)
+ #include "qt-watch.moc5"
+ #elif defined(QT4)
+ #include "qt-watch.moc4"
+diff --git a/avahi-qt6.pc.in b/avahi-qt6.pc.in
+new file mode 100644
+index 000000000..ce9f13758
+--- /dev/null
++++ b/avahi-qt6.pc.in
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=${prefix}
++libdir=@libdir@
++includedir=${prefix}/include
++
++Name: avahi-qt6
++Description: Avahi Multicast DNS Responder (QT6 Support)
++Version: @PACKAGE_VERSION@
++Requires: Qt6Core >= 6.0.0
++Libs: -L${libdir} -lavahi-qt6
++Cflags: -D_REENTRANT -I${includedir}
+diff --git a/common/qt-pie.m4 b/common/qt-pie.m4
+new file mode 100644
+index 000000000..8f35e548b
+--- /dev/null
++++ b/common/qt-pie.m4
+@@ -0,0 +1,55 @@
++AC_DEFUN([AC_AVAHI_QT5_ADD_PIC_IF_NEEDED],
++[
++    AC_LANG_PUSH([C++])
++	save_CPPFLAGS="$CPPFLAGS"
++	CPPFLAGS="$CPPFLAGS $QT5_CFLAGS"
++	AC_MSG_CHECKING([whether Qt works without -fPIC])
++	AC_PREPROC_IFELSE(
++		[AC_LANG_SOURCE([[#include <QtCore>]])],
++		[AC_MSG_RESULT(yes)],
++		[
++			AC_MSG_RESULT(no)
++			AC_MSG_CHECKING([whether Qt works with -fPIC])
++			CPPFLAGS="$CPPFLAGS -fPIC"
++			AC_PREPROC_IFELSE(
++				[AC_LANG_SOURCE([[#include <QtCore>]])],
++				[
++					AC_MSG_RESULT(yes)
++					QT5_CFLAGS="$QT5_CFLAGS -fPIC"
++				],
++				[
++					AC_MSG_RESULT(no)
++					AC_MSG_ERROR(Couldn't compile Qt without -fPIC nor with -fPIC)
++				])
++		])
++	CPPFLAGS="$save_CPPFLAGS"
++    AC_LANG_POP([C++])
++])
++
++AC_DEFUN([AC_AVAHI_QT6_ADD_PIC_IF_NEEDED],
++[
++    AC_LANG_PUSH([C++])
++	save_CPPFLAGS="$CPPFLAGS"
++	CPPFLAGS="$CPPFLAGS $QT6_CFLAGS"
++	AC_MSG_CHECKING([whether Qt works without -fPIC])
++	AC_PREPROC_IFELSE(
++		[AC_LANG_SOURCE([[#include <QtCore>]])],
++		[AC_MSG_RESULT(yes)],
++		[
++			AC_MSG_RESULT(no)
++			AC_MSG_CHECKING([whether Qt works with -fPIC])
++			CPPFLAGS="$CPPFLAGS -fPIC"
++			AC_PREPROC_IFELSE(
++				[AC_LANG_SOURCE([[#include <QtCore>]])],
++				[
++					AC_MSG_RESULT(yes)
++					QT6_CFLAGS="$QT6_CFLAGS -fPIC"
++				],
++				[
++					AC_MSG_RESULT(no)
++					AC_MSG_ERROR(Couldn't compile Qt without -fPIC nor with -fPIC)
++				])
++		])
++	CPPFLAGS="$save_CPPFLAGS"
++    AC_LANG_POP([C++])
++])
+diff --git a/common/qt5-pie.m4 b/common/qt5-pie.m4
+deleted file mode 100644
+index 10d564c8f..000000000
+--- a/common/qt5-pie.m4
++++ /dev/null
+@@ -1,27 +0,0 @@
+-AC_DEFUN([AC_AVAHI_QT_ADD_PIC_IF_NEEDED],
+-[
+-    AC_LANG_PUSH([C++])
+-	save_CPPFLAGS="$CPPFLAGS"
+-	CPPFLAGS="$CPPFLAGS $QT5_CFLAGS"
+-	AC_MSG_CHECKING([whether Qt works without -fPIC])
+-	AC_PREPROC_IFELSE(
+-		[AC_LANG_SOURCE([[#include <QtCore>]])],
+-		[AC_MSG_RESULT(yes)],
+-		[
+-			AC_MSG_RESULT(no)
+-			AC_MSG_CHECKING([whether Qt works with -fPIC])
+-			CPPFLAGS="$CPPFLAGS -fPIC"
+-			AC_PREPROC_IFELSE(
+-				[AC_LANG_SOURCE([[#include <QtCore>]])],
+-				[
+-					AC_MSG_RESULT(yes)
+-					QT5_CFLAGS="$QT5_CFLAGS -fPIC"
+-				],
+-				[
+-					AC_MSG_RESULT(no)
+-					AC_MSG_ERROR(Couldn't compile Qt without -fPIC nor with -fPIC)
+-				])
+-		])
+-	CPPFLAGS="$save_CPPFLAGS"
+-    AC_LANG_POP([C++])
+-])
+diff --git a/configure.ac b/configure.ac
+index 31bce3d76..5959df14e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -36,6 +36,7 @@ AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:5:0])
+ AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:2:0])
+ AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:2:0])
+ AC_SUBST(LIBAVAHI_QT5_VERSION_INFO, [1:2:0])
++AC_SUBST(LIBAVAHI_QT6_VERSION_INFO, [1:2:0])
+ AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [1:4:1])
+ 
+ # Do not touch these, since they we took this version-info from upstream HOWL/Bonjour
+@@ -557,7 +558,7 @@ AC_ARG_ENABLE(qt5,
+ 
+ if test "x$HAVE_QT5" = "xyes" ; then
+         PKG_CHECK_MODULES( QT5, [ Qt5Core >= 5.0.0 ])
+-        AC_AVAHI_QT_ADD_PIC_IF_NEEDED
++        AC_AVAHI_QT5_ADD_PIC_IF_NEEDED
+         AC_SUBST(QT5_CFLAGS)
+         AC_SUBST(QT5_LIBS)
+         QT5_PREFIX="`$PKG_CONFIG --variable=host_bins Qt5Core`"
+@@ -569,6 +570,32 @@ if test "x$HAVE_QT5" = "xyes" ; then
+ fi
+ AM_CONDITIONAL(HAVE_QT5, test "x$HAVE_QT5" = "xyes")
+ 
++#
++# Check for Qt 6
++#
++AC_ARG_ENABLE(qt6,
++        AS_HELP_STRING([--disable-qt6],[Disable building of Qt6Core mainloop integration]),
++        [case "${enableval}" in
++                yes) HAVE_QT6=yes ;;
++                no)  HAVE_QT6=no ;;
++                *) AC_MSG_ERROR(bad value ${enableval} for --enable-qt6) ;;
++        esac],
++        [HAVE_QT6=yes])
++
++if test "x$HAVE_QT6" = "xyes" ; then
++        PKG_CHECK_MODULES( QT6, [ Qt6Core >= 6.0.0 ])
++        AC_AVAHI_QT6_ADD_PIC_IF_NEEDED
++        AC_SUBST(QT6_CFLAGS)
++        AC_SUBST(QT6_LIBS)
++        QT6_PREFIX="`$PKG_CONFIG --variable=libexecdir Qt6Core`"
++        AC_PATH_PROGS(MOC_QT6, [moc-qt6 moc], no, [$QT6_PREFIX])
++        if test "$MOC_QT6" = no; then
++            AC_MSG_ERROR([Could not find QT6 moc])
++        fi
++        AC_SUBST(MOC_QT6)
++fi
++AM_CONDITIONAL(HAVE_QT6, test "x$HAVE_QT6" = "xyes")
++
+ #
+ # Check for GTK+ 2.0
+ #
+@@ -1222,6 +1249,7 @@ echo "
+     Enable QT3:                                ${HAVE_QT3}
+     Enable QT4:                                ${HAVE_QT4}
+     Enable QT5:                                ${HAVE_QT5}
++    Enable QT6:                                ${HAVE_QT6}
+     Enable Mono:                               ${HAVE_MONO}
+     Enable Monodoc:                            ${HAVE_MONODOC}
+     Distribution/OS:                           ${with_distro}
+@@ -1292,6 +1320,7 @@ echo "\
+     Building libavahi-qt3:              ${HAVE_QT3}
+     Building libavahi-qt4:              ${HAVE_QT4}
+     Building libavahi-qt5:              ${HAVE_QT5}
++    Building libavahi-qt6:              ${HAVE_QT6}
+     Building avahi-sharp:               ${HAVE_MONO}
+     Building avahi-compat-libdns_sd:    ${ENABLE_COMPAT_LIBDNS_SD}
+     Building avahi-compat-howl:         ${ENABLE_COMPAT_HOWL}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-28 19:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 19:51 [gentoo-commits] repo/gentoo:master commit in: net-dns/avahi/, net-dns/avahi/files/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2025-06-26 19:50 Patrick McLean
2022-08-18 13:27 Anthony G. Basile
2019-11-09 16:44 Anthony G. Basile
2016-09-22  1:18 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox