git: aaa549625594 - main - audio/libgpod: fix build

Dima Panov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=aaa549625594c7778f051dfb2da1448bf6409ae5

commit aaa549625594c7778f051dfb2da1448bf6409ae5
Author:     Dima Panov <[email protected]>
AuthorDate: 2026-08-12 10:24:20 +0000
Commit:     Dima Panov <[email protected]>
CommitDate: 2026-08-12 10:24:20 +0000

    audio/libgpod: fix build
    
    Fix detection of sgutils
    Backport patches from Gontoo to fix library overlinking and crashes with recent gdk-pixpuf
---
 audio/libgpod/Makefile                            |  6 +++--
 audio/libgpod/files/patch-libgpod-1.0.pc.in       | 12 +++++++++
 audio/libgpod/files/patch-src_itdb__itunesdb.c    | 25 +++++++++++++++++
 audio/libgpod/files/patch-src_ithumb-writer.c     | 20 ++++++++++++++
 audio/libgpod/files/patch-tools_generic-callout.c | 33 +++++++++++++++++++++++
 5 files changed, 94 insertions(+), 2 deletions(-)

diff --git a/audio/libgpod/Makefile b/audio/libgpod/Makefile
index 8c95b892a331..10afe12f929c 100644
--- a/audio/libgpod/Makefile
+++ b/audio/libgpod/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	libgpod
 PORTVERSION=	0.8.3
-PORTREVISION=	14
+PORTREVISION=	15
 CATEGORIES=	audio
 MASTER_SITES=	SF/gtkpod/${PORTNAME}/${PORTNAME}-${PORTVERSION:R}
 
@@ -25,6 +25,8 @@ USE_GNOME=	gdkpixbuf intltool libxml2
 INSTALL_TARGET=	install-strip
 USE_LDCONFIG=	yes
 
+CFLAGS+=	-Wno-error=incompatible-pointer-types
+
 OPTIONS_DEFINE=	DOCS IMOBILE
 OPTIONS_DEFAULT=IMOBILE
 OPTIONS_SUB=	yes
@@ -44,8 +46,8 @@ COMMENT:=	${COMMENT:S,iPod,&/iPhone,}
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|libplist >= 1\.0|libplist-2.0 >= 2.0|g' \
+		-e 's|-lsgutils|-lcam -lsgutils|g' \
 		${WRKSRC}/configure
-
 post-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/tools/ipod-time-sync \
 		${STAGEDIR}${PREFIX}/bin
