1 |
commit: 1accc08d7cf84c71673452784d8cc274d7f8f5e1 |
2 |
Author: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 19 09:27:14 2020 +0000 |
4 |
Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 19 10:12:44 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1accc08d |
7 |
|
8 |
net-irc/eggdrop: respect LDFLAGS, backport array bounds warning fix |
9 |
|
10 |
Closes: https://bugs.gentoo.org/724948 |
11 |
Package-Manager: Portage-3.0.3, Repoman-2.3.23 |
12 |
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org> |
13 |
|
14 |
net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild | 77 ++++++++++++++++++++++ |
15 |
.../eggdrop-1.8.4-fix-array-bounds-warning.patch | 24 +++++++ |
16 |
.../files/eggdrop-1.8.4-respect-ldflags.patch | 39 +++++++++++ |
17 |
3 files changed, 140 insertions(+) |
18 |
|
19 |
diff --git a/net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild b/net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild |
20 |
new file mode 100644 |
21 |
index 00000000000..1ddb84ab8e1 |
22 |
--- /dev/null |
23 |
+++ b/net-irc/eggdrop/eggdrop-1.8.4-r1.ebuild |
24 |
@@ -0,0 +1,77 @@ |
25 |
+# Copyright 1999-2020 Gentoo Authors |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=7 |
29 |
+ |
30 |
+inherit readme.gentoo-r1 |
31 |
+ |
32 |
+DESCRIPTION="An IRC bot extensible with C or TCL" |
33 |
+HOMEPAGE="https://www.eggheads.org/" |
34 |
+SRC_URI="https://ftp.eggheads.org/pub/eggdrop/source/${PV:0:3}/${P}.tar.gz" |
35 |
+ |
36 |
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~sparc ~x86" |
37 |
+LICENSE="GPL-2+" |
38 |
+SLOT="0" |
39 |
+IUSE="debug doc ipv6 ssl static" |
40 |
+ |
41 |
+DEPEND=" |
42 |
+ dev-lang/tcl:0= |
43 |
+ ssl? ( dev-libs/openssl:0= ) |
44 |
+" |
45 |
+RDEPEND=" |
46 |
+ sys-apps/gentoo-functions |
47 |
+ ${DEPEND} |
48 |
+" |
49 |
+ |
50 |
+PATCHES=( |
51 |
+ # https://github.com/eggheads/eggdrop/pull/986 |
52 |
+ "${FILESDIR}/${P}-respect-ldflags.patch" |
53 |
+ # https://github.com/eggheads/eggdrop/pull/841 |
54 |
+ "${FILESDIR}/${P}-fix-array-bounds-warning.patch" |
55 |
+) |
56 |
+ |
57 |
+DOCS=( AUTHORS FEATURES INSTALL NEWS README THANKS UPGRADING ) |
58 |
+ |
59 |
+src_configure() { |
60 |
+ econf $(use_enable ssl tls) \ |
61 |
+ $(use_enable ipv6 ipv6) |
62 |
+ |
63 |
+ emake config |
64 |
+} |
65 |
+ |
66 |
+src_compile() { |
67 |
+ local target |
68 |
+ |
69 |
+ if use static && use debug; then |
70 |
+ target="sdebug" |
71 |
+ elif use static; then |
72 |
+ target="static" |
73 |
+ elif use debug; then |
74 |
+ target="debug" |
75 |
+ fi |
76 |
+ |
77 |
+ emake ${target} |
78 |
+} |
79 |
+ |
80 |
+src_install() { |
81 |
+ emake DEST="${D}"/opt/eggdrop install |
82 |
+ |
83 |
+ use doc && HTML_DOCS=( doc/html/. ) |
84 |
+ rm -r "${D}"/opt/eggdrop/doc/html || die |
85 |
+ DOC_CONTENTS=" |
86 |
+ Additional documentation can be found |
87 |
+ in ${EPREFIX}/opt/eggdrop/doc |
88 |
+ " |
89 |
+ readme.gentoo_create_doc |
90 |
+ einstalldocs |
91 |
+ |
92 |
+ dobin "${FILESDIR}"/eggdrop-installer |
93 |
+ doman doc/man1/eggdrop.1 |
94 |
+} |
95 |
+ |
96 |
+pkg_postinst() { |
97 |
+ # Only display this for new installs |
98 |
+ if [[ -z ${REPLACING_VERSIONS} ]]; then |
99 |
+ elog "Please run ${EPREFIX}/usr/bin/eggdrop-installer to install your eggdrop bot." |
100 |
+ fi |
101 |
+} |
102 |
|
103 |
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 |
104 |
new file mode 100644 |
105 |
index 00000000000..7c6c2d6dae6 |
106 |
--- /dev/null |
107 |
+++ b/net-irc/eggdrop/files/eggdrop-1.8.4-fix-array-bounds-warning.patch |
108 |
@@ -0,0 +1,24 @@ |
109 |
+diff --git a/src/flags.c b/src/flags.c |
110 |
+index 8cecd2898..3f0a7ea32 100644 |
111 |
+--- a/src/flags.c |
112 |
++++ b/src/flags.c |
113 |
+@@ -403,7 +403,10 @@ void break_down_flags(const char *string, struct flag_record *plus, |
114 |
+ which = plus; |
115 |
+ mode++; |
116 |
+ if ((mode == 2) && !(flags & (FR_CHAN | FR_BOT))) |
117 |
+- string = ""; |
118 |
++ goto breakout; /* string = ""; does not work here because we need to |
119 |
++ break out of while() / nested switch(), see |
120 |
++ "string++;" below and string = "\0"; is worse than |
121 |
++ goto */ |
122 |
+ else if (mode == 3) |
123 |
+ mode = 1; |
124 |
+ break; |
125 |
+@@ -447,6 +450,7 @@ void break_down_flags(const char *string, struct flag_record *plus, |
126 |
+ } |
127 |
+ string++; |
128 |
+ } |
129 |
++breakout: |
130 |
+ for (which = plus; which; which = (which == plus ? minus : 0)) { |
131 |
+ which->global &=USER_VALID; |
132 |
+ |
133 |
|
134 |
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 |
135 |
new file mode 100644 |
136 |
index 00000000000..e41dbd664c5 |
137 |
--- /dev/null |
138 |
+++ b/net-irc/eggdrop/files/eggdrop-1.8.4-respect-ldflags.patch |
139 |
@@ -0,0 +1,39 @@ |
140 |
+From 36f2df10c6c39290f6896f9ad5eb9d1419a1abe3 Mon Sep 17 00:00:00 2001 |
141 |
+From: Michael Ortmann <41313082+michaelortmann@××××××××××××××××××××.com> |
142 |
+Date: Tue, 26 May 2020 01:08:03 +0200 |
143 |
+Subject: [PATCH] Respect LDFLAGS |
144 |
+ |
145 |
+--- |
146 |
+ src/Makefile.in | 5 +++-- |
147 |
+ 1 file changed, 3 insertions(+), 2 deletions(-) |
148 |
+ |
149 |
+diff --git a/src/Makefile.in b/src/Makefile.in |
150 |
+index 6757bbc8c..c9605a049 100644 |
151 |
+--- a/src/Makefile.in |
152 |
++++ b/src/Makefile.in |
153 |
+@@ -16,6 +16,7 @@ LD = @CC@ |
154 |
+ STRIP = @STRIP@ |
155 |
+ CFLAGS = @CFLAGS@ -I.. -I$(top_srcdir) @SSL_INCLUDES@ @DEFS@ $(CFLGS) |
156 |
+ CPPFLAGS = @CPPFLAGS@ |
157 |
++LDFLAGS = @LDFLAGS@ |
158 |
+ |
159 |
+ eggdrop_objs = bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o \ |
160 |
+ dccutil.o dns.o flags.o language.o match.o main.o mem.o misc.o misc_file.o \ |
161 |
+@@ -41,7 +42,7 @@ linkstart: |
162 |
+ touch mod/mod.xlibs |
163 |
+ |
164 |
+ link: |
165 |
+- $(LD) $(CFLAGS) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs` |
166 |
++ $(LD) $(CFLAGS) $(LDFLAGS) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs` |
167 |
+ |
168 |
+ linkfinish: |
169 |
+ @$(STRIP) ../$(EGGEXEC) && \ |
170 |
+@@ -63,7 +64,7 @@ clean: |
171 |
+ main.o: |
172 |
+ $(CC) $(CFLAGS) $(CPPFLAGS) \ |
173 |
+ '-DCCFLAGS="$(CC) $(CFLAGS) $(CPPFLAGS)"' \ |
174 |
+- '-DLDFLAGS="$(LD)"' \ |
175 |
++ '-DLDFLAGS="$(LD) $(LDFLAGS)"' \ |
176 |
+ '-DSTRIPFLAGS="$(STRIP)"' -c $(srcdir)/main.c |
177 |
+ |
178 |
+ compatibility: |