dev-libs/libcdio: Fix build with USE=cddb
authorAndreas Sturmlechner <asturm@gentoo.org>
Mon, 27 Nov 2017 17:53:48 +0000 (18:53 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Mon, 27 Nov 2017 17:58:02 +0000 (18:58 +0100)
Reported-by: Nikolaj Ĺ ujskij <skrattaren@yandex.ru>
Thanks-to: Bernard Cafarelli <voyageur@gentoo.org>
Closes: https://bugs.gentoo.org/638576
Package-Manager: Portage-2.3.16, Repoman-2.3.6

dev-libs/libcdio/files/libcdio-1.0.0-cddb.patch [new file with mode: 0644]
dev-libs/libcdio/libcdio-1.0.0-r1.ebuild

diff --git a/dev-libs/libcdio/files/libcdio-1.0.0-cddb.patch b/dev-libs/libcdio/files/libcdio-1.0.0-cddb.patch
new file mode 100644 (file)
index 0000000..b3781d2
--- /dev/null
@@ -0,0 +1,37 @@
+From 4305bc1e093e4341aeddb857bd1e6203228000cb Mon Sep 17 00:00:00 2001
+From: "R. Bernstein" <rocky@gnu.org>
+Date: Sat, 25 Nov 2017 14:03:37 -0500
+Subject: Fix breakage caused by unshadowing i_first_track
+
+Reported and patch by KO Myung-Hun
+---
+ src/cdda-player.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/cdda-player.c b/src/cdda-player.c
+index efeee19..333e1f5 100644
+--- a/src/cdda-player.c
++++ b/src/cdda-player.c
+@@ -531,8 +531,8 @@ static void
+ get_cddb_disc_info(CdIo_t *p_cdio)
+ {
+ #ifdef HAVE_CDDB
+-  b_db = init_cddb(p_cdio, &p_conn, &p_cddb_disc, xperror, i_first_track,
+-                   i_tracks, &i_cddb_matches);
++  b_db = init_cddb(p_cdio, &p_conn, &p_cddb_disc, xperror, i_first_track_global,
++                   i_tracks_global, &i_cddb_matches);
+   if (b_db) {
+     int i_year;
+     i_year = atoi(year);
+@@ -831,7 +831,7 @@ get_cddb_track_info(track_t i_track)
+ {
+ #ifdef HAVE_CDDB
+   cddb_track_t *t = cddb_disc_get_track(p_cddb_disc,
+-                                        i_track - i_first_track);
++                                        i_track - i_first_track_global);
+   if (t) {
+     cddb_track_set_title(t, title);
+     cddb_track_set_artist(t, artist);
+-- 
+cgit v1.0-41-gc330
+
index 251281eb2413a26c4acc2ee775a4b948118c3173..8f43e92c8f96d09d79ac3e04b13cd69b7bd10d0d 100644 (file)
@@ -2,6 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
+
 inherit autotools libtool ltprune multilib-minimal
 
 DESCRIPTION="A library to encapsulate CD-ROM reading and control"
@@ -33,7 +34,10 @@ MULTILIB_WRAPPED_HEADERS=(
        /usr/include/cdio/version.h
 )
 
-PATCHES=( "${FILESDIR}/${P}-version.patch" )
+PATCHES=(
+       "${FILESDIR}/${P}-version.patch"
+       "${FILESDIR}/${P}-cddb.patch"
+)
 
 src_prepare() {
        default