public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/xinetd/, sys-apps/xinetd/files/
Date: Sat, 10 Sep 2022 13:30:05 +0000 (UTC)	[thread overview]
Message-ID: <1662816594.33bd8437e8964991053c4ec1897ec015f84d577d.sam@gentoo> (raw)

commit:     33bd8437e8964991053c4ec1897ec015f84d577d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 13:06:33 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 13:29:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33bd8437

sys-apps/xinetd: fix build on musl & implicit function decls

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...configure.ac-use-AC_USE_SYSTEM_EXTENSIONS.patch | 43 +++++++++++++++
 ...rect-drop-deprecated-sys-signal.h-include.patch | 24 +++++++++
 sys-apps/xinetd/xinetd-2.3.15.4-r1.ebuild          | 62 ++++++++++++++++++++++
 3 files changed, 129 insertions(+)

diff --git a/sys-apps/xinetd/files/xinetd-2.3.15.4-0001-configure.ac-use-AC_USE_SYSTEM_EXTENSIONS.patch b/sys-apps/xinetd/files/xinetd-2.3.15.4-0001-configure.ac-use-AC_USE_SYSTEM_EXTENSIONS.patch
new file mode 100644
index 000000000000..d2be93f08607
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd-2.3.15.4-0001-configure.ac-use-AC_USE_SYSTEM_EXTENSIONS.patch
@@ -0,0 +1,43 @@
+https://github.com/openSUSE/xinetd/pull/42
+
+From 0539bd4450020c83c6b72eec1004e3ce3f64554b Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 10 Sep 2022 13:59:20 +0100
+Subject: [PATCH 1/2] configure.ac: use AC_USE_SYSTEM_EXTENSIONS
+
+We use fcvt and gcvt, both of which are extensions
+guarded by GNU_SOURCE. Use AC_USE_SYSTEM_EXTENSIONS
+to ensure they're always available.
+
+Fixes a build failure on musl with Clang 15:
+```
+src/sio/sprint.c:176:15: error: call to undeclared function 'fcvt'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+                p = (char *)fcvt( num, precision, &decimal_point, is_negative ) ;
+src/sio/sprint.c:178:15: error: call to undeclared function 'ecvt'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+                p = (char *)ecvt( num, precision+1, &decimal_point, is_negative ) ;
+```
+
+And drop a single #define _GNU_SOURCE from signals.c, as it's
+preferable to have it consistently defined across the codebase
+where possible. We have autotools, so let's use it.
+--- a/configure.ac
++++ b/configure.ac
+@@ -38,6 +38,8 @@ AC_CHECK_LIB([m], [log10], [
+ ])
+ AC_SUBST([LIBM_LIBS])
+ 
++AC_USE_SYSTEM_EXTENSIONS
++
+ # ======================================
+ # Check for various headers and settings
+ # ======================================
+--- a/src/signals.c
++++ b/src/signals.c
+@@ -7,7 +7,6 @@
+ 
+ 
+ #include "config.h"
+-#define _GNU_SOURCE
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <signal.h>

diff --git a/sys-apps/xinetd/files/xinetd-2.3.15.4-0002-redirect-drop-deprecated-sys-signal.h-include.patch b/sys-apps/xinetd/files/xinetd-2.3.15.4-0002-redirect-drop-deprecated-sys-signal.h-include.patch
new file mode 100644
index 000000000000..f53a11eba650
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd-2.3.15.4-0002-redirect-drop-deprecated-sys-signal.h-include.patch
@@ -0,0 +1,24 @@
+https://github.com/openSUSE/xinetd/pull/42
+
+From 953a37c570a42743358cfc64e00e990813db1e09 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 10 Sep 2022 14:01:00 +0100
+Subject: [PATCH 2/2] redirect: drop deprecated <sys/signal.h> include
+
+Fix warning when building on musl:
+```
+In file included from src/redirect.c:23:
+/usr/include/sys/signal.h:1:2: warning: redirecting incorrect #include <sys/signal.h> to <signal.h> [-W#warnings]
+```
+
+We already include <signal.h>.
+--- a/src/redirect.c
++++ b/src/redirect.c
+@@ -20,7 +20,6 @@
+ #include <unistd.h>
+ #include <netinet/tcp.h>
+ #include <arpa/inet.h>
+-#include <sys/signal.h>
+ 
+ #include "redirect.h"
+ #include "service.h"

diff --git a/sys-apps/xinetd/xinetd-2.3.15.4-r1.ebuild b/sys-apps/xinetd/xinetd-2.3.15.4-r1.ebuild
new file mode 100644
index 000000000000..1f81038eb7bc
--- /dev/null
+++ b/sys-apps/xinetd/xinetd-2.3.15.4-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools systemd
+
+DESCRIPTION="Powerful replacement for inetd"
+HOMEPAGE="https://github.com/xinetd-org/xinetd https://github.com/openSUSE/xinetd"
+SRC_URI="https://github.com/openSUSE/xinetd/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="perl rpc selinux tcpd"
+
+DEPEND="
+	rpc? ( net-libs/libtirpc:= )
+	selinux? ( sys-libs/libselinux )
+	tcpd? ( >=sys-apps/tcp-wrappers-7.6-r2 )
+"
+RDEPEND="
+	${DEPEND}
+	perl? ( dev-lang/perl )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.3.15.4-0001-configure.ac-use-AC_USE_SYSTEM_EXTENSIONS.patch
+	"${FILESDIR}"/${PN}-2.3.15.4-0002-redirect-drop-deprecated-sys-signal.h-include.patch
+)
+
+src_prepare() {
+	default
+
+	sed -i \
+		-e 's:/usr/bin/kill:/bin/kill:' \
+		"contrib/${PN}.service" || die
+
+	eautoreconf
+}
+
+src_configure() {
+	econf \
+		$(use_with tcpd libwrap) \
+		$(use_with selinux labeled-networking) \
+		$(use_with rpc) \
+		--with-loadavg
+}
+
+src_install() {
+	default
+
+	use perl || rm -f "${ED}"/usr/sbin/xconv.pl
+
+	newinitd "${FILESDIR}"/xinetd.rc6 xinetd
+	newconfd "${FILESDIR}"/xinetd.confd xinetd
+	systemd_dounit "contrib/${PN}.service"
+
+	newdoc contrib/xinetd.conf xinetd.conf.dist.sample
+	dodoc README.md CHANGELOG
+}


             reply	other threads:[~2022-09-10 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-10 13:30 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-05-14 22:54 [gentoo-commits] repo/gentoo:master commit in: sys-apps/xinetd/, sys-apps/xinetd/files/ David Seifert
2018-06-19  6:06 Mike Frysinger
2015-12-23 20:44 Mike Frysinger
2015-11-03 15:08 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1662816594.33bd8437e8964991053c4ec1897ec015f84d577d.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox