summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-11-24 00:52:13 +0000
committerSam James <sam@gentoo.org>2022-11-24 00:52:13 +0000
commit6ccf1b9327a975ba069b356e3e9f1a51e39ca45d (patch)
tree98be7fcb5b35388e8efaaf0bd4b6b6b94bd5a6a7 /net-misc
parentnet-irc/znc-palaver: drop 1.2.1-r1 (diff)
downloadgentoo-6ccf1b9327a975ba069b356e3e9f1a51e39ca45d.tar.gz
gentoo-6ccf1b9327a975ba069b356e3e9f1a51e39ca45d.tar.bz2
gentoo-6ccf1b9327a975ba069b356e3e9f1a51e39ca45d.zip
net-misc/radvd: fix build w/ clang 16
Closes: https://bugs.gentoo.org/880823 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/radvd/files/radvd-2.19-clang16.patch62
-rw-r--r--net-misc/radvd/radvd-2.19-r5.ebuild74
2 files changed, 136 insertions, 0 deletions
diff --git a/net-misc/radvd/files/radvd-2.19-clang16.patch b/net-misc/radvd/files/radvd-2.19-clang16.patch
new file mode 100644
index 000000000000..793126dbcc1b
--- /dev/null
+++ b/net-misc/radvd/files/radvd-2.19-clang16.patch
@@ -0,0 +1,62 @@
+https://github.com/radvd-project/radvd/commit/f4baa88bfd77710a6034e3c23b95ef5efb80f83b
+https://bugs.gentoo.org/880823
+
+From ff7ab0cf445236f30e58531175ba912614fed952 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 17 Nov 2022 22:03:25 +0000
+Subject: [PATCH 1/2] Makefile.am: drop -Wno-implicit-function-declaration
+
+1. Clang 16 makes -Wimplicit-function-declaration error by default
+ (and it's planned that GCC 14 will do the same) so we need to fix
+ the real problem. This is papering over it.
+
+2. It's not true that there's nothing we can do about it. Fix in a follow-up
+ commit.
+
+Bug: https://bugs.gentoo.org/880823
+Fixes: b5e6b09cf914a960ac3b1676b77d3ea9f91821c7
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -66,9 +66,6 @@ radvd_LDADD = \
+ scanner.c: gram.h
+ gram.h: gram.c
+
+-libradvd_parser_a_CFLAGS = \
+- -Wno-implicit-function-declaration
+-
+ libradvd_parser_a_SOURCES = \
+ gram.h \
+ gram.y \
+
+From e0f5bcd9091a5f7abd423fce9f372c8079849a64 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 17 Nov 2022 22:03:25 +0000
+Subject: [PATCH 2/2] gram.y: Fix -Wimplicit-function-declaration
+
+Clang 16 makes -Wimplicit-function-declaration an error by default.
+
+For more information, see LWN.net [0] or LLVM's Discourse [1], the Gentoo wiki [2],
+or the (new) c-std-porting mailing list [3].
+
+[0] https://lwn.net/Articles/913505/
+[1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
+[2] https://wiki.gentoo.org/wiki/Modern_C_porting
+[3] hosted at lists.linux.dev.
+
+Bug: https://bugs.gentoo.org/880823
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/gram.y
++++ b/gram.y
+@@ -20,6 +20,10 @@
+
+ #define YYERROR_VERBOSE 1
+
++int yylex (void);
++void yyset_in (FILE * _in_str);
++int yylex_destroy (void);
++
+ #if 0 /* no longer necessary? */
+ #ifndef HAVE_IN6_ADDR_S6_ADDR
+ # ifdef __FreeBSD__
+
diff --git a/net-misc/radvd/radvd-2.19-r5.ebuild b/net-misc/radvd/radvd-2.19-r5.ebuild
new file mode 100644
index 000000000000..339fa3d60deb
--- /dev/null
+++ b/net-misc/radvd/radvd-2.19-r5.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools readme.gentoo-r1 systemd toolchain-funcs
+
+DESCRIPTION="Linux IPv6 Router Advertisement Daemon"
+HOMEPAGE="https://v6web.litech.org/radvd/"
+SRC_URI="https://v6web.litech.org/radvd/dist/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="selinux test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="
+ sys-devel/bison
+ sys-devel/flex
+ test? ( dev-libs/check )
+"
+RDEPEND="
+ acct-group/radvd
+ acct-user/radvd
+ selinux? ( sec-policy/selinux-radvd )
+"
+
+DOCS=( CHANGES README TODO radvd.conf.example )
+
+PATCHES=(
+ "${FILESDIR}"/${P}-musl-include.patch
+ "${FILESDIR}"/${P}-clang16.patch
+)
+
+src_prepare() {
+ default
+
+ # Drop once clang16 patch is in a release
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-pidfile=/run/radvd/radvd.pid \
+ --with-systemdsystemunitdir=no \
+ $(use_with test check)
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
+
+src_install() {
+ default
+
+ docinto html
+ dodoc INTRO.html
+
+ newinitd "${FILESDIR}"/${PN}-2.15.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ systemd_dounit "${FILESDIR}"/${PN}.service
+
+ readme.gentoo_create_doc
+}
+
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS="Please create a configuration file ${ROOT}/etc/radvd.conf.
+See ${ROOT}/usr/share/doc/${PF} for an example.
+
+grsecurity users should allow a specific group to read /proc
+and add the radvd user to that group, otherwise radvd may
+segfault on startup."