summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2020-08-19 11:55:35 +0200
committerJeroen Roovers <jer@gentoo.org>2020-08-19 12:10:46 +0200
commitc9f42ac8feb314f3f2f6ec7cfd8c535ff33fe735 (patch)
tree7583d73f1543254ed5243b2880df839e4c113ccd
parentgames-emulation/dosbox-staging: add missing dep (diff)
downloadgentoo-c9f42ac8feb314f3f2f6ec7cfd8c535ff33fe735.tar.gz
gentoo-c9f42ac8feb314f3f2f6ec7cfd8c535ff33fe735.tar.bz2
gentoo-c9f42ac8feb314f3f2f6ec7cfd8c535ff33fe735.zip
media-sound/scmpc: Fix building with CFLAGS=-fno-common
Package-Manager: Portage-3.0.3, Repoman-3.0.0 Closes: https://bugs.gentoo.org/707614 Signed-off-by: Jeroen Roovers <jer@gentoo.org>
-rw-r--r--media-sound/scmpc/files/scmpc-0.4.1-fno-common.patch103
-rw-r--r--media-sound/scmpc/scmpc-0.4.1.ebuild5
2 files changed, 107 insertions, 1 deletions
diff --git a/media-sound/scmpc/files/scmpc-0.4.1-fno-common.patch b/media-sound/scmpc/files/scmpc-0.4.1-fno-common.patch
new file mode 100644
index 00000000000..22cd4621e74
--- /dev/null
+++ b/media-sound/scmpc/files/scmpc-0.4.1-fno-common.patch
@@ -0,0 +1,103 @@
+--- a/src/audioscrobbler.c
++++ b/src/audioscrobbler.c
+@@ -50,6 +50,9 @@
+ #define API_KEY "3ec5638071c41a864bf0c8d451566476"
+ #define API_SECRET "365e18391ccdee3bf820cb3d2ba466f6"
+
++static struct as_conn_t as_conn;
++gchar *buffer;
++
+ gboolean as_connection_init(void)
+ {
+ as_conn.handle = curl_easy_init();
+--- a/src/audioscrobbler.h
++++ b/src/audioscrobbler.h
+@@ -37,19 +37,19 @@
+ /**
+ * Last.fm connection data
+ */
+-struct {
++struct as_conn_t {
+ gchar *session_id;
+ gint64 last_auth;
+ gint64 last_fail;
+ connection_status status;
+ CURL *handle;
+ struct curl_slist *headers;
+-} as_conn;
++};
+
+ /**
+ * cURL data buffer
+ */
+-gchar *buffer;
++extern gchar *buffer;
+
+ /**
+ * Initialize cURL
+--- a/src/mpd.c
++++ b/src/mpd.c
+@@ -37,6 +37,8 @@
+ static gboolean mpd_parse(GIOChannel *source, GIOCondition condition,
+ gpointer data);
+
++struct mpd_t mpd;
++
+ gboolean mpd_connect(void)
+ {
+ mpd.conn = mpd_connection_new(prefs.mpd_hostname, prefs.mpd_port,
+--- a/src/mpd.h
++++ b/src/mpd.h
+@@ -32,7 +32,7 @@
+ /**
+ * MPD connection data
+ */
+-struct {
++struct mpd_t {
+ struct mpd_connection *conn;
+ struct mpd_status *status;
+ struct mpd_song *song;
+@@ -42,7 +42,9 @@
+ guint idle_source;
+ guint check_source;
+ guint reconnect_source;
+-} mpd;
++};
++
++extern struct mpd_t mpd;
+
+ /**
+ * Connect to MPD
+--- a/src/preferences.c
++++ b/src/preferences.c
+@@ -36,6 +36,8 @@
+ #include "scmpc.h"
+ #include "preferences.h"
+
++struct prefs_t prefs;
++
+ static gint cf_log_level(cfg_t *cfg, cfg_opt_t *opt, const gchar *value,
+ void *result);
+ static gint cf_validate_num(cfg_t *cfg, cfg_opt_t *opt);
+--- a/src/preferences.h
++++ b/src/preferences.h
+@@ -32,7 +32,7 @@
+ /**
+ * scmpc settings
+ */
+-struct {
++struct prefs_t {
+ gchar *mpd_hostname;
+ gushort mpd_port;
+ gushort mpd_timeout;
+@@ -48,7 +48,9 @@
+ gchar *cache_file;
+ guint queue_length;
+ guint cache_interval;
+-} prefs;
++};
++
++extern struct prefs_t prefs;
+
+ /**
+ * Initialize preferences
diff --git a/media-sound/scmpc/scmpc-0.4.1.ebuild b/media-sound/scmpc/scmpc-0.4.1.ebuild
index 7eee1b1aa5b..2b76d415553 100644
--- a/media-sound/scmpc/scmpc-0.4.1.ebuild
+++ b/media-sound/scmpc/scmpc-0.4.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -18,6 +18,9 @@ RDEPEND="
net-misc/curl:="
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.4.1-fno-common.patch
+)
src_install() {
default