summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Sautier <sbraz@gentoo.org>2020-08-19 11:27:14 +0200
committerLouis Sautier <sbraz@gentoo.org>2020-08-19 12:12:44 +0200
commit1accc08d7cf84c71673452784d8cc274d7f8f5e1 (patch)
treebdbc5478db788a1426efd333fd78f864874f3faf
parentmedia-sound/scmpc: Fix building with CFLAGS=-fno-common (diff)
downloadgentoo-1accc08d7cf84c71673452784d8cc274d7f8f5e1.tar.gz
gentoo-1accc08d7cf84c71673452784d8cc274d7f8f5e1.tar.bz2
gentoo-1accc08d7cf84c71673452784d8cc274d7f8f5e1.zip
net-irc/eggdrop: respect LDFLAGS, backport array bounds warning fix
Closes: https://bugs.gentoo.org/724948 Package-Manager: Portage-3.0.3, Repoman-2.3.23 Signed-off-by: Louis Sautier <sbraz@gentoo.org>
-rw-r--r--net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild77
-rw-r--r--net-irc/eggdrop/files/eggdrop-1.8.4-fix-array-bounds-warning.patch24
-rw-r--r--net-irc/eggdrop/files/eggdrop-1.8.4-respect-ldflags.patch39
3 files changed, 140 insertions, 0 deletions
diff --git a/net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild b/net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild
new file mode 100644
index 00000000000..1ddb84ab8e1
--- /dev/null
+++ b/net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit readme.gentoo-r1
+
+DESCRIPTION="An IRC bot extensible with C or TCL"
+HOMEPAGE="https://www.eggheads.org/"
+SRC_URI="https://ftp.eggheads.org/pub/eggdrop/source/${PV:0:3}/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~sparc ~x86"
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="debug doc ipv6 ssl static"
+
+DEPEND="
+ dev-lang/tcl:0=
+ ssl? ( dev-libs/openssl:0= )
+"
+RDEPEND="
+ sys-apps/gentoo-functions
+ ${DEPEND}
+"
+
+PATCHES=(
+ # https://github.com/eggheads/eggdrop/pull/986
+ "${FILESDIR}/${P}-respect-ldflags.patch"
+ # https://github.com/eggheads/eggdrop/pull/841
+ "${FILESDIR}/${P}-fix-array-bounds-warning.patch"
+)
+
+DOCS=( AUTHORS FEATURES INSTALL NEWS README THANKS UPGRADING )
+
+src_configure() {
+ econf $(use_enable ssl tls) \
+ $(use_enable ipv6 ipv6)
+
+ emake config
+}
+
+src_compile() {
+ local target
+
+ if use static && use debug; then
+ target="sdebug"
+ elif use static; then
+ target="static"
+ elif use debug; then
+ target="debug"
+ fi
+
+ emake ${target}
+}
+
+src_install() {
+ emake DEST="${D}"/opt/eggdrop install
+
+ use doc && HTML_DOCS=( doc/html/. )
+ rm -r "${D}"/opt/eggdrop/doc/html || die
+ DOC_CONTENTS="
+ Additional documentation can be found
+ in ${EPREFIX}/opt/eggdrop/doc
+ "
+ readme.gentoo_create_doc
+ einstalldocs
+
+ dobin "${FILESDIR}"/eggdrop-installer
+ doman doc/man1/eggdrop.1
+}
+
+pkg_postinst() {
+ # Only display this for new installs
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "Please run ${EPREFIX}/usr/bin/eggdrop-installer to install your eggdrop bot."
+ fi
+}
diff --git a/net-irc/eggdrop/files/eggdrop-1.8.4-fix-array-bounds-warning.patch b/net-irc/eggdrop/files/eggdrop-1.8.4-fix-array-bounds-warning.patch
new file mode 100644
index 00000000000..7c6c2d6dae6
--- /dev/null
+++ b/net-irc/eggdrop/files/eggdrop-1.8.4-fix-array-bounds-warning.patch
@@ -0,0 +1,24 @@
+diff --git a/src/flags.c b/src/flags.c
+index 8cecd2898..3f0a7ea32 100644
+--- a/src/flags.c
++++ b/src/flags.c
+@@ -403,7 +403,10 @@ void break_down_flags(const char *string, struct flag_record *plus,
+ which = plus;
+ mode++;
+ if ((mode == 2) && !(flags & (FR_CHAN | FR_BOT)))
+- string = "";
++ goto breakout; /* string = ""; does not work here because we need to
++ break out of while() / nested switch(), see
++ "string++;" below and string = "\0"; is worse than
++ goto */
+ else if (mode == 3)
+ mode = 1;
+ break;
+@@ -447,6 +450,7 @@ void break_down_flags(const char *string, struct flag_record *plus,
+ }
+ string++;
+ }
++breakout:
+ for (which = plus; which; which = (which == plus ? minus : 0)) {
+ which->global &=USER_VALID;
+
diff --git a/net-irc/eggdrop/files/eggdrop-1.8.4-respect-ldflags.patch b/net-irc/eggdrop/files/eggdrop-1.8.4-respect-ldflags.patch
new file mode 100644
index 00000000000..e41dbd664c5
--- /dev/null
+++ b/net-irc/eggdrop/files/eggdrop-1.8.4-respect-ldflags.patch
@@ -0,0 +1,39 @@
+From 36f2df10c6c39290f6896f9ad5eb9d1419a1abe3 Mon Sep 17 00:00:00 2001
+From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com>
+Date: Tue, 26 May 2020 01:08:03 +0200
+Subject: [PATCH] Respect LDFLAGS
+
+---
+ src/Makefile.in | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 6757bbc8c..c9605a049 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -16,6 +16,7 @@ LD = @CC@
+ STRIP = @STRIP@
+ CFLAGS = @CFLAGS@ -I.. -I$(top_srcdir) @SSL_INCLUDES@ @DEFS@ $(CFLGS)
+ CPPFLAGS = @CPPFLAGS@
++LDFLAGS = @LDFLAGS@
+
+ eggdrop_objs = bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o \
+ dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o \
+@@ -41,7 +42,7 @@ linkstart:
+ touch mod/mod.xlibs
+
+ link:
+- $(LD) $(CFLAGS) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs`
++ $(LD) $(CFLAGS) $(LDFLAGS) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs`
+
+ linkfinish:
+ @$(STRIP) ../$(EGGEXEC) && \
+@@ -63,7 +64,7 @@ clean:
+ main.o:
+ $(CC) $(CFLAGS) $(CPPFLAGS) \
+ '-DCCFLAGS="$(CC) $(CFLAGS) $(CPPFLAGS)"' \
+- '-DLDFLAGS="$(LD)"' \
++ '-DLDFLAGS="$(LD) $(LDFLAGS)"' \
+ '-DSTRIPFLAGS="$(STRIP)"' -c $(srcdir)/main.c
+
+ compatibility: