Simple diff to make easytag happy with taglib2. Tested on amd64. OK?

Cheers Rafael

diff --git a/audio/easytag/Makefile b/audio/easytag/Makefile
index f4e20e63e81..a078362c48b 100644
--- a/audio/easytag/Makefile
+++ b/audio/easytag/Makefile
@@ -2,7 +2,7 @@ COMMENT=                tag editor for various audio file 
formats
 
 GNOME_PROJECT=         easytag
 GNOME_VERSION=         2.4.3
-REVISION=              12
+REVISION=              14
 
 CATEGORIES=            audio
 
@@ -11,13 +11,14 @@ PERMIT_PACKAGE=     Yes
 
 WANTLIB += ${COMPILER_LIBCXX} FLAC X11 Xau Xcomposite Xcursor
 WANTLIB += Xdamage Xdmcp Xext Xfixes Xi Xinerama Xrandr Xrender
-WANTLIB += atk-1.0 atk-bridge-2.0 c cairo cairo-gobject crypto
-WANTLIB += epoxy execinfo expat ffi fontconfig freetype fribidi
-WANTLIB += gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0
-WANTLIB += graphite2 gtk-3 harfbuzz iconv id3 id3tag intl jpeg
-WANTLIB += m ogg opus opusfile pango-1.0 pangocairo-1.0 pangoft2-1.0
-WANTLIB += pcre2-8 pixman-1 png speex tag vorbis vorbisfile wavpack
-WANTLIB += xcb xcb-render xcb-shm z
+WANTLIB += atk-1.0 atk-bridge-2.0 atspi c cairo cairo-gobject
+WANTLIB += crypto dbus-1 epoll-shim epoxy expat ffi fontconfig
+WANTLIB += freetype fribidi gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0
+WANTLIB += gmodule-2.0 gobject-2.0 graphite2 gtk-3 harfbuzz iconv
+WANTLIB += id3 id3tag intl jpeg m ogg opus opusfile pango-1.0
+WANTLIB += pangocairo-1.0 pangoft2-1.0 pcre2-8 pixman-1 png speex
+WANTLIB += tag vorbis vorbisfile wavpack wayland-client wayland-cursor
+WANTLIB += wayland-egl xcb xcb-render xcb-shm xkbcommon z
 
 COMPILER =             base-clang ports-gcc base-gcc
 
diff --git a/audio/easytag/patches/patch-src_tags_gio_wrapper_cc 
b/audio/easytag/patches/patch-src_tags_gio_wrapper_cc
new file mode 100644
index 00000000000..d436622e01a
--- /dev/null
+++ b/audio/easytag/patches/patch-src_tags_gio_wrapper_cc
@@ -0,0 +1,174 @@
+Fix build with Taglib 2.x
+
+Based on patch from Arch Linux:
+https://gitlab.archlinux.org/archlinux/packaging/packages/easytag/-/blob/main/taglib-2.patch?ref_type=heads
+
+Index: src/tags/gio_wrapper.cc
+--- src/tags/gio_wrapper.cc.orig
++++ src/tags/gio_wrapper.cc
+@@ -47,11 +47,11 @@ GIO_InputStream::name () const
+ }
+ 
+ TagLib::ByteVector
+-GIO_InputStream::readBlock (TagLib::ulong len)
++GIO_InputStream::readBlock (size_t len)
+ {
+     if (error)
+     {
+-        return TagLib::ByteVector::null;
++        return TagLib::ByteVector();
+     }
+ 
+     TagLib::ByteVector rv (len, 0);
+@@ -70,14 +70,24 @@ GIO_InputStream::writeBlock (TagLib::ByteVector const 
+ 
+ void
+ GIO_InputStream::insert (TagLib::ByteVector const &data,
+-                         TagLib::ulong start,
+-                         TagLib::ulong replace)
++#if TAGLIB_MAJOR_VERSION >= 2
++                         TagLib::offset_t start,
++                         size_t replace)
++#else
++                         unsigned long start,
++                         unsigned long replace)
++#endif
++
+ {
+     g_warning ("%s", "Trying to write to read-only file!");
+ }
+ 
+ void
+-GIO_InputStream::removeBlock (TagLib::ulong start, TagLib::ulong len)
++#if TAGLIB_MAJOR_VERSION >= 2
++GIO_InputStream::removeBlock (TagLib::offset_t start, size_t len)
++#else
++GIO_InputStream::removeBlock (unsigned long start, unsigned long len)
++#endif
+ {
+     g_warning ("%s", "Trying to write to read-only file!");
+ }
+@@ -95,7 +105,7 @@ GIO_InputStream::isOpen () const
+ }
+ 
+ void
+-GIO_InputStream::seek (long int offset, TagLib::IOStream::Position p)
++GIO_InputStream::seek (TagLib::offset_t offset, TagLib::IOStream::Position p)
+ {
+     if (error)
+     {
+@@ -133,13 +143,13 @@ GIO_InputStream::clear ()
+     }
+ }
+ 
+-long int
++TagLib::offset_t
+ GIO_InputStream::tell () const
+ {
+     return g_seekable_tell (G_SEEKABLE (stream));
+ }
+ 
+-long int
++TagLib::offset_t
+ GIO_InputStream::length ()
+ {
+     if (error)
+@@ -161,7 +171,7 @@ GIO_InputStream::length ()
+ }
+ 
+ void
+-GIO_InputStream::truncate (long int len)
++GIO_InputStream::truncate (TagLib::offset_t len)
+ {
+     g_warning ("%s", "Trying to truncate read-only file");
+ }
+@@ -200,11 +210,11 @@ GIO_IOStream::name () const
+ }
+ 
+ TagLib::ByteVector
+-GIO_IOStream::readBlock (TagLib::ulong len)
++GIO_IOStream::readBlock (size_t len)
+ {
+     if (error)
+     {
+-        return TagLib::ByteVector::null;
++        return TagLib::ByteVector();
+     }
+ 
+     gsize bytes = 0;
+@@ -239,8 +249,14 @@ GIO_IOStream::writeBlock (TagLib::ByteVector const &da
+ 
+ void
+ GIO_IOStream::insert (TagLib::ByteVector const &data,
+-                      TagLib::ulong start,
+-                      TagLib::ulong replace)
++#if TAGLIB_MAJOR_VERSION >= 2
++                      TagLib::offset_t start,
++                      size_t replace)
++#else
++                      unsigned long start,
++                      unsigned long replace)
++#endif
++
+ {
+     if (error)
+     {
+@@ -278,7 +294,7 @@ GIO_IOStream::insert (TagLib::ByteVector const &data,
+     seek (0);
+ 
+     while (g_input_stream_read_all (istream, buffer,
+-                                    MIN (G_N_ELEMENTS (buffer), start),
++                                    MIN (G_N_ELEMENTS (buffer), (unsigned 
long)start),
+                                     &r, NULL, &error) && r > 0)
+     {
+         gsize w;
+@@ -351,9 +367,13 @@ GIO_IOStream::insert (TagLib::ByteVector const &data,
+ }
+ 
+ void
+-GIO_IOStream::removeBlock (TagLib::ulong start, TagLib::ulong len)
++#if TAGLIB_MAJOR_VERSION >= 2
++GIO_IOStream::removeBlock (TagLib::offset_t start, size_t len)
++#else
++GIO_IOStream::removeBlock (unsigned long start, unsigned long len)
++#endif
+ {
+-    if (start + len >= (TagLib::ulong)length ())
++    if (start + len >= (unsigned long)length ())
+     {
+         truncate (start);
+         return;
+@@ -400,7 +420,7 @@ GIO_IOStream::isOpen () const
+ }
+ 
+ void
+-GIO_IOStream::seek (long int offset, TagLib::IOStream::Position p)
++GIO_IOStream::seek (TagLib::offset_t offset, TagLib::IOStream::Position p)
+ {
+     if (error)
+     {
+@@ -434,13 +454,13 @@ GIO_IOStream::clear ()
+     g_clear_error (&error);
+ }
+ 
+-long int
++TagLib::offset_t
+ GIO_IOStream::tell () const
+ {
+     return g_seekable_tell (G_SEEKABLE (stream));
+ }
+ 
+-long int
++TagLib::offset_t
+ GIO_IOStream::length ()
+ {
+     long rv = -1;
+@@ -464,7 +484,7 @@ GIO_IOStream::length ()
+ }
+ 
+ void
+-GIO_IOStream::truncate (long int len)
++GIO_IOStream::truncate (TagLib::offset_t len)
+ {
+     if (error)
+     {
diff --git a/audio/easytag/patches/patch-src_tags_gio_wrapper_h 
b/audio/easytag/patches/patch-src_tags_gio_wrapper_h
new file mode 100644
index 00000000000..a70c3eec576
--- /dev/null
+++ b/audio/easytag/patches/patch-src_tags_gio_wrapper_h
@@ -0,0 +1,69 @@
+Fix build with Taglib 2.x
+
+Based on patch from Arch Linux:
+https://gitlab.archlinux.org/archlinux/packaging/packages/easytag/-/blob/main/taglib-2.patch?ref_type=heads
+
+Index: src/tags/gio_wrapper.h
+--- src/tags/gio_wrapper.h.orig
++++ src/tags/gio_wrapper.h
+@@ -33,17 +33,22 @@ class GIO_InputStream : public TagLib::IOStream (publi
+     GIO_InputStream (GFile *file_);
+     virtual ~GIO_InputStream ();
+     virtual TagLib::FileName name () const;
+-    virtual TagLib::ByteVector readBlock (TagLib::ulong length);
++    virtual TagLib::ByteVector readBlock (size_t length);
+     virtual void writeBlock (TagLib::ByteVector const &data);
+-    virtual void insert (TagLib::ByteVector const &data, TagLib::ulong start 
= 0, TagLib::ulong replace = 0);
+-    virtual void removeBlock (TagLib::ulong start = 0, TagLib::ulong length = 
0);
++#if TAGLIB_MAJOR_VERSION >= 2
++    virtual void insert (TagLib::ByteVector const &data, TagLib::offset_t 
start = 0, size_t replace = 0);
++    virtual void removeBlock (TagLib::offset_t start = 0, size_t length = 0);
++#else
++    virtual void insert (TagLib::ByteVector const &data, unsigned long start 
= 0, unsigned long replace = 0);
++    virtual void removeBlock (unsigned long start = 0, unsigned long length = 
0);
++#endif
+     virtual bool readOnly () const;
+     virtual bool isOpen () const;
+-    virtual void seek (long int offset, TagLib::IOStream::Position p = 
TagLib::IOStream::Beginning);
++    virtual void seek (TagLib::offset_t offset, TagLib::IOStream::Position p 
= TagLib::IOStream::Beginning);
+     virtual void clear ();
+-    virtual long int tell () const;
+-    virtual long int length ();
+-    virtual void truncate (long int length);
++    virtual TagLib::offset_t tell () const;
++    virtual TagLib::offset_t length ();
++    virtual void truncate (TagLib::offset_t length);
+ 
+     virtual const GError *getError() const;
+ 
+@@ -61,17 +66,23 @@ class GIO_IOStream : public TagLib::IOStream (public)
+     GIO_IOStream (GFile *file_);
+     virtual ~GIO_IOStream ();
+     virtual TagLib::FileName name () const;
+-    virtual TagLib::ByteVector readBlock (TagLib::ulong length);
++    virtual TagLib::ByteVector readBlock (size_t length);
++
+     virtual void writeBlock (TagLib::ByteVector const &data);
+-    virtual void insert (TagLib::ByteVector const &data, TagLib::ulong start 
= 0, TagLib::ulong replace = 0);
+-    virtual void removeBlock (TagLib::ulong start = 0, TagLib::ulong len = 0);
++#if TAGLIB_MAJOR_VERSION >= 2
++    virtual void insert (TagLib::ByteVector const &data, TagLib::offset_t 
start = 0, size_t replace = 0);
++    virtual void removeBlock (TagLib::offset_t start = 0, size_t len = 0);
++#else
++    virtual void insert (TagLib::ByteVector const &data, unsigned long start 
= 0, unsigned long replace = 0);
++    virtual void removeBlock (unsigned long start = 0, unsigned long len = 0);
++#endif
+     virtual bool readOnly () const;
+     virtual bool isOpen () const;
+-    virtual void seek (long int offset, TagLib::IOStream::Position p = 
TagLib::IOStream::Beginning);
++    virtual void seek (TagLib::offset_t offset, TagLib::IOStream::Position p 
= TagLib::IOStream::Beginning);
+     virtual void clear ();
+-    virtual long int tell () const;
+-    virtual long int length ();
+-    virtual void truncate (long int length);
++    virtual TagLib::offset_t tell () const;
++    virtual TagLib::offset_t length ();
++    virtual void truncate (TagLib::offset_t length);
+ 
+     virtual const GError *getError() const;
+ 
diff --git a/audio/easytag/patches/patch-src_tags_mp4_header_cc 
b/audio/easytag/patches/patch-src_tags_mp4_header_cc
new file mode 100644
index 00000000000..845c00957ed
--- /dev/null
+++ b/audio/easytag/patches/patch-src_tags_mp4_header_cc
@@ -0,0 +1,17 @@
+Fix build with Taglib 2.x
+
+Based on patch from Arch Linux:
+https://gitlab.archlinux.org/archlinux/packaging/packages/easytag/-/blob/main/taglib-2.patch?ref_type=heads
+
+Index: src/tags/mp4_header.cc
+--- src/tags/mp4_header.cc.orig
++++ src/tags/mp4_header.cc
+@@ -105,7 +105,7 @@ et_mp4_header_read_file_info (GFile *file,
+     ETFileInfo->bitrate = properties->bitrate ();
+     ETFileInfo->samplerate = properties->sampleRate ();
+     ETFileInfo->mode = properties->channels ();
+-    ETFileInfo->duration = properties->length ();
++    ETFileInfo->duration = properties->lengthInSeconds ();
+ 
+     return TRUE;
+ }
diff --git a/audio/easytag/patches/patch-src_tags_mp4_tag_cc 
b/audio/easytag/patches/patch-src_tags_mp4_tag_cc
new file mode 100644
index 00000000000..86eb46c6e03
--- /dev/null
+++ b/audio/easytag/patches/patch-src_tags_mp4_tag_cc
@@ -0,0 +1,58 @@
+Fix build with Taglib 2.x
+
+Based on patch from Arch Linux:
+https://gitlab.archlinux.org/archlinux/packaging/packages/easytag/-/blob/main/taglib-2.patch?ref_type=heads
+
+Index: src/tags/mp4_tag.cc
+--- src/tags/mp4_tag.cc.orig
++++ src/tags/mp4_tag.cc
+@@ -222,7 +222,7 @@ mp4tag_read_file_tag (GFile *file,
+         FileTag->encoded_by = g_strdup (encodedbys.front ().toCString (true));
+     }
+ 
+-    const TagLib::MP4::ItemListMap &extra_items = tag->itemListMap ();
++    const TagLib::MP4::ItemMap &extra_items = tag->itemMap ();
+ 
+     /* Album Artist */
+ #if (TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION < 10)
+@@ -437,25 +437,12 @@ mp4tag_write_file_tag (const ET_File *ETFile,
+         fields.insert ("ENCODEDBY", string);
+     }
+ 
+-    TagLib::MP4::ItemListMap &extra_items = tag->itemListMap ();
+-
+     /* Album artist. */
+     if (!et_str_empty (FileTag->album_artist))
+     {
+         TagLib::String string (FileTag->album_artist, TagLib::String::UTF8);
+-#if (TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION < 10)
+-        /* No "ALBUMARTIST" support in TagLib until 1.10; use atom directly. 
*/
+-        extra_items.insert ("aART", TagLib::MP4::Item (string));
+-#else
+         fields.insert ("ALBUMARTIST", string);
+-#endif
+     }
+-#if (TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION < 10)
+-    else
+-    {
+-        extra_items.erase ("aART");
+-    }
+-#endif
+ 
+     /***********
+      * Picture *
+@@ -491,12 +478,12 @@ mp4tag_write_file_tag (const ET_File *ETFile,
+         TagLib::MP4::CoverArt art (f, TagLib::ByteVector((char *)data,
+                                                          data_size));
+ 
+-        extra_items.insert ("covr",
++        tag->setItem("covr",
+                             TagLib::MP4::Item (TagLib::MP4::CoverArtList 
().append (art)));
+     }
+     else
+     {
+-        extra_items.erase ("covr");
++        tag->removeItem("covr");
+     }
+ 
+     tag->setProperties (fields);

Reply via email to