commit:     e432f4606c7ec51dfce00b648b76fdab8263ebd6
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun May 17 11:08:20 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun May 17 11:09:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e432f460

net-dialup/dwun: Fix building with CFLAGS=-fno-common

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Closes: https://bugs.gentoo.org/706982
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 net-dialup/dwun/dwun-0.96e-r4.ebuild              |  4 ++-
 net-dialup/dwun/files/dwun-0.96e-fno-common.patch | 41 +++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/net-dialup/dwun/dwun-0.96e-r4.ebuild 
b/net-dialup/dwun/dwun-0.96e-r4.ebuild
index fbc86601b41..aa99a75ba5e 100644
--- a/net-dialup/dwun/dwun-0.96e-r4.ebuild
+++ b/net-dialup/dwun/dwun-0.96e-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -16,6 +16,8 @@ KEYWORDS="~amd64 x86"
 DOCS=( AUTHORS ChangeLog QUICKSTART README TODO UPGRADING )
 
 src_prepare() {
+       eapply "${FILESDIR}"/${P}-fno-common.patch
+
        sed -i -e "s:TODO QUICKSTART README UPGRADING ChangeLog COPYING 
AUTHORS::" Makefile.in || die
        tc-export CC
 

diff --git a/net-dialup/dwun/files/dwun-0.96e-fno-common.patch 
b/net-dialup/dwun/files/dwun-0.96e-fno-common.patch
new file mode 100644
index 00000000000..c84c027e42d
--- /dev/null
+++ b/net-dialup/dwun/files/dwun-0.96e-fno-common.patch
@@ -0,0 +1,41 @@
+--- a/src/main.c
++++ b/src/main.c
+@@ -37,11 +37,11 @@
+ /* extern'ed in main.h */
+ struct settings set;
+ char *error_messages;
++enum MYLOG_OPTIONS MYLOG_OPTIONS = MYLOG_STDERR;
+ 
+ int main(int argc, char *argv[]) 
+ {
+       char orig_work_dir[MAXPATHLEN];
+-      MYLOG_OPTIONS = MYLOG_STDERR;
+       umask(022); /* -rw-r--r- */
+ 
+       if (!(error_messages = xmalloc(MAX_LOG_LENGTH)))
+--- a/src/shared.h
++++ b/src/shared.h
+@@ -56,10 +56,11 @@
+       char *external;                 /* named pipe (optional) */
+ };
+ 
+-enum {
++enum MYLOG_OPTIONS {
+       MYLOG_STDERR,
+       MYLOG_STDERR_DATEPID,
+       MYLOG_SYSLOG
+-} MYLOG_OPTIONS;
++};
++extern enum MYLOG_OPTIONS MYLOG_OPTIONS;
+ 
+ #endif
+--- a/src/util.c
++++ b/src/util.c
+@@ -26,6 +26,7 @@
+ #include "util.h"
+ #include "child.h"
+ #include "main.h"
++#include "shared.h"
+ 
+ static bool create_file(char *file, int options);
+ static void print_date_pid(void);

Reply via email to