public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/kde-sunset:master commit in: media-sound/amarok/, media-sound/amarok/files/
@ 2012-02-27 15:34 Roman v. Gemmeren
  0 siblings, 0 replies; 2+ messages in thread
From: Roman v. Gemmeren @ 2012-02-27 15:34 UTC (permalink / raw
  To: gentoo-commits

commit:     bc9aac83932a0eab8ec721a06ee9c4ce2d6bfd3a
Author:     Roman v. Gemmeren <strowi <AT> hasnoname <DOT> de>
AuthorDate: Mon Feb 27 15:33:16 2012 +0000
Commit:     Roman v. Gemmeren <strowi <AT> hasnoname <DOT> de>
CommitDate: Mon Feb 27 15:33:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/kde-sunset.git;a=commit;h=bc9aac83

make kaffeine compile with >=xine-lib-1.2
	new file:   amarok-1.4.10_p20090130-r5.ebuild
	new file:   files/amarok-1.4.10-xinelib-1.2.patch

---
 .../amarok/amarok-1.4.10_p20090130-r5.ebuild       |  125 ++++++++++++++++++++
 .../amarok/files/amarok-1.4.10-xinelib-1.2.patch   |   11 ++
 2 files changed, 136 insertions(+), 0 deletions(-)

diff --git a/media-sound/amarok/amarok-1.4.10_p20090130-r5.ebuild b/media-sound/amarok/amarok-1.4.10_p20090130-r5.ebuild
new file mode 100644
index 0000000..7f10d84
--- /dev/null
+++ b/media-sound/amarok/amarok-1.4.10_p20090130-r5.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/amarok/amarok-1.4.10_p20090130-r3.ebuild,v 1.8 2009/11/07 00:39:24 ssuominen Exp $
+
+EAPI="2"
+
+ARTS_REQUIRED="never"
+
+LANGS="af ar az be bg bn br ca cs cy da de el en_GB eo es et eu fa fi
+fr ga gl he hi hu id is it ja km ko ku lo lt mk ms nb nds ne nl nn pa
+pl pt pt_BR ro ru rw se sk sl sq sr sr@Latn ss sv ta tg th tr uk uz
+zh_CN zh_TW"
+
+LANGS_DOC="da de es et fr it nl pl pt pt_BR ru sv"
+
+USE_KEG_PACKAGING="1"
+
+inherit kde
+
+PKG_SUFFIX=""
+
+MY_P="${P/_*/}"
+S="${WORKDIR}/${MY_P}"
+
+SRC_URI="mirror://kde/stable/amarok/${PV/_*/}/src/${MY_P}.tar.bz2
+	mirror://kde-sunset/amarok-1.4.10-post20090130.diff.tar.bz2"
+
+DESCRIPTION="Advanced audio player based on KDE framework."
+HOMEPAGE="http://amarok.kde.org/"
+
+LICENSE="GPL-2"
+
+SLOT="3.5"
+KEYWORDS="amd64 ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE="mp4 mysql +amazon opengl postgres
+visualization ipod ifp real njb mtp musicbrainz daap
+python"
+# kde: enables compilation of the konqueror sidebar plugin
+
+# Blocking previous amarok-1.4:0 versions
+RDEPEND="
+	!<media-sound/amarok-1.4.10_p20090130-r2
+	=dev-lang/ruby-1.8*
+	>=media-libs/taglib-1.4
+	>=media-libs/xine-lib-1.1.2_pre20060328-r8
+	ifp? ( media-libs/libifp )
+	ipod? ( >=media-libs/libgpod-0.5.2 )
+	mp4? ( media-libs/libmp4v2 )
+	mtp? ( >=media-libs/libmtp-0.3.0 )
+	musicbrainz? ( media-libs/tunepimp )
+	mysql? ( >=virtual/mysql-4.0 )
+	njb? ( >=media-libs/libnjb-2.2.4 )
+	opengl? ( virtual/opengl )
+	postgres? ( dev-db/postgresql-base )
+	real? (
+		media-libs/alsa-lib
+		media-video/realplayer
+	)
+	visualization? (
+		media-libs/libsdl
+		=media-plugins/libvisual-plugins-0.4*
+	)
+"
+
+DEPEND="${RDEPEND}"
+
+RDEPEND="${RDEPEND}
+	app-arch/unzip
+	daap? ( www-servers/mongrel )
+	python? ( dev-python/PyQt )
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-1.4.9.1-libmtp-0.3.0-API.patch"
+	"${FILESDIR}/${PN}-1.4.10-gcc-4.3.patch"
+	"${FILESDIR}/${PN}-1.4.10-gcc44.patch"
+	"${FILESDIR}/${PN}-libmp4v2.patch"
+	"${FILESDIR}/${PN}-libmp4v2-2.patch"
+	"${FILESDIR}/${PN}-1.4.10-fix-autoconf-2.64.patch"
+	"${WORKDIR}/${PN}-1.4.10-post20090130.diff"
+	"${WORKDIR}/${PN}-1.4.10-desktop-entry.diff"
+	"${FILESDIR}/${PN}-1.4.10-xinelib-1.2.patch"
+)
+
+need-kde 3.5
+
+src_configure() {
+	# Extra, unsupported engines are forcefully disabled.
+	local myconf="
+		$(use_enable amazon)
+		$(use_enable mysql)
+		$(use_enable postgres postgresql)
+		$(use_with daap)
+		$(use_with ifp)
+		$(use_with ipod libgpod)
+		$(use_with mp4 mp4v2)
+		$(use_with mtp libmtp)
+		$(use_with musicbrainz)
+		$(use_with njb libnjb)
+		$(use_with opengl)
+		$(use_with real helix)
+		$(use_with visualization libvisual)
+		--with-xine
+		--without-nmm
+	"
+
+	kde_src_configure
+}
+
+src_install() {
+	kde_src_install
+
+	# As much as I respect Ian, I'd rather leave Amarok to use mongrel
+	# from Portage, for security and policy reasons.
+	rm -rf "${D}${KDEDIR}"/share/apps/amarok/ruby_lib/rbconfig \
+		"${D}${KDEDIR}"/share/apps/amarok/ruby_lib/mongrel* \
+		"${D}${KDEDIR}"/share/apps/amarok/ruby_lib/rubygems* \
+		"${D}${KDEDIR}"/share/apps/amarok/ruby_lib/gem* \
+		"${D}${KDEDIR}"/$(get_libdir)/ruby_lib
+
+	if ! use python; then
+		rm -r "${D}${KDEDIR}"/share/apps/amarok/scripts/webcontrol \
+			|| die "Unable to remove webcontrol."
+	fi
+}

