From dc62b31cfc2b9dec1f462f346955b6f1fe984e7844603ef1dae5508b458da7ae Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 15 Jan 2020 10:25:38 +0000 Subject: [PATCH 1/2] - mc-no-common.patch: fix compilation on Tumbleweed (bsc#1160401) OBS-URL: https://build.opensuse.org/package/show/Base:System/mc?expand=0&rev=128 --- mc-no-common.patch | 26 ++++++++++++++++++++++++++ mc.changes | 5 +++++ mc.spec | 4 +++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 mc-no-common.patch diff --git a/mc-no-common.patch b/mc-no-common.patch new file mode 100644 index 0000000..d71da9d --- /dev/null +++ b/mc-no-common.patch @@ -0,0 +1,26 @@ +When compiled with -fno-common + +[ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: lt50-menu.o (symbol from plugin): in function `destroy_menu': +[ 98s] (.text+0x0): multiple definition of `menu_map'; keybind-defaults.o (symbol from plugin):(.text+0x0): first defined here + + +Index: mc-4.8.23/lib/widget/menu.c +=================================================================== +--- mc-4.8.23.orig/lib/widget/menu.c ++++ mc-4.8.23/lib/widget/menu.c +@@ -40,14 +40,11 @@ + #include "lib/skin.h" + #include "lib/tty/key.h" /* key macros */ + #include "lib/keybind.h" /* global_keymap_t */ ++#include "src/keybind-defaults.h" + #include "lib/strutil.h" + #include "lib/widget.h" + #include "lib/event.h" /* mc_event_raise() */ + +-/*** global variables ****************************************************************************/ +- +-const global_keymap_t *menu_map; +- + /*** file scope macro definitions ****************************************************************/ + + #define MENUENTRY(x) ((menu_entry_t *)(x)) diff --git a/mc.changes b/mc.changes index 611217d..61bfacc 100644 --- a/mc.changes +++ b/mc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jan 15 10:11:03 UTC 2020 - Adam Majer + +- mc-no-common.patch: fix compilation on Tumbleweed (bsc#1160401) + ------------------------------------------------------------------- Thu Aug 1 07:21:35 UTC 2019 - Tomáš Chvátal diff --git a/mc.spec b/mc.spec index a8a3f64..7d62a14 100644 --- a/mc.spec +++ b/mc.spec @@ -1,7 +1,7 @@ # # spec file for package mc # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -58,6 +58,7 @@ Patch69: mc-extd-xdg.patch Patch71: mc-ext-audio.patch Patch100: xls2csv_update.patch Patch101: sftp_interactive_password.patch +Patch102: mc-no-common.patch BuildRequires: audiofile-devel BuildRequires: e2fsprogs-devel BuildRequires: gettext >= 0.18.1 @@ -114,6 +115,7 @@ echo "`grep %{name}-%{version}.tar.xz %{SOURCE6} | head -n1 | cut -c1-64` %{SOU %patch60 -p1 %patch100 -p1 %patch101 -p1 +%patch102 -p1 %build autoreconf -fvi From 42b22e748cfecb92145da091a444dd0e454cac29b8ac1db6708163123dc0b635 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 15 Jan 2020 10:31:09 +0000 Subject: [PATCH 2/2] Use upstream solution OBS-URL: https://build.opensuse.org/package/show/Base:System/mc?expand=0&rev=129 --- mc-no-common.patch | 85 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 20 deletions(-) diff --git a/mc-no-common.patch b/mc-no-common.patch index d71da9d..3e40a3f 100644 --- a/mc-no-common.patch +++ b/mc-no-common.patch @@ -1,26 +1,71 @@ -When compiled with -fno-common +commit 093571938a6c31706f918b011335b8ab30602336 +Author: Andrew Borodin +Date: Sat Nov 23 17:41:58 2019 +0300 -[ 98s] /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: lt50-menu.o (symbol from plugin): in function `destroy_menu': -[ 98s] (.text+0x0): multiple definition of `menu_map'; keybind-defaults.o (symbol from plugin):(.text+0x0): first defined here + Ticket #4035: fix compile failure on OS X 10.9. + + Fix duplication of menu_map definition. + + Move menu_map definition to lib/widget/menu.c. + + Signed-off-by: Andrew Borodin - -Index: mc-4.8.23/lib/widget/menu.c -=================================================================== ---- mc-4.8.23.orig/lib/widget/menu.c -+++ mc-4.8.23/lib/widget/menu.c -@@ -40,14 +40,11 @@ - #include "lib/skin.h" - #include "lib/tty/key.h" /* key macros */ - #include "lib/keybind.h" /* global_keymap_t */ -+#include "src/keybind-defaults.h" - #include "lib/strutil.h" - #include "lib/widget.h" - #include "lib/event.h" /* mc_event_raise() */ +diff --git a/lib/widget/menu.c b/lib/widget/menu.c +index b7476b62b..68ae6f6ce 100644 +--- a/lib/widget/menu.c ++++ b/lib/widget/menu.c +@@ -46,7 +46,7 @@ + + /*** global variables ****************************************************************************/ --/*** global variables ****************************************************************************/ -- -const global_keymap_t *menu_map; -- ++const global_keymap_t *menu_map = NULL; + /*** file scope macro definitions ****************************************************************/ - #define MENUENTRY(x) ((menu_entry_t *)(x)) +diff --git a/lib/widget/menu.h b/lib/widget/menu.h +index c522a16c8..fad6fa639 100644 +--- a/lib/widget/menu.h ++++ b/lib/widget/menu.h +@@ -39,6 +39,8 @@ typedef struct WMenuBar + + /*** global variables defined in .c file *********************************************************/ + ++extern const global_keymap_t *menu_map; ++ + /*** declarations of public functions ************************************************************/ + + menu_entry_t *menu_entry_create (const char *name, long command); +diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c +index 10ba341ee..0ba4840df 100644 +--- a/src/keybind-defaults.c ++++ b/src/keybind-defaults.c +@@ -28,7 +28,7 @@ + #include + + #include "lib/global.h" +-#include "lib/widget.h" /* dialog_map, input_map, listbox_map */ ++#include "lib/widget.h" /* dialog_map, input_map, listbox_map, menu_map */ + + #include "keybind-defaults.h" + +@@ -56,7 +56,6 @@ GArray *diff_keymap = NULL; + const global_keymap_t *main_map = NULL; + const global_keymap_t *main_x_map = NULL; + const global_keymap_t *panel_map = NULL; +-const global_keymap_t *menu_map = NULL; + const global_keymap_t *tree_map = NULL; + const global_keymap_t *help_map = NULL; + +diff --git a/src/keybind-defaults.h b/src/keybind-defaults.h +index edb05c67f..6b7266589 100644 +--- a/src/keybind-defaults.h ++++ b/src/keybind-defaults.h +@@ -35,7 +35,6 @@ extern GArray *diff_keymap; + extern const global_keymap_t *main_map; + extern const global_keymap_t *main_x_map; + extern const global_keymap_t *panel_map; +-extern const global_keymap_t *menu_map; + extern const global_keymap_t *tree_map; + extern const global_keymap_t *help_map; +