x11-plugins/wmSMPmon: fix build with -fno-common
authorBernard Cafarelli <voyageur@gentoo.org>
Sun, 29 Mar 2020 11:35:13 +0000 (13:35 +0200)
committerBernard Cafarelli <voyageur@gentoo.org>
Sun, 29 Mar 2020 11:35:26 +0000 (13:35 +0200)
Closes: https://bugs.gentoo.org/707812
Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>
x11-plugins/wmSMPmon/files/wmSMPmon-3.1-fno-common.patch [new file with mode: 0644]
x11-plugins/wmSMPmon/wmSMPmon-3.1-r2.ebuild

diff --git a/x11-plugins/wmSMPmon/files/wmSMPmon-3.1-fno-common.patch b/x11-plugins/wmSMPmon/files/wmSMPmon-3.1-fno-common.patch
new file mode 100644 (file)
index 0000000..f1416fc
--- /dev/null
@@ -0,0 +1,36 @@
+diff -Naur wmSMPmon-3.1.orig/wmgeneral/wmgeneral.h wmSMPmon-3.1/wmgeneral/wmgeneral.h
+--- wmSMPmon-3.1.orig/wmgeneral/wmgeneral.h    1999-04-25 05:08:22.000000000 +0200
++++ wmSMPmon-3.1/wmgeneral/wmgeneral.h 2020-03-29 13:32:55.253627166 +0200
+@@ -36,7 +36,7 @@
+  /* Global variable */
+ /*******************/
+-Display               *display;
++extern Display                *display;
+   /***********************/
+  /* Function Prototypes */
+diff -Naur wmSMPmon-3.1.orig/wmSMPmon/standards.h wmSMPmon-3.1/wmSMPmon/standards.h
+--- wmSMPmon-3.1.orig/wmSMPmon/standards.h     2004-11-19 14:57:30.000000000 +0100
++++ wmSMPmon-3.1/wmSMPmon/standards.h  2020-03-29 13:32:14.666639432 +0200
+@@ -37,7 +37,7 @@
+ #define       HAUTEUR  31 /* Max. height of CPU Load Bar+Graph */
+ /* Program name used in error messages */
+-char *Myname;
++extern char *Myname;
+ /* NumCPUs_DoInit returns the number of CPUs present in the system and
+    performs any initialization necessary for the sysinfo-XXX module */
+diff -Naur wmSMPmon-3.1.orig/wmSMPmon/wmSMPmon.c wmSMPmon-3.1/wmSMPmon/wmSMPmon.c
+--- wmSMPmon-3.1.orig/wmSMPmon/wmSMPmon.c      2005-11-07 01:24:32.000000000 +0100
++++ wmSMPmon-3.1/wmSMPmon/wmSMPmon.c   2020-03-29 13:33:03.630624637 +0200
+@@ -35,6 +35,8 @@
+ /*###### Funcition definitions ##########################################*/
+ void usage(int cpus, const char *str);
++char *Myname;
++Display *display;
+ /*###### MAIN PROGRAM ###################################################*/
+ int main(int argc, char **argv)
index 9619fe673e8cfdf34a49dc57c10badc13c3cd73e..cc153566aa1a8bc6214007d31e90331646cbf96c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -22,10 +22,17 @@ DEPEND="${RDEPEND}
 
 DOCS=( ../Changelog )
 
-S="${WORKDIR}/${P}/${PN}"
+S=${WORKDIR}/${P}/${PN}
 
 PATCHES=( "${FILESDIR}"/${P}-makefile.patch )
 
+src_prepare() {
+       default
+
+       pushd "${WORKDIR}"/${P} || die
+       eapply "${FILESDIR}"/${P}-fno-common.patch
+}
+
 src_compile() {
        emake CC="$(tc-getCC)" LIBDIR="/usr/$(get_libdir)"
 }