diff --git a/media-sound/amarok/files/amarok-1.4.10-xinelib-1.2.patch b/media-sound/amarok/files/amarok-1.4.10-xinelib-1.2.patch
new file mode 100644
index 0000000..d202098
--- /dev/null
+++ b/media-sound/amarok/files/amarok-1.4.10-xinelib-1.2.patch
@@ -0,0 +1,11 @@
+--- amarok/src/engine/xine/xine-engine.cpp~	2008-08-13 22:21:51.000000000 +0100
++++ amarok/src/engine/xine/xine-engine.cpp	2012-02-26 08:46:25.000000000 +0000
+@@ -1148,7 +1148,7 @@
+ 
+     emit statusText(i18n("Getting AudioCD contents..."));
+ 
+-    xine_urls = xine_get_autoplay_mrls(m_xine, "CD", &num);
++    xine_urls = (char**)xine_get_autoplay_mrls(m_xine, "CD", &num);
+ 
+     if (xine_urls) {
+         while (xine_urls[i]) {



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/kde-sunset:master commit in: media-sound/amarok/, media-sound/amarok/files/
@ 2013-12-30  1:14 Keiji Costantini
  0 siblings, 0 replies; 2+ messages in thread
From: Keiji Costantini @ 2013-12-30  1:14 UTC (permalink / raw
  To: gentoo-commits

commit:     947cfb57229fa355556103bc50778b54a8bde7a0
Author:     Keiji Costantini <strites <AT> gmail <DOT> com>
AuthorDate: Mon Dec 30 01:14:01 2013 +0000
Commit:     Keiji Costantini <strites <AT> gmail <DOT> com>
CommitDate: Mon Dec 30 01:14:01 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/kde-sunset.git;a=commit;h=947cfb57

Amarok fixes to compile with gcc 4.7 and a (somewhat) recent environment

---
 .../amarok/amarok-1.4.10_p20090130-r6.ebuild       | 129 ++++++++
 media-sound/amarok/files/amarok-gcc-4.6.patch      |  22 ++
 .../amarok/files/amarok-helix-constchar.patch      |  11 +
 media-sound/amarok/files/amarok-libmp4v2-3.patch   | 330 +++++++++++++++++++++
 4 files changed, 492 insertions(+)

diff --git a/media-sound/amarok/amarok-1.4.10_p20090130-r6.ebuild b/media-sound/amarok/amarok-1.4.10_p20090130-r6.ebuild
new file mode 100644
index 0000000..2f17e2a
--- /dev/null
+++ b/media-sound/amarok/amarok-1.4.10_p20090130-r6.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/amarok/amarok-1.4.10_p20090130-r3.ebuild,v 1.8 2009/11/07 00:39:24 ssuominen Exp $
+
+EAPI="2"
+
+ARTS_REQUIRED="never"
+
+LANGS="af ar az be bg bn br ca cs cy da de el en_GB eo es et eu fa fi
+fr ga gl he hi hu id is it ja km ko ku lo lt mk ms nb nds ne nl nn pa
+pl pt pt_BR ro ru rw se sk sl sq sr sr@Latn ss sv ta tg th tr uk uz
+zh_CN zh_TW"
+
+LANGS_DOC="da de es et fr it nl pl pt pt_BR ru sv"
+
+USE_KEG_PACKAGING="1"
+
+inherit kde
+
+PKG_SUFFIX=""
+
+MY_P="${P/_*/}"
+S="${WORKDIR}/${MY_P}"
+
+SRC_URI="mirror://kde/stable/amarok/${PV/_*/}/src/${MY_P}.tar.bz2
+	mirror://kde-sunset/amarok-1.4.10-post20090130.diff.tar.bz2"
+
+DESCRIPTION="Advanced audio player based on KDE framework."
+HOMEPAGE="http://amarok.kde.org/"
+
+LICENSE="GPL-2"
+
+SLOT="3.5"
+KEYWORDS="amd64 ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE="mp4 mysql +amazon opengl postgres
+visualization ipod ifp real njb mtp musicbrainz daap
+python"
+# kde: enables compilation of the konqueror sidebar plugin
+
+# Blocking previous amarok-1.4:0 versions
+RDEPEND="
+	!<media-sound/amarok-1.4.10_p20090130-r2
+	=dev-lang/ruby-1.8*
+	>=media-libs/taglib-1.4
+	>=media-libs/xine-lib-1.1.2_pre20060328-r8
+	ifp? ( media-libs/libifp )
+	ipod? ( >=media-libs/libgpod-0.5.2 )
+	mp4? ( media-libs/libmp4v2 )
+	mtp? ( >=media-libs/libmtp-0.3.0 )
+	musicbrainz? ( media-libs/tunepimp )
+	mysql? ( >=virtual/mysql-4.0 )
+	njb? ( >=media-libs/libnjb-2.2.4 )
+	opengl? ( virtual/opengl )
+	postgres? ( dev-db/postgresql-base )
+	real? (
+		media-libs/alsa-lib
+		media-video/realplayer
+	)
+	visualization? (
+		media-libs/libsdl
+		=media-plugins/libvisual-plugins-0.4*
+	)
+"
+
+DEPEND="${RDEPEND}"
+
+RDEPEND="${RDEPEND}
+	app-arch/unzip
+	daap? ( www-servers/mongrel )
+	python? ( dev-python/PyQt )
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-1.4.9.1-libmtp-0.3.0-API.patch"
+	"${FILESDIR}/${PN}-1.4.10-gcc-4.3.patch"
+	"${FILESDIR}/${PN}-1.4.10-gcc44.patch"
+	"${FILESDIR}/${PN}-gcc-4.6.patch"
+	"${FILESDIR}/${PN}-libmp4v2.patch"
+	"${FILESDIR}/${PN}-libmp4v2-2.patch"
+	"${FILESDIR}/${PN}-libmp4v2-3.patch"
+	"${FILESDIR}/${PN}-1.4.10-fix-autoconf-2.64.patch"
+	"${FILESDIR}/${PN}-qt3-4.7.patch"
+	"${WORKDIR}/${PN}-1.4.10-post20090130.diff"
+	"${WORKDIR}/${PN}-1.4.10-desktop-entry.diff"
+	"${FILESDIR}/${PN}-1.4.10-xinelib-1.2.patch"
+	"${FILESDIR}/${PN}-helix-constchar.patch"
+)
+
+need-kde 3.5
+
+src_configure() {
+	# Extra, unsupported engines are forcefully disabled.
+	local myconf="
+		$(use_enable amazon)
+		$(use_enable mysql)
+		$(use_enable postgres postgresql)
+		$(use_with daap)
+		$(use_with ifp)
+		$(use_with ipod libgpod)
+		$(use_with mp4 mp4v2)
+		$(use_with mtp libmtp)
+		$(use_with musicbrainz)
+		$(use_with njb libnjb)
+		$(use_with opengl)
+		$(use_with real helix)
+		$(use_with visualization libvisual)
+		--with-xine
+		--without-nmm
+	"
+
+	kde_src_configure
+}
+
+src_install() {
+	kde_src_install
+
+	# As much as I respect Ian, I'd rather leave Amarok to use mongrel
+	# from Portage, for security and policy reasons.
+	rm -rf "${D}${KDEDIR}"/share/apps/amarok/ruby_lib/rbconfig \
+		"${D}${KDEDIR}"/share/apps/amarok/ruby_lib/mongrel* \
+		"${D}${KDEDIR}"/share/apps/amarok/ruby_lib/rubygems* \
+		"${D}${KDEDIR}"/share/apps/amarok/ruby_lib/gem* \
+		"${D}${KDEDIR}"/$(get_libdir)/ruby_lib
+
+	if ! use python; then
+		rm -r "${D}${KDEDIR}"/share/apps/amarok/scripts/webcontrol \
+			|| die "Unable to remove webcontrol."
+	fi
+}

diff --git a/media-sound/amarok/files/amarok-gcc-4.6.patch b/media-sound/amarok/files/amarok-gcc-4.6.patch
new file mode 100644
index 0000000..ccd73c9
--- /dev/null
+++ b/media-sound/amarok/files/amarok-gcc-4.6.patch
@@ -0,0 +1,22 @@
+diff -urN amarok-1.4.10.orig/amarok/src/actionclasses.cpp amarok-1.4.10/amarok/src/actionclasses.cpp
+--- amarok-1.4.10.orig/amarok/src/actionclasses.cpp	2008-08-14 01:21:51.000000000 +0400
++++ amarok-1.4.10/amarok/src/actionclasses.cpp	2011-06-12 16:47:59.273750623 +0400
+@@ -30,6 +30,8 @@
+ #include <ktoolbarbutton.h>
+ #include <kurl.h>
+ 
++extern KAboutData aboutData;
++
+ namespace Amarok
+ {
+     bool repeatNone() { return AmarokConfig::repeat() == AmarokConfig::EnumRepeat::Off; }
+@@ -171,8 +173,6 @@
+ KPopupMenu*
+ Menu::helpMenu( QWidget *parent ) //STATIC
+ {
+-    extern KAboutData aboutData;
+-
+     if ( s_helpMenu == 0 )
+         s_helpMenu = new KHelpMenu( parent, &aboutData, Amarok::actionCollection() );
+ 
+

diff --git a/media-sound/amarok/files/amarok-helix-constchar.patch b/media-sound/amarok/files/amarok-helix-constchar.patch
new file mode 100644
index 0000000..0118fad
--- /dev/null
+++ b/media-sound/amarok/files/amarok-helix-constchar.patch
@@ -0,0 +1,11 @@
+--- amarok-1.4.10/amarok/src/engine/helix/helix-sp/helix-sp.cpp
++++ amarok-1.4.10/amarok/src/engine/helix/helix-sp/helix-sp.cpp
+@@ -1509,7 +1509,7 @@
+          delete [] ppctrl[playerIndex]->pszURL;
+ 
+       // see if the file is already in the form of a url
+-      char *tmp = strstr(file, "://");
++      const char *tmp = strstr(file, "://");
+       if (!tmp)
+       {
+          char pszURLOrig[MAXPATHLEN];

diff --git a/media-sound/amarok/files/amarok-libmp4v2-3.patch b/media-sound/amarok/files/amarok-libmp4v2-3.patch
new file mode 100644
index 0000000..552974a
--- /dev/null
+++ b/media-sound/amarok/files/amarok-libmp4v2-3.patch
@@ -0,0 +1,330 @@
+--- a/amarok/configure.in.in	
++++ a/amarok/configure.in.in	
+@@ -995,15 +995,28 @@ if test "$have_mp4v2" != "no"; then
+     ac_cppflags_save=$CPPFLAGS
+     CPPFLAGS="$CPPFLAGS -I."
+     AC_CHECK_HEADERS(systems.h)
+-    AC_CHECK_HEADERS([mp4v2/mp4v2.h], [have_mp4_h=yes], [],
++    AC_CHECK_HEADERS([mp4v2/mp4v2.h], [have_mp4v2_h=yes], [],
+         [#ifdef HAVE_SYSTEMS_H
+          # include <systems.h>
+          #endif
+         ])
++    if test "$have_mp4v2_h" = "yes"; then
++        AC_DEFINE(HAVE_MP4V2_H, 1, [have mp4v2 h])
++    else
++        AC_CHECK_HEADERS([mp4.h], [have_mp4_h=yes], [],
++            [#ifdef HAVE_SYSTEMS_H
++             # include <systems.h>
++             #endif
++            ])
++        if test "$have_mp4_h" = "yes"; then
++            AC_DEFINE(HAVE_MP4_H, 1, [have mp4 h])
++            have_mp4v2_h=yes
++        fi
++    fi
+ 
+     AC_CHECK_LIB( mp4v2, MP4Read, have_mp4v2=yes, have_mp4v2=no )
+ 
+-    if test "$have_mp4v2" = "yes" -a "$have_mp4_h" = "yes"; then
++    if test "$have_mp4v2" = "yes" -a "$have_mp4v2_h" = "yes"; then
+         AC_DEFINE(HAVE_MP4V2, 1, [have mp4v2])
+         MP4V2_INCLUDES="-I$mp4v2_dir/include"
+         MP4V2_LIBS="-L$mp4v2_dir/lib -lmp4v2"
+--- a/amarok/src/metadata/mp4/mp4file.cpp	
++++ a/amarok/src/metadata/mp4/mp4file.cpp	
+@@ -23,6 +23,8 @@ email                : aumuell@reserv.at
+  *   MA  02110-1301  USA                                                   *
+  ***************************************************************************/
+ 
++#include <config.h>
++
+ #include "mp4file.h"
+ 
+ #include "mp4tag.h"
+@@ -34,7 +36,11 @@ email                : aumuell@reserv.at
+ #include <stdlib.h>
+ #include <sys/types.h>
+ 
++#ifdef HAVE_MP4V2_H
++#define USE_ITMF_TAGS
++#else
+ #define MP4V2_HAS_WRITE_BUG 1
++#endif
+ 
+ namespace TagLib {
+ ////////////////////////////////////////////////////////////////////////////////
+@@ -102,6 +108,11 @@ bool MP4::File::save()
+         return false;
+     }
+ 
++#ifdef USE_ITMF_TAGS
++    const MP4Tags* filetags = MP4TagsAlloc();
++    MP4TagsFetch(filetags, handle);
++#endif
++
+ #ifdef MP4V2_HAS_WRITE_BUG
+     /* according to gtkpod we have to delete all meta data before modifying it,
+        save the stuff we would not touch */
+@@ -117,7 +128,14 @@ bool MP4::File::save()
+ #endif
+ 
+ 
+-
++#ifdef USE_ITMF_TAGS
++    MP4TagsSetName(filetags, mp4tag->title().isNull() ? "" : mp4tag->title().toCString(true));
++    MP4TagsSetArtist(filetags, mp4tag->artist().isNull() ? "" : mp4tag->artist().toCString(true));
++    MP4TagsSetAlbum(filetags, mp4tag->album().isNull() ? "" : mp4tag->album().toCString(true));
++    MP4TagsSetComments(filetags, mp4tag->comment().isNull() ? "" : mp4tag->comment().toCString(true));
++    MP4TagsSetGenre(filetags, mp4tag->genre().isNull() ? "" : mp4tag->genre().toCString(true));
++    MP4TagsSetComposer(filetags, mp4tag->composer().isNull() ? "" : mp4tag->composer().toCString(true));
++#else
+ #define setmeta(val, tag) \
+     if(mp4tag->val().isNull()) { \
+         /*MP4DeleteMetadata##tag(handle);*/ \
+@@ -125,27 +143,65 @@ bool MP4::File::save()
+     } else { \
+         MP4SetMetadata##tag(handle, mp4tag->val().toCString(true)); \
+     }
+-
+     setmeta(title, Name);
+     setmeta(artist, Artist);
+     setmeta(album, Album);
+     setmeta(comment, Comment);
+     setmeta(genre, Genre);
++    setmeta(composer, Writer);
++#endif
+ 
+     char buf[100] = "";
+     if(mp4tag->year())
+         snprintf(buf, sizeof(buf), "%u", mp4tag->year());
++#ifdef USE_ITMF_TAGS
++    MP4TagsSetReleaseDate(filetags, buf);
++#else
+     MP4SetMetadataYear(handle, buf);
++#endif
+     u_int16_t t1, t2;
++
++#ifdef USE_ITMF_TAGS
++    MP4TagTrack track = *filetags->track;
++    track.index = t1;
++    MP4TagsSetTrack(filetags, &track);
++#else
+     MP4GetMetadataTrack(handle, &t1, &t2);
+     MP4SetMetadataTrack(handle, mp4tag->track(), t2);
+-    if(mp4tag->bpm() != 0)
++#endif
++    if(mp4tag->bpm() != 0) {
++#ifdef USE_ITMF_TAGS
++        u_int16_t tempo = mp4tag->bpm();
++        MP4TagsSetTempo(filetags, &tempo);
++#else
+         MP4SetMetadataTempo(handle, mp4tag->bpm());
++#endif
++    }
+     if(mp4tag->compilation() != MP4::Tag::Undefined) {
++#ifdef USE_ITMF_TAGS
++        u_int8_t compilation = mp4tag->compilation();
++        MP4TagsSetCompilation(filetags, &compilation);
++#else
+         MP4SetMetadataCompilation(handle, mp4tag->compilation());
++#endif
+     }
+ 
++#ifdef USE_ITMF_TAGS
++    if(mp4tag->cover().size()) {
++        MP4TagArtwork art;
++        art.size = mp4tag->cover().size();
++        art.data = mp4tag->cover().size() ? const_cast<u_int8_t *>( reinterpret_cast<const u_int8_t *>( mp4tag->cover().data() ) ) : 0;
++        art.type = MP4_ART_UNDEFINED; // delegate typing to libmp4v2
++        if(filetags->artworkCount > 0) {
++            MP4TagsSetArtwork(filetags, 0, &art);
++        }
++        else {
++            MP4TagsAddArtwork(filetags, &art);
++        }
++    }
++#else
+     MP4SetMetadataCoverArt(handle, mp4tag->cover().size() ? const_cast<u_int8_t *>( reinterpret_cast<const u_int8_t *>( mp4tag->cover().data() ) ) : 0, mp4tag->cover().size());
++#endif
+ 
+ #ifdef MP4V2_HAS_WRITE_BUG
+     // set the saved data again
+@@ -159,6 +215,10 @@ bool MP4::File::save()
+     }
+ #endif
+ 
++#ifdef USE_ITMF_TAGS
++    MP4TagsStore(filetags, handle);
++    MP4TagsFree(filetags);
++#endif
+     MP4Close(handle);
+ 
+     mp4file = MP4Read(name());
+--- a/amarok/src/metadata/mp4/mp4properties.h	
++++ a/amarok/src/metadata/mp4/mp4properties.h	
+@@ -22,13 +22,20 @@ email                : andrew.leadbetter@gmail.com
+ #ifndef TAGLIB_MP4PROPERTIES_H
+ #define TAGLIB_MP4PROPERTIES_H
+ 
++#include <config.h>
++
+ #include <audioproperties.h>
+ #include <tstring.h>
+-#include <mp4v2/mp4v2.h>
++#ifdef HAVE_MP4V2_H
++# include <mp4v2/mp4v2.h>
++#endif
++#ifdef HAVE_MP4_H
++# include <mp4.h>
+ // mp4.h drags in mp4_config.h that defines these
+ // get rid of them so they don't conflict with our config.h
+ #undef VERSION
+ #undef PACKAGE
++#endif
+ 
+ namespace TagLib {
+ 
+--- a/amarok/src/metadata/mp4/mp4tag.cpp	
++++ a/amarok/src/metadata/mp4/mp4tag.cpp	
+@@ -20,6 +20,8 @@ email                : andrew.leadbetter@gmail.com
+  *   MA  02110-1301  USA                                                   *
+  ***************************************************************************/
+ 
++#include <config.h>
++
+ #include "mp4tag.h"
+ 
+ #include <tag.h>
+@@ -29,6 +31,10 @@ email                : andrew.leadbetter@gmail.com
+ #include <stdlib.h>
+ #include <sys/types.h>
+ 
++#ifdef HAVE_MP4V2_H
++#define USE_ITMF_TAGS
++#endif
++
+ using namespace TagLib;
+ 
+ MP4::Tag::Tag() : TagLib::Tag::Tag() {
+@@ -67,21 +73,66 @@ void MP4::Tag::duplicate(const Tag *source, Tag *target, bool overwrite) {
+     // Duplicate standard information
+     Tag::duplicate(source, target, overwrite);
+ 
+-    if (overwrite || target->compilation() == Undefined && source->compilation() != Undefined)
++    if ((overwrite || target->compilation() == Undefined) && (source->compilation() != Undefined)) {
+         target->setCompilation(source->compilation());
++    }
+ 
+-    if (overwrite || target->cover().size() == 0)
++    if (overwrite || target->cover().size() == 0) {
+         target->setCover(source->cover());
++    }
+ }
+ 
+ void MP4::Tag::readTags( MP4FileHandle mp4file )
+ {
+     // Now parse tag.
++#ifdef USE_ITMF_TAGS
++    const MP4Tags* filetags = MP4TagsAlloc();
++    MP4TagsFetch(filetags, mp4file);
++
++    if(filetags->name != NULL) {
++        m_title = String(filetags->name, String::UTF8);
++    }
++    if(filetags->artist != NULL) {
++        m_artist = String(filetags->artist, String::UTF8);
++    }
++    if(filetags->comments != NULL) {
++        m_comment = String(filetags->comments, String::UTF8);
++    }
++    if(filetags->releaseDate != NULL) {
++        m_year = strtol(filetags->releaseDate, NULL, 0);
++    }
++    if(filetags->album != NULL) {
++        m_album = String(filetags->album, String::UTF8);
++    }
++    if(filetags->track != NULL) {
++        m_track = filetags->track->index;
++    }
++    if(filetags->disk != NULL) {
++        m_disk = filetags->disk->index;
++    }
++    if(filetags->tempo != NULL) {
++        m_bpm = *filetags->tempo;
++    }
++    if(filetags->compilation != NULL) {
++        m_compilation = *filetags->compilation;
++    }
++    if(filetags->genre != NULL) {
++        m_genre = String(filetags->genre, String::UTF8);
++    }
++    if(filetags->composer != NULL) {
++        m_composer = String(filetags->composer, String::UTF8);
++    }
++    if(filetags->artworkCount > 0) {
++        m_image.setData(reinterpret_cast<const char *>( filetags->artwork[0].data ), filetags->artwork[0].size);
++    }
++    MP4TagsFree(filetags);
++#else
+     char *value;
+     uint8_t boolvalue;
+     uint16_t numvalue, numvalue2;
+     uint8_t *image;
+     uint32_t imageSize;
++
+     if (MP4GetMetadataName(mp4file, &value) && value != NULL) {
+         m_title = String(value, String::UTF8);
+         free(value);
+@@ -128,4 +179,5 @@ void MP4::Tag::readTags( MP4FileHandle mp4file )
+         m_image.setData(reinterpret_cast<const char *>( image ), imageSize);
+         free(image);
+     }
++#endif
+ }
+--- a/amarok/src/metadata/mp4/mp4tag.h	
++++ a/amarok/src/metadata/mp4/mp4tag.h	
+@@ -21,9 +21,16 @@ email                : andrew.leadbetter@gmail.com
+ #ifndef TAGLIB_MP4TAG_H
+ #define TAGLIB_MP4TAG_H
+ 
++#include <config.h>
++
+ #include <tag.h>
+ #include "mp4file.h"
+-#include <mp4v2/mp4v2.h>
++#ifdef HAVE_MP4V2_H
++# include <mp4v2/mp4v2.h>
++#endif
++#ifdef HAVE_MP4_H
++# include <mp4.h>
++#endif
+ 
+ namespace TagLib {
+ 
+--- a/amarok/src/metadata/mp4/taglib_mp4filetyperesolver.cpp	
++++ a/amarok/src/metadata/mp4/taglib_mp4filetyperesolver.cpp	
+@@ -36,7 +36,11 @@ TagLib::File *MP4FileTypeResolver::createFile(const char *fileName,
+                 || !strcasecmp(ext, ".mp4")
+                 || !strcasecmp(ext, ".m4v") || !strcasecmp(ext, ".mp4v")))
+     {
+-        MP4FileHandle h = MP4Read(fileName, 0);
++#if defined(MP4V2_PROJECT_version_hex) && MP4V2_PROJECT_version_hex >= 0x00020000
++        MP4FileHandle h = ::MP4Read(fileName);
++#else
++        MP4FileHandle h = ::MP4Read(fileName, 0);
++#endif
+         if(MP4_INVALID_FILE_HANDLE == h)
+         {
+             return 0;
+--- a/config.h.in	
++++ a/config.h.in	
+@@ -106,6 +106,9 @@ 
+ /* have mp4v2 */
+ #undef HAVE_MP4V2
+ 
++/* Define to 1 if you have the <mp4v2/mp4v2.h> header file. */
++#undef HAVE_MP4V2_H
++
+ /* Define to 1 if you have the <mp4.h> header file. */
+ #undef HAVE_MP4_H


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-30  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-27 15:34 [gentoo-commits] proj/kde-sunset:master commit in: media-sound/amarok/, media-sound/amarok/files/ Roman v. Gemmeren
  -- strict thread matches above, loose matches on Subject: below --
2013-12-30  1:14 Keiji Costantini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox