Download raw body.
unbreak xmms2-scrobbler-0.4.0
Stuart pointed out that xmms2-scrobbler-0.4.0 fails to build after
the xmms2 update. Here is a "simple" fix. Untested because I have no
use-case for it.
Cheers Rafael
Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/xmms2-scrobbler/Makefile,v
diff -u -p -u -p -r1.12 Makefile
--- Makefile 5 Sep 2023 16:13:43 -0000 1.12
+++ Makefile 20 Jul 2025 14:56:22 -0000
@@ -1,20 +1,21 @@
COMMENT = last.fm client for xmms2
DISTNAME = xmms2-scrobbler-0.4.0
-REVISION = 1
+REVISION = 2
CATEGORIES = audio
HOMEPAGE = http://code-monkey.de/pages/xmms2-scrobbler
-# BSD
+# BSD
PERMIT_PACKAGE = Yes
-WANTLIB += c curl pthread xmmsclient
+WANTLIB += c curl m pthread xmmsclient
SITES = ftp://ftp.code-monkey.de/pub/xmms2-scrobbler/
-LIB_DEPENDS = audio/xmms2
+LIB_DEPENDS = audio/xmms2 \
+ net/curl
USE_GMAKE = Yes
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/audio/xmms2-scrobbler/patches/patch-Makefile,v
diff -u -p -u -p -r1.3 patch-Makefile
--- patches/patch-Makefile 11 Mar 2022 18:20:36 -0000 1.3
+++ patches/patch-Makefile 20 Jul 2025 14:56:22 -0000
@@ -1,6 +1,15 @@
---- Makefile.orig Wed Dec 30 18:04:01 2009
-+++ Makefile Mon Mar 15 21:31:54 2010
-@@ -31,11 +31,13 @@ OBJECTS := src/xmms2-scrobbler.o \
+Index: Makefile
+--- Makefile.orig
++++ Makefile
+@@ -5,6 +5,7 @@ PREFIX ?= /usr/local
+ VERSION := 0.4.0
+ TARBALL := xmms2-scrobbler-$(VERSION).tar.gz
+
++LIBS := -lm
+ XMMS_CFLAGS := `pkg-config xmms2-client --cflags`
+ XMMS_LDFLAGS := `pkg-config xmms2-client --libs`
+ CURL_CFLAGS := `pkg-config libcurl --cflags`
+@@ -31,11 +32,13 @@ OBJECTS := src/xmms2-scrobbler.o \
all: $(BINARY)
install: $(BINARY)
@@ -13,7 +22,7 @@
$(BINARY): $(OBJECTS) bin
- $(QUIET_LINK)$(CC) $(LDFLAGS) $(XMMS_LDFLAGS) $(CURL_LDFLAGS) $(OBJECTS) -o $@
-+ $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) $(XMMS_LDFLAGS) $(CURL_LDFLAGS) $(OBJECTS) -o $@
++ $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) $(LIBS) $(XMMS_LDFLAGS) $(CURL_LDFLAGS) $(OBJECTS) -o $@
src/%.o : src/%.c
$(QUIET_CC)$(CC) $(CFLAGS) $(XMMS_CFLAGS) $(CURL_CFLAGS) $(ENDIAN_CFLAGS) -o $@ -c $<
Index: patches/patch-src_submission_c
===================================================================
RCS file: patches/patch-src_submission_c
diff -N patches/patch-src_submission_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_submission_c 20 Jul 2025 14:56:22 -0000
@@ -0,0 +1,30 @@
+Index: src/submission.c
+--- src/submission.c.orig
++++ src/submission.c
+@@ -22,6 +22,7 @@
+ */
+
+ #include <stdlib.h>
++#include <stdio.h>
+ #include "submission.h"
+
+ Submission *
+@@ -118,7 +119,8 @@ profile_submission_new (xmmsv_t *dict, uint32_t second
+ return NULL;
+
+ if (seconds_played < 240 && seconds_played < (val_i / 2000)) {
+- fprintf (stderr, "seconds_played FAIL: %u\n", seconds_played);
++ fprintf (stderr, "seconds_played FAIL: %lld\n",
++ (long long)seconds_played);
+ return NULL;
+ }
+
+@@ -147,7 +149,7 @@ profile_submission_new (xmmsv_t *dict, uint32_t second
+ strbuf_append_encoded (sb, (const uint8_t *) title);
+
+ /* timestamp */
+- sprintf (buf32, "%lu", started_playing);
++ sprintf (buf32, "%lld", started_playing);
+ strbuf_append (sb, "&i[0]=");
+ strbuf_append (sb, buf32);
+
Index: patches/patch-src_xmms2-scrobbler_c
===================================================================
RCS file: patches/patch-src_xmms2-scrobbler_c
diff -N patches/patch-src_xmms2-scrobbler_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_xmms2-scrobbler_c 20 Jul 2025 14:56:22 -0000
@@ -0,0 +1,40 @@
+Index: src/xmms2-scrobbler.c
+--- src/xmms2-scrobbler.c.orig
++++ src/xmms2-scrobbler.c
+@@ -299,13 +299,15 @@ do_handshake (Server *server)
+ memcpy (hashed, server->hashed_password, 32);
+
+ /* append the timestamp */
+- snprintf (&hashed[32], sizeof (hashed) - 32, "%lu", timestamp);
++ snprintf (&hashed[32], sizeof (hashed) - 32, "%lld",
++ (long long)timestamp);
+
+ pos = snprintf (post_data, sizeof (post_data),
+ "%s/"
+ "?hs=true&p=" PROTOCOL "&c=" CLIENT_ID
+- "&v=" VERSION "&u=%s&t=%lu&a=",
+- server->handshake_url, server->user, timestamp);
++ "&v=" VERSION "&u=%s&t=%lld&a=",
++ server->handshake_url, server->user,
++ (long long)timestamp);
+
+ /* hash the hashed password and timestamp and append the hex string
+ * to 'post_data'.
+@@ -532,7 +534,7 @@ submit_to_profile (xmmsv_t *val)
+ static int
+ on_medialib_get_info2 (xmmsv_t *val, void *udata)
+ {
+- bool reset_current_id = XPOINTER_TO_INT (udata);
++ bool reset_current_id = (int)(intptr_t)(udata);
+
+ seconds_played += time (NULL) - last_unpause;
+ fprintf (stderr, "submitting: seconds_played %i\n", seconds_played);
+@@ -570,7 +572,7 @@ maybe_submit_to_profile (bool reset_current_id)
+ mediainfo_result = xmmsc_medialib_get_info (conn, current_id);
+ xmmsc_result_notifier_set (mediainfo_result,
+ on_medialib_get_info2,
+- XINT_TO_POINTER (reset_current_id));
++ (void*)(intptr_t)(reset_current_id));
+ xmmsc_result_unref (mediainfo_result);
+ }
+
unbreak xmms2-scrobbler-0.4.0