diff --git a/audio/libgpod/files/patch-libgpod-1.0.pc.in b/audio/libgpod/files/patch-libgpod-1.0.pc.in
new file mode 100644
index 000000000000..9785c054e043
--- /dev/null
+++ b/audio/libgpod/files/patch-libgpod-1.0.pc.in
@@ -0,0 +1,12 @@
+Fix overlinking
+
+--- libgpod-1.0.pc.in.orig	2011-04-15 08:37:34 UTC
++++ libgpod-1.0.pc.in
+@@ -6,6 +6,6 @@ Version: @VERSION@
+ Name: libgpod
+ Description: A library to manipulate songs and playlists stored on an ipod
+ Version: @VERSION@
+-Requires: glib-2.0 >= 2.8.0 gobject-2.0 @GDKPIXBUF_REQ@ @LIBIMOBILEDEVICE_REQ@
++Requires.private: glib-2.0 >= 2.8.0 gobject-2.0 @GDKPIXBUF_REQ@ @LIBIMOBILEDEVICE_REQ@
+ Libs: -L${libdir} -lgpod
+ Cflags: -I${includedir}/gpod-1.0
diff --git a/audio/libgpod/files/patch-src_itdb__itunesdb.c b/audio/libgpod/files/patch-src_itdb__itunesdb.c
new file mode 100644
index 000000000000..2b2ce2a5fc1f
--- /dev/null
+++ b/audio/libgpod/files/patch-src_itdb__itunesdb.c
@@ -0,0 +1,25 @@
+--- src/itdb_itunesdb.c.orig	2013-07-09 15:34:38 UTC
++++ src/itdb_itunesdb.c
+@@ -1156,6 +1156,7 @@ static gboolean playcounts_plist_read (FImport *fimp, 
+     GHashTable *pc_dict, *track_dict;
+     GValue *to_parse;
+     GArray *array;
++    GValue value;
+     gint i;
+     guint32 mac_time;
+     guint64 *dbid;
+@@ -1175,11 +1176,12 @@ static gboolean playcounts_plist_read (FImport *fimp, 
+ 
+     array = (GArray*)g_value_get_boxed (to_parse);
+     for (i = 0; i < array->len; i++) {
+-       if (!G_VALUE_HOLDS (g_array_index (array, GValue *, i), G_TYPE_HASH_TABLE)) {
++       value = g_array_index (array, GValue, i);
++       if (!G_VALUE_HOLDS (&value, G_TYPE_HASH_TABLE)) {
+           continue;
+        }
+ 
+-       track_dict = g_value_get_boxed (g_array_index (array, GValue *, i));
++       track_dict = g_value_get_boxed (&value);
+        if (track_dict == NULL)
+            continue;
+ 
diff --git a/audio/libgpod/files/patch-src_ithumb-writer.c b/audio/libgpod/files/patch-src_ithumb-writer.c
new file mode 100644
index 000000000000..76953de0432f
--- /dev/null
+++ b/audio/libgpod/files/patch-src_ithumb-writer.c
@@ -0,0 +1,20 @@
+--- src/ithumb-writer.c.orig	2011-07-24 11:08:03 UTC
++++ src/ithumb-writer.c
+@@ -728,7 +728,7 @@ ithumb_writer_handle_rotation (GdkPixbuf *pixbuf, guin
+   {
+       return gdk_pixbuf_rotate_simple (pixbuf, *rotation);
+   }
+-  return g_object_ref (G_OBJECT (pixbuf));
++  return (GdkPixbuf *)(g_object_ref (G_OBJECT (pixbuf)));
+ }
+ 
+ /* On the iPhone, thumbnails are presented as squares in a grid.
+@@ -968,7 +968,7 @@ ithumb_writer_write_thumbnail (iThumbWriter *writer, 
+     else if (thumb->data_type == ITDB_THUMB_TYPE_PIXBUF)
+     {
+         Itdb_Thumb_Pixbuf *thumb_pixbuf = (Itdb_Thumb_Pixbuf *)thumb;
+-        pixbuf = g_object_ref (G_OBJECT (thumb_pixbuf->pixbuf));
++        pixbuf = (GdkPixbuf *)(g_object_ref (G_OBJECT (thumb_pixbuf->pixbuf)));
+     }
+ 
+     if (pixbuf == NULL)
diff --git a/audio/libgpod/files/patch-tools_generic-callout.c b/audio/libgpod/files/patch-tools_generic-callout.c
new file mode 100644
index 000000000000..d10a6cb2e888
--- /dev/null
+++ b/audio/libgpod/files/patch-tools_generic-callout.c
@@ -0,0 +1,33 @@
+Call mount() only on Linux -- it has different call signature elsewhere.
+
+Index: tools/generic-callout.c
+--- tools/generic-callout.c.orig	2013-07-10 13:43:42 UTC
++++ tools/generic-callout.c
+@@ -588,6 +588,7 @@ static char *mount_ipod (const char *dev_path, const c
+ 
+ static char *mount_ipod (const char *dev_path, const char *fstype)
+ {
++#ifdef __linux__
+         char *filename;
+         char *tmpname;
+         int result;
+@@ -616,6 +617,9 @@ static char *mount_ipod (const char *dev_path, const c
+         g_debug("device successfully mounted at %s", tmpname);
+ 
+         return tmpname;
++#else
++        return NULL;
++#endif
+ }
+ 
+ static gboolean write_sysinfo_extended (const char *mountpoint,
+@@ -745,7 +749,9 @@ int itdb_callout_set_ipod_properties (ItdbBackend *bac
+          */
+         mounted_ipod_set_properties (backend, ipod_mountpoint);
+ 
++#ifdef __linux__
+         umount (ipod_mountpoint);
++#endif
+         g_rmdir (ipod_mountpoint);
+         g_free (ipod_mountpoint);
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.