From 7c1f5a1f4a79f5d2239904dab2689d515ba9d6ad Mon Sep 17 00:00:00 2001 From: Jakov Smolic Date: Thu, 26 Nov 2020 11:32:36 +0100 Subject: x11-plugins/gkwebmon: fix build with gcc-10 Closes: https://bugs.gentoo.org/707226 Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Jakov Smolic Signed-off-by: David Seifert --- .../files/gkwebmon-0.2-cc-cflags-ldflags.patch | 48 ++++++++++++++++++++++ .../gkwebmon/files/gkwebmon-0.2-fno-common.patch | 38 +++++++++++++++++ .../gkwebmon/files/respect-cc-cflags-ldflags.patch | 48 ---------------------- x11-plugins/gkwebmon/gkwebmon-0.2-r2.ebuild | 6 ++- 4 files changed, 90 insertions(+), 50 deletions(-) create mode 100644 x11-plugins/gkwebmon/files/gkwebmon-0.2-cc-cflags-ldflags.patch create mode 100644 x11-plugins/gkwebmon/files/gkwebmon-0.2-fno-common.patch delete mode 100644 x11-plugins/gkwebmon/files/respect-cc-cflags-ldflags.patch (limited to 'x11-plugins') diff --git a/x11-plugins/gkwebmon/files/gkwebmon-0.2-cc-cflags-ldflags.patch b/x11-plugins/gkwebmon/files/gkwebmon-0.2-cc-cflags-ldflags.patch new file mode 100644 index 000000000000..7b3ee50f5321 --- /dev/null +++ b/x11-plugins/gkwebmon/files/gkwebmon-0.2-cc-cflags-ldflags.patch @@ -0,0 +1,48 @@ +From ef7dcbf8495d03c8cf96d4fb30adf38b15e1ca74 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky +Date: Mon, 29 Aug 2016 20:44:45 -0400 +Subject: [PATCH 1/1] Clean up variable usage in Makefile to support LDFLAGS + and friends. + +--- + Makefile | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +diff --git a/Makefile b/Makefile +index b422e79..d89977f 100644 +--- a/Makefile ++++ b/Makefile +@@ -3,23 +3,19 @@ + + PLUGIN_DIR = /usr/local/lib/gkrellm2/plugins + +-GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags` +-GTK_LIB = `pkg-config gtk+-2.0 --libs` ++GTK_INCLUDE = $(shell pkg-config gtk+-2.0 --cflags) ++GTK_LIB = $(shell pkg-config gtk+-2.0 --libs) + + +-#FLAGS = -O2 -Wall -fPIC -std=c99 -pedantic $(GTK_INCLUDE) +-FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) +-LIBS = $(GTK_LIB) +- +-LFLAGS = -shared -lssl -lpthread +- +-CC = gcc $(CFLAGS) $(FLAGS) +-#CC = gcc -DDEBUG $(CFLAGS) $(FLAGS) ++CFLAGS += -Wall -fPIC ++CPPFLAGS += $(GTK_INCLUDE) ++LDLIBS += $(GTK_LIB) -lssl -lpthread ++LDFLAGS += -shared + + OBJS = webmon.o gk.o + + gkwebmon.so: $(OBJS) +- $(CC) $(OBJS) -o gkwebmon.so $(LFLAGS) $(LIBS) ++ $(CC) $(OBJS) -o $(@) $(LDFLAGS) $(LDLIBS) + + install: gkwebmon.so + install gkwebmon.so $(PLUGIN_DIR) +-- +2.7.3 + diff --git a/x11-plugins/gkwebmon/files/gkwebmon-0.2-fno-common.patch b/x11-plugins/gkwebmon/files/gkwebmon-0.2-fno-common.patch new file mode 100644 index 000000000000..9738177db6fe --- /dev/null +++ b/x11-plugins/gkwebmon/files/gkwebmon-0.2-fno-common.patch @@ -0,0 +1,38 @@ +--- a/webmon.c ++++ b/webmon.c +@@ -7,6 +7,8 @@ + #include + #include + ++int updatetime; ++ + + void clear_entry(int i) + { +--- a/webmon.h ++++ b/webmon.h +@@ -6,7 +6,7 @@ + + /* this is included in the saved config file */ + +-int updatetime; /* how often to check webpages (in hours) */ ++extern int updatetime; /* how often to check webpages (in hours) */ + + struct webinfo { + char *urlData; /* full url, pointed into by pointers below, internal '\0' */ +@@ -21,11 +21,13 @@ struct webinfo { + char use; + char updated; /* new md5 checksum in place */ + char flagged; /* a changed has been posted to tooltips for this entry */ +-} wi[20]; ++}; ++ ++extern struct webinfo wi[20]; + + /* end of data for config file */ + +-char wheretostore; /* 0 == webinfo.init_md5, 1 == webinfo.new_md5 */ ++extern char wheretostore; /* 0 == webinfo.init_md5, 1 == webinfo.new_md5 */ + + void parse_url_to_config_struct(int i, gchar *instr); /* parse URL and store data in webinfo struct */ + char *make_url_from_config_struct(int i); diff --git a/x11-plugins/gkwebmon/files/respect-cc-cflags-ldflags.patch b/x11-plugins/gkwebmon/files/respect-cc-cflags-ldflags.patch deleted file mode 100644 index 7b3ee50f5321..000000000000 --- a/x11-plugins/gkwebmon/files/respect-cc-cflags-ldflags.patch +++ /dev/null @@ -1,48 +0,0 @@ -From ef7dcbf8495d03c8cf96d4fb30adf38b15e1ca74 Mon Sep 17 00:00:00 2001 -From: Michael Orlitzky -Date: Mon, 29 Aug 2016 20:44:45 -0400 -Subject: [PATCH 1/1] Clean up variable usage in Makefile to support LDFLAGS - and friends. - ---- - Makefile | 18 +++++++----------- - 1 file changed, 7 insertions(+), 11 deletions(-) - -diff --git a/Makefile b/Makefile -index b422e79..d89977f 100644 ---- a/Makefile -+++ b/Makefile -@@ -3,23 +3,19 @@ - - PLUGIN_DIR = /usr/local/lib/gkrellm2/plugins - --GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags` --GTK_LIB = `pkg-config gtk+-2.0 --libs` -+GTK_INCLUDE = $(shell pkg-config gtk+-2.0 --cflags) -+GTK_LIB = $(shell pkg-config gtk+-2.0 --libs) - - --#FLAGS = -O2 -Wall -fPIC -std=c99 -pedantic $(GTK_INCLUDE) --FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) --LIBS = $(GTK_LIB) -- --LFLAGS = -shared -lssl -lpthread -- --CC = gcc $(CFLAGS) $(FLAGS) --#CC = gcc -DDEBUG $(CFLAGS) $(FLAGS) -+CFLAGS += -Wall -fPIC -+CPPFLAGS += $(GTK_INCLUDE) -+LDLIBS += $(GTK_LIB) -lssl -lpthread -+LDFLAGS += -shared - - OBJS = webmon.o gk.o - - gkwebmon.so: $(OBJS) -- $(CC) $(OBJS) -o gkwebmon.so $(LFLAGS) $(LIBS) -+ $(CC) $(OBJS) -o $(@) $(LDFLAGS) $(LDLIBS) - - install: gkwebmon.so - install gkwebmon.so $(PLUGIN_DIR) --- -2.7.3 - diff --git a/x11-plugins/gkwebmon/gkwebmon-0.2-r2.ebuild b/x11-plugins/gkwebmon/gkwebmon-0.2-r2.ebuild index d7fc617e9437..5a5387b6c02c 100644 --- a/x11-plugins/gkwebmon/gkwebmon-0.2-r2.ebuild +++ b/x11-plugins/gkwebmon/gkwebmon-0.2-r2.ebuild @@ -12,7 +12,6 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tgz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ppc ~sparc x86" -IUSE="" # The Makefile links with -lssl. RDEPEND=" @@ -20,7 +19,10 @@ RDEPEND=" dev-libs/openssl:0=" DEPEND="${RDEPEND}" -PATCHES=( "${FILESDIR}"/respect-cc-cflags-ldflags.patch ) +PATCHES=( + "${FILESDIR}"/${P}-cc-cflags-ldflags.patch + "${FILESDIR}"/${P}-fno-common.patch +) src_compile() { emake CC="$(tc-getCC)" -- cgit v1.2.3-65-gdbad