summaryrefslogtreecommitdiffstats
path: root/shell-term-fm
diff options
context:
space:
mode:
authorIsmael Luceno2020-07-29 01:21:28 +0200
committerIsmael Luceno2020-07-29 01:21:28 +0200
commitfcfea88efaa1089728cdb6d997d9ad800568a776 (patch)
tree622ed58139bc2cb7c8f04f9b6ed24d308f41e38b /shell-term-fm
parent70c3fd1530984ff2bb3926db3e2c23c2a0716353 (diff)
spacefm: Fix global definitions in headers
Needed by, at least, gnu ld 2.35.
Diffstat (limited to 'shell-term-fm')
-rw-r--r--shell-term-fm/spacefm/HISTORY3
-rwxr-xr-xshell-term-fm/spacefm/PRE_BUILD2
-rw-r--r--shell-term-fm/spacefm/patches/0001-Fix-global-definitions-at-headers.patch100
3 files changed, 105 insertions, 0 deletions
diff --git a/shell-term-fm/spacefm/HISTORY b/shell-term-fm/spacefm/HISTORY
index c31542935b..b3e80e88e2 100644
--- a/shell-term-fm/spacefm/HISTORY
+++ b/shell-term-fm/spacefm/HISTORY
@@ -1,4 +1,7 @@
2020-07-28 Ismael Luceno <ismael@sourcemage.org>
+ * PRE_BUILD,
+ patches/0001-Fix-global-definitions-at-src-headers.patch:
+ fixed global definitions
* PRE_BUILD: Fixed build against musl
fixed missing major & minor macros on non-glibc systems
diff --git a/shell-term-fm/spacefm/PRE_BUILD b/shell-term-fm/spacefm/PRE_BUILD
index 65ec6de016..1f2d5ead1b 100755
--- a/shell-term-fm/spacefm/PRE_BUILD
+++ b/shell-term-fm/spacefm/PRE_BUILD
@@ -1,6 +1,8 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches &&
+
# fix sha*sum paths
sedit "s:/usr/bin/sha256sum:/bin/sha256sum:" src/vfs/vfs-file-task.c &&
sedit "s:/usr/bin/sha256sum:/bin/sha256sum:;s:/usr/bin/sha512sum:/bin/sha512sum:" src/spacefm-auth &&
diff --git a/shell-term-fm/spacefm/patches/0001-Fix-global-definitions-at-headers.patch b/shell-term-fm/spacefm/patches/0001-Fix-global-definitions-at-headers.patch
new file mode 100644
index 0000000000..8a5f61d1a0
--- /dev/null
+++ b/shell-term-fm/spacefm/patches/0001-Fix-global-definitions-at-headers.patch
@@ -0,0 +1,100 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael@iodev.co.uk>
+Date: Tue, 28 Jul 2020 23:20:16 +0000
+Subject: [PATCH] Fix global definitions at headers
+
+Global definitions should be declared explicitly as extern in headers and
+also in some code file.
+
+Recent versions of ld (at least 2.35) complain and fail instead of merging them
+automatically unless explicitly told to do so with the
+--allow-multiple-definition flag.
+
+diff --git a/src/settings.h b/src/settings.h
+index e25bdc328031..2355d78d5d56 100644
+--- a/src/settings.c
++++ b/src/settings.c
+@@ -52,6 +52,24 @@
+ /* Dirty hack: check whether we are under LXDE or not */
+ #define is_under_LXDE() (g_getenv( "_LXSESSION_PID" ) != NULL)
+
++GList* xsets;
++XSet* evt_win_focus;
++XSet* evt_win_move;
++XSet* evt_win_click;
++XSet* evt_win_key;
++XSet* evt_win_close;
++XSet* evt_pnl_show;
++XSet* evt_pnl_focus;
++XSet* evt_pnl_sel;
++XSet* evt_tab_new;
++XSet* evt_tab_chdir;
++XSet* evt_tab_focus;
++XSet* evt_tab_close;
++XSet* evt_device;
++GList* xset_cmd_history;
++char* settings_terminal_su;
++char* settings_graphical_su;
++
+ AppSettings app_settings = {0};
+ /* const gboolean singleInstance_default = TRUE; */
+ const gboolean show_hidden_files_default = FALSE;
+--- a/src/settings.h
++++ b/src/settings.h
+@@ -120,7 +120,7 @@
+ ///////////////////////////////////////////////////////////////////////////////
+ //MOD extra settings below
+
+-GList* xsets;
++extern GList* xsets;
+
+ enum {
+ XSET_B_UNSET,
+@@ -311,22 +311,22 @@ typedef struct
+ } XMenuItem;
+
+ // cache these for speed in event handlers
+-XSet* evt_win_focus;
+-XSet* evt_win_move;
+-XSet* evt_win_click;
+-XSet* evt_win_key;
+-XSet* evt_win_close;
+-XSet* evt_pnl_show;
+-XSet* evt_pnl_focus;
+-XSet* evt_pnl_sel;
+-XSet* evt_tab_new;
+-XSet* evt_tab_chdir;
+-XSet* evt_tab_focus;
+-XSet* evt_tab_close;
+-XSet* evt_device;
++extern XSet* evt_win_focus;
++extern XSet* evt_win_move;
++extern XSet* evt_win_click;
++extern XSet* evt_win_key;
++extern XSet* evt_win_close;
++extern XSet* evt_pnl_show;
++extern XSet* evt_pnl_focus;
++extern XSet* evt_pnl_sel;
++extern XSet* evt_tab_new;
++extern XSet* evt_tab_chdir;
++extern XSet* evt_tab_focus;
++extern XSet* evt_tab_close;
++extern XSet* evt_device;
+
+ // instance-wide command history
+-GList* xset_cmd_history;
++extern GList* xset_cmd_history;
+
+ static const char* terminal_programs[] = //for pref-dialog.c
+ {
+@@ -374,8 +374,8 @@ static const char* gsu_commands[] = // order and contents must match prefdlg.ui
+ };
+
+ // These will contain the su and gsu settings from /etc/spacefm/spacefm.conf
+-char* settings_terminal_su;
+-char* settings_graphical_su;
++extern char* settings_terminal_su;
++extern char* settings_graphical_su;
+
+ typedef struct
+ {