From 4b8f29d226daa36be1435ee1bfc1141ba52bdb0f Mon Sep 17 00:00:00 2001
From: krop <>
Date: Feb 21 2024 17:02:46 +0000
Subject: Update amarok to version 2.9.75git.20230408T114133~7098c192a6 / rev 137 via SR 1148291
https://build.opensuse.org/request/show/1148291
by user krop + anag+factory
- Remove the taglib-extras dependency, it fails to build with
taglib 2 and will be dropped.
- Add patch to support taglib 2:
* 0001-Use-non-deprecated-TagLib-functions-fix-build-with-T.patch
---
diff --git a/.files b/.files
index 99cda7e..afaae91 100644
Binary files a/.files and b/.files differ
diff --git a/.rev b/.rev
index 205e08c..6170e78 100644
--- a/.rev
+++ b/.rev
@@ -1258,4 +1258,15 @@ https://git.reviewboard.kde.org/r/104878/ (forwarded request 116659 from StefanB
(boo#1210220)
1078010
+
+ 0577681675c1ed2ef69509d3386c9a6e
+ 2.9.75git.20230408T114133~7098c192a6
+
+ anag+factory
+ - Remove the taglib-extras dependency, it fails to build with
+ taglib 2 and will be dropped.
+- Add patch to support taglib 2:
+ * 0001-Use-non-deprecated-TagLib-functions-fix-build-with-T.patch
+ 1148291
+
diff --git a/0001-Use-non-deprecated-TagLib-functions-fix-build-with-T.patch b/0001-Use-non-deprecated-TagLib-functions-fix-build-with-T.patch
new file mode 100644
index 0000000..fdde28a
--- /dev/null
+++ b/0001-Use-non-deprecated-TagLib-functions-fix-build-with-T.patch
@@ -0,0 +1,209 @@
+From 753fd2704640bcc5365e63b64c611971920006f2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mihkel=20T=C3=B5nnov?=
+Date: Sun, 4 Feb 2024 12:44:12 +0100
+Subject: [PATCH] Use non-deprecated TagLib functions (fix build with TagLib 2)
+
+(cherry picked from commit 04f9423826fe4649e91b1b4bd2b1a637cd555214)
+---
+ shared/tag_helpers/APETagHelper.cpp | 2 +-
+ shared/tag_helpers/ASFTagHelper.cpp | 2 +-
+ shared/tag_helpers/ID3v2TagHelper.cpp | 2 +-
+ shared/tag_helpers/MP4TagHelper.cpp | 28 +++++++++----------
+ shared/tag_helpers/StringHelper.cpp | 2 +-
+ shared/tag_helpers/TagHelper.cpp | 2 +-
+ shared/tag_helpers/VorbisCommentTagHelper.cpp | 2 +-
+ utilities/afttagger/AFTTagger.cpp | 6 ++--
+ 8 files changed, 23 insertions(+), 23 deletions(-)
+
+diff --git a/shared/tag_helpers/APETagHelper.cpp b/shared/tag_helpers/APETagHelper.cpp
+index eee34e05a3..66e8510a53 100644
+--- a/shared/tag_helpers/APETagHelper.cpp
++++ b/shared/tag_helpers/APETagHelper.cpp
+@@ -84,7 +84,7 @@ APETagHelper::setTags( const Meta::FieldHash &changes )
+ QVariant value = changes.value( key );
+ TagLib::String field = fieldName( key );
+
+- if( !field.isNull() && !field.isEmpty() )
++ if( !field.isEmpty() )
+ {
+ if( key == Meta::valRating )
+ m_tag->addValue( field, Qt4QStringToTString( QString::number( value.toFloat() / 10.0 ) ) );
+diff --git a/shared/tag_helpers/ASFTagHelper.cpp b/shared/tag_helpers/ASFTagHelper.cpp
+index 241e93d714..772728b58f 100644
+--- a/shared/tag_helpers/ASFTagHelper.cpp
++++ b/shared/tag_helpers/ASFTagHelper.cpp
+@@ -107,7 +107,7 @@ ASFTagHelper::setTags( const Meta::FieldHash &changes )
+ QVariant value = changes.value( key );
+ TagLib::String field = fieldName( key );
+
+- if( !field.isNull() && !field.isEmpty() )
++ if( !field.isEmpty() )
+ {
+ if( key == Meta::valHasCover )
+ continue;
+diff --git a/shared/tag_helpers/ID3v2TagHelper.cpp b/shared/tag_helpers/ID3v2TagHelper.cpp
+index ea9281dc30..7dd98062bc 100644
+--- a/shared/tag_helpers/ID3v2TagHelper.cpp
++++ b/shared/tag_helpers/ID3v2TagHelper.cpp
+@@ -187,7 +187,7 @@ ID3v2TagHelper::setTags( const Meta::FieldHash &changes )
+ QVariant value = changes.value( key );
+ TagLib::ByteVector field( fieldName( key ).toCString() );
+
+- if( !field.isNull() && !field.isEmpty() )
++ if( !field.isEmpty() )
+ {
+ if( key == Meta::valHasCover )
+ continue;
+diff --git a/shared/tag_helpers/MP4TagHelper.cpp b/shared/tag_helpers/MP4TagHelper.cpp
+index 7a28b4473c..21f586146e 100644
+--- a/shared/tag_helpers/MP4TagHelper.cpp
++++ b/shared/tag_helpers/MP4TagHelper.cpp
+@@ -53,8 +53,8 @@ MP4TagHelper::tags() const
+ {
+ Meta::FieldHash data = TagHelper::tags();
+
+- TagLib::MP4::ItemListMap map = m_tag->itemListMap();
+- for( TagLib::MP4::ItemListMap::ConstIterator it = map.begin(); it != map.end(); ++it )
++ TagLib::MP4::ItemMap map = m_tag->itemMap();
++ for( TagLib::MP4::ItemMap::ConstIterator it = map.begin(); it != map.end(); ++it )
+ {
+ qint64 field;
+ QString value = TStringToQString( it->second.toStringList().toString( '\n' ) );
+@@ -106,21 +106,21 @@ MP4TagHelper::setTags( const Meta::FieldHash &changes )
+ QVariant value = changes.value( key );
+ TagLib::String field = fieldName( key );
+
+- if( !field.isNull() && !field.isEmpty() )
++ if( !field.isEmpty() )
+ {
+ // http://gitorious.org/~jefferai/xdg-specs/jefferais-xdg-specs/blobs/mediaspecs/specifications/FMPSpecs/specification.txt sais that mp4 tags should be saved as strings
+ if( key == Meta::valHasCover )
+ continue;
+ else if( key == Meta::valRating )
+- m_tag->itemListMap()[field] = TagLib::StringList( Qt4QStringToTString( QString::number( value.toFloat() / 10.0 ) ) );
++ m_tag->setItem(field, TagLib::StringList( Qt4QStringToTString( QString::number( value.toFloat() / 10.0 ) ) ));
+ else if( key == Meta::valScore )
+- m_tag->itemListMap()[field] = TagLib::StringList( Qt4QStringToTString( QString::number( value.toFloat() / 100.0 ) ) );
++ m_tag->setItem(field, TagLib::StringList( Qt4QStringToTString( QString::number( value.toFloat() / 100.0 ) ) ));
+ else if( key == Meta::valBpm || key == Meta::valDiscNr )
+- m_tag->itemListMap()[field] = TagLib::MP4::Item( value.toInt(), 0 );
++ m_tag->setItem(field, TagLib::MP4::Item( value.toInt(), 0 ));
+ else if( key == Meta::valCompilation )
+- m_tag->itemListMap()[field] = TagLib::MP4::Item( value.toBool() );
++ m_tag->setItem(field, TagLib::MP4::Item( value.toBool() ));
+ else
+- m_tag->itemListMap()[field] = TagLib::StringList( Qt4QStringToTString( value.toString() ) );
++ m_tag->setItem(field, TagLib::StringList( Qt4QStringToTString( value.toString() ) ));
+
+ modified = true;
+ }
+@@ -130,7 +130,7 @@ MP4TagHelper::setTags( const Meta::FieldHash &changes )
+ if( uidPair.first == UIDInvalid )
+ continue;
+
+- m_tag->itemListMap()[uidFieldName( uidPair.first )] = TagLib::StringList( Qt4QStringToTString( uidPair.second ) );
++ m_tag->setItem(uidFieldName( uidPair.first ), TagLib::StringList( Qt4QStringToTString( uidPair.second ) ));
+ modified = true;
+ }
+ }
+@@ -141,9 +141,9 @@ MP4TagHelper::setTags( const Meta::FieldHash &changes )
+ bool
+ MP4TagHelper::hasEmbeddedCover() const
+ {
+- TagLib::MP4::ItemListMap map = m_tag->itemListMap();
++ TagLib::MP4::ItemMap map = m_tag->itemMap();
+ TagLib::String name = fieldName( Meta::valHasCover );
+- for( TagLib::MP4::ItemListMap::ConstIterator it = map.begin(); it != map.end(); ++it )
++ for( TagLib::MP4::ItemMap::ConstIterator it = map.begin(); it != map.end(); ++it )
+ {
+ if( it->first == name )
+ {
+@@ -162,9 +162,9 @@ MP4TagHelper::hasEmbeddedCover() const
+ QImage
+ MP4TagHelper::embeddedCover() const
+ {
+- TagLib::MP4::ItemListMap map = m_tag->itemListMap();
++ TagLib::MP4::ItemMap map = m_tag->itemMap();
+ TagLib::String name = fieldName( Meta::valHasCover );
+- for( TagLib::MP4::ItemListMap::ConstIterator it = map.begin(); it != map.end(); ++it )
++ for( TagLib::MP4::ItemMap::ConstIterator it = map.begin(); it != map.end(); ++it )
+ {
+ if( it->first == name )
+ {
+@@ -200,7 +200,7 @@ MP4TagHelper::setEmbeddedCover( const QImage &cover )
+
+ covers.append( TagLib::MP4::CoverArt( TagLib::MP4::CoverArt::JPEG, TagLib::ByteVector( bytes.data(), bytes.count() ) ) );
+
+- m_tag->itemListMap()[fieldName( Meta::valHasCover )] = TagLib::MP4::Item( covers );
++ m_tag->setItem(fieldName( Meta::valHasCover ), TagLib::MP4::Item( covers ));
+
+ return true;
+ }
+diff --git a/shared/tag_helpers/StringHelper.cpp b/shared/tag_helpers/StringHelper.cpp
+index fd7e49b432..a8d2aa3e97 100644
+--- a/shared/tag_helpers/StringHelper.cpp
++++ b/shared/tag_helpers/StringHelper.cpp
+@@ -36,7 +36,7 @@ Meta::Tag::Qt4QStringToTString( const QString &str )
+ {
+ // Declare new var to prevent double call of trimmed func
+ QString val = str.trimmed();
+- return val.isEmpty() ? TagLib::String::null : TagLib::String( val.toUtf8().data(), TagLib::String::UTF8 );
++ return val.isEmpty() ? TagLib::String() : TagLib::String( val.toUtf8().data(), TagLib::String::UTF8 );
+ }
+
+ QString
+diff --git a/shared/tag_helpers/TagHelper.cpp b/shared/tag_helpers/TagHelper.cpp
+index 5a3b30009e..2607e53fe2 100644
+--- a/shared/tag_helpers/TagHelper.cpp
++++ b/shared/tag_helpers/TagHelper.cpp
+@@ -331,7 +331,7 @@ Meta::Tag::selectHelper( const TagLib::FileRef &fileref, bool forceCreation )
+ else if( TagLib::RIFF::WAV::File *file = dynamic_cast< TagLib::RIFF::WAV::File * >( fileref.file() ) )
+ {
+ if( file->tag() )
+- tagHelper = new ID3v2TagHelper( fileref.tag(), file->tag(), Amarok::Wav );
++ tagHelper = new ID3v2TagHelper( fileref.tag(), file->ID3v2Tag(), Amarok::Wav );
+ }
+ else if( TagLib::ASF::File *file = dynamic_cast< TagLib::ASF::File * >( fileref.file() ) )
+ {
+diff --git a/shared/tag_helpers/VorbisCommentTagHelper.cpp b/shared/tag_helpers/VorbisCommentTagHelper.cpp
+index f3ff542db6..95dc041d8a 100644
+--- a/shared/tag_helpers/VorbisCommentTagHelper.cpp
++++ b/shared/tag_helpers/VorbisCommentTagHelper.cpp
+@@ -151,7 +151,7 @@ VorbisCommentTagHelper::setTags( const Meta::FieldHash &changes )
+ QVariant value = changes.value( key );
+ TagLib::String field = fieldName( key );
+
+- if( !field.isNull() && !field.isEmpty() )
++ if( !field.isEmpty() )
+ {
+ if( key == Meta::valHasCover )
+ continue;
+diff --git a/utilities/afttagger/AFTTagger.cpp b/utilities/afttagger/AFTTagger.cpp
+index ae653e7beb..dace0b3305 100644
+--- a/utilities/afttagger/AFTTagger.cpp
++++ b/utilities/afttagger/AFTTagger.cpp
+@@ -467,7 +467,7 @@ AFTTagger::handleXiphComment( TagLib::Ogg::XiphComment *comment, TagLib::File *f
+ }
+ }
+ for( TagLib::StringList::ConstIterator iter = toRemove.begin(); iter != toRemove.end(); ++iter )
+- comment->removeField( *iter );
++ comment->removeFields( *iter );
+ }
+ if( newUid || ( nothingfound && !m_delete ) )
+ {
+@@ -611,10 +611,10 @@ AFTTagger::handleMP4( TagLib::MP4::File *file )
+ if( m_verbose )
+ m_textStream << tr( "INFO: File is a MP4 file, opening..." ) << Qt::endl;
+
+- TagLib::MP4::ItemListMap &itemsMap = file->tag()->itemListMap();
++ TagLib::MP4::ItemMap itemsMap = file->tag()->itemMap();
+ if( !itemsMap.isEmpty() )
+ {
+- for( TagLib::MP4::ItemListMap::Iterator it = itemsMap.begin(); it != itemsMap.end(); ++it )
++ for( TagLib::MP4::ItemMap::Iterator it = itemsMap.begin(); it != itemsMap.end(); ++it )
+ {
+ TagLib::String key = it->first;
+ const QString qkey = TStringToQString( key ).toUpper();
+--
+2.43.1
+
diff --git a/amarok.changes b/amarok.changes
index 57ced4c..c5d4992 100644
--- a/amarok.changes
+++ b/amarok.changes
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Tue Feb 20 15:51:16 UTC 2024 - Christophe Marin
+
+- Remove the taglib-extras dependency, it fails to build with
+ taglib 2 and will be dropped.
+- Add patch to support taglib 2:
+ * 0001-Use-non-deprecated-TagLib-functions-fix-build-with-T.patch
+
+-------------------------------------------------------------------
Sat Apr 08 11:25:21 UTC 2023 - fabian@ritter-vogt.de
- Switch from tar_scm to obs_scm
diff --git a/amarok.spec b/amarok.spec
index 3104c24..f4fd2f2 100644
--- a/amarok.spec
+++ b/amarok.spec
@@ -29,6 +29,8 @@ Patch1: flac_mimetype_bnc671581.diff
Patch2: disable-web-plugins-by-default.patch
# PATCH-FIX-OPENSUSE
Patch3: 0001-Work-around-QTBUG-75797-for-openQA.patch
+# PATCH-FIX-UPSTREAM
+Patch4: 0001-Use-non-deprecated-TagLib-functions-fix-build-with-T.patch
BuildRequires: extra-cmake-modules
BuildRequires: fdupes
BuildRequires: gdk-pixbuf-devel
@@ -95,12 +97,10 @@ BuildRequires: pkgconfig(libofa)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(taglib)
-BuildRequires: pkgconfig(taglib-extras)
BuildRequires: pkgconfig(zlib)
# needed by the context view
Requires: kirigami2
Requires: libqt5-qtquickcontrols2
-Requires: libtag-extras1 >= 1.0
Recommends: moodbar
Recommends: (gstreamer-plugins-ugly if phonon4qt5-backend-gstreamer)