View | Details | Raw Unified | Return to bug 105220 | Differences between
and this patch

Collapse All | Expand All

(-)/home/makc/porting/ports/audio/kid3/Makefile (-10 / +2 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	kid3
8
PORTNAME=	kid3
9
PORTVERSION=	0.7
9
PORTVERSION=	0.7
10
PORTREVISION=	1
10
CATEGORIES=	audio kde
11
CATEGORIES=	audio kde
11
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITE_SUBDIR=	${PORTNAME}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
Lines 18-24 Link Here
18
		FLAC.7:${PORTSDIR}/audio/flac \
19
		FLAC.7:${PORTSDIR}/audio/flac \
19
		ogg.5:${PORTSDIR}/audio/libogg \
20
		ogg.5:${PORTSDIR}/audio/libogg \
20
		vorbis.3:${PORTSDIR}/audio/libvorbis \
21
		vorbis.3:${PORTSDIR}/audio/libvorbis \
21
		tunepimp-0.4.3:${PORTSDIR}/audio/libtunepimp-old
22
		tunepimp.5:${PORTSDIR}/audio/libtunepimp
22
23
23
USE_KDELIBS_VER=3
24
USE_KDELIBS_VER=3
24
USE_GMAKE=	yes
25
USE_GMAKE=	yes
Lines 26-39 Link Here
26
USE_GETTEXT=	yes
27
USE_GETTEXT=	yes
27
GNU_CONFIGURE=	yes
28
GNU_CONFIGURE=	yes
28
INSTALLS_ICONS=	yes
29
INSTALLS_ICONS=	yes
29
CONFIGURE_ARGS+=CFLAGS=-I${LOCALBASE}/include/tunepimp-0.4 \
30
		LDFLAGS=-L${LOCALBASE}/lib/tunepimp-0.4
31
32
post-patch:
33
	@${REINPLACE_CMD} -e 's|-ltunepimp|-ltunepimp-0.4|g' \
34
		-e 's|<tunepimp/tp_c.h>|<tunepimp-0.4/tunepimp/tp_c.h>|g' \
35
	${WRKSRC}/configure ${WRKSRC}/kid3/musicbrainzclient.h \
36
		${WRKSRC}/admin/Makefile
37
30
38
.include <bsd.port.pre.mk>
31
.include <bsd.port.pre.mk>
39
32
Lines 42-45 Link Here
42
.endif
35
.endif
43
36
44
.include <bsd.port.post.mk>
37
.include <bsd.port.post.mk>
45
(-)/home/makc/porting/ports/audio/kid3/files/patch-Makefile.in (+31 lines)
Line 0 Link Here
1
--- ./Makefile.in.orig	Tue Jun 27 23:34:40 2006
2
+++ ./Makefile.in	Sat Sep 23 01:27:55 2006
3
@@ -317,7 +317,7 @@
4
 #>+ 3
5
 	cd $(top_srcdir) && \
6
 	  $(AUTOMAKE) --gnu  Makefile
7
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/Makefile.in
8
+	cd $(top_srcdir) && perl admin/am_edit Makefile.in
9
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
10
 	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
11
 
12
@@ -740,9 +740,8 @@
13
 # Otherwise a system limit (for SysV at least) may be exceeded.
14
 .NOEXPORT:
15
 
16
-
17
 #>+ 2
18
-KDE_DIST=configure.files kid3_ru.qm build-stamp kid3_de.qm configure.in.in stamp-h.in subdirs Makefile.in kid3_de.html kid3_en.html Makefile.cvs kid3_es.qm LICENSE 
19
+KDE_DIST=stamp-h.in subdirs Makefile.in kid3_de.html configure.files kid3_en.html kid3_ru.qm kid3_de.qm Makefile.cvs configure.in.in kid3_es.qm LICENSE 
20
 
21
 #>+ 2
22
 docs-am:
23
@@ -751,7 +750,7 @@
24
 force-reedit:
25
 		cd $(top_srcdir) && \
26
 	  $(AUTOMAKE) --gnu  Makefile
27
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/Makefile.in
28
+	cd $(top_srcdir) && perl admin/am_edit Makefile.in
29
 
30
 
31
 #>+ 21
(-)/home/makc/porting/ports/audio/kid3/files/patch-admin__Makefile.in (+31 lines)
Line 0 Link Here
1
--- ./admin/Makefile.in.orig	Tue Jun 27 23:34:40 2006
2
+++ ./admin/Makefile.in	Sat Sep 23 01:27:55 2006
3
@@ -295,7 +295,7 @@
4
 #>+ 3
5
 	cd $(top_srcdir) && \
6
 	  $(AUTOMAKE) --gnu  admin/Makefile
7
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/admin/Makefile.in
8
+	cd $(top_srcdir) && perl admin/am_edit admin/Makefile.in
9
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
10
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
11
 
12
@@ -451,9 +451,8 @@
13
 # Otherwise a system limit (for SysV at least) may be exceeded.
14
 .NOEXPORT:
15
 
16
-
17
 #>+ 2
18
-KDE_DIST=configure.in.bot.end bcheck.pl detect-autoconf.sh deps.am configure.in.min debianrules cvs.sh config.pl oldinclude.m4.in am_edit Makefile.common cvs-clean.pl Makefile.in Doxyfile.global acinclude.m4.in libtool.m4.in nmcheck Doxyfile.am conf.change.pl 
19
+KDE_DIST=configure.in.bot.end bcheck.pl cvs-clean.pl Makefile.in detect-autoconf.sh Doxyfile.global deps.am configure.in.min acinclude.m4.in debianrules libtool.m4.in nmcheck cvs.sh config.pl Doxyfile.am oldinclude.m4.in am_edit conf.change.pl Makefile.common 
20
 
21
 #>+ 2
22
 docs-am:
23
@@ -462,7 +461,7 @@
24
 force-reedit:
25
 		cd $(top_srcdir) && \
26
 	  $(AUTOMAKE) --gnu  admin/Makefile
27
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/admin/Makefile.in
28
+	cd $(top_srcdir) && perl admin/am_edit admin/Makefile.in
29
 
30
 
31
 #>+ 21
(-)/home/makc/porting/ports/audio/kid3/files/patch-configure (+261 lines)
Line 0 Link Here
1
--- ./configure.orig	Tue Jun 27 22:55:03 2006
2
+++ ./configure	Sat Sep 23 01:27:55 2006
3
@@ -31630,22 +31630,146 @@
4
 
5
 fi;
6
 if test "$with_musicbrainz" != "no"; then
7
+  if test "${ac_cv_header_tunepimp_0_5_tp_c_h+set}" = set; then
8
+  echo "$as_me:$LINENO: checking for tunepimp-0.5/tp_c.h" >&5
9
+echo $ECHO_N "checking for tunepimp-0.5/tp_c.h... $ECHO_C" >&6
10
+if test "${ac_cv_header_tunepimp_0_5_tp_c_h+set}" = set; then
11
+  echo $ECHO_N "(cached) $ECHO_C" >&6
12
+fi
13
+echo "$as_me:$LINENO: result: $ac_cv_header_tunepimp_0_5_tp_c_h" >&5
14
+echo "${ECHO_T}$ac_cv_header_tunepimp_0_5_tp_c_h" >&6
15
+else
16
+  # Is the header compilable?
17
+echo "$as_me:$LINENO: checking tunepimp-0.5/tp_c.h usability" >&5
18
+echo $ECHO_N "checking tunepimp-0.5/tp_c.h usability... $ECHO_C" >&6
19
+cat >conftest.$ac_ext <<_ACEOF
20
+/* confdefs.h.  */
21
+_ACEOF
22
+cat confdefs.h >>conftest.$ac_ext
23
+cat >>conftest.$ac_ext <<_ACEOF
24
+/* end confdefs.h.  */
25
+$ac_includes_default
26
+#include <tunepimp-0.5/tp_c.h>
27
+_ACEOF
28
+rm -f conftest.$ac_objext
29
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
30
+  (eval $ac_compile) 2>conftest.er1
31
+  ac_status=$?
32
+  grep -v '^ *+' conftest.er1 >conftest.err
33
+  rm -f conftest.er1
34
+  cat conftest.err >&5
35
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
36
+  (exit $ac_status); } &&
37
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
38
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
39
+  (eval $ac_try) 2>&5
40
+  ac_status=$?
41
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
42
+  (exit $ac_status); }; } &&
43
+	 { ac_try='test -s conftest.$ac_objext'
44
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
45
+  (eval $ac_try) 2>&5
46
+  ac_status=$?
47
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
48
+  (exit $ac_status); }; }; then
49
+  ac_header_compiler=yes
50
+else
51
+  echo "$as_me: failed program was:" >&5
52
+sed 's/^/| /' conftest.$ac_ext >&5
53
 
54
+ac_header_compiler=no
55
+fi
56
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
57
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
58
+echo "${ECHO_T}$ac_header_compiler" >&6
59
 
60
+# Is the header present?
61
+echo "$as_me:$LINENO: checking tunepimp-0.5/tp_c.h presence" >&5
62
+echo $ECHO_N "checking tunepimp-0.5/tp_c.h presence... $ECHO_C" >&6
63
+cat >conftest.$ac_ext <<_ACEOF
64
+/* confdefs.h.  */
65
+_ACEOF
66
+cat confdefs.h >>conftest.$ac_ext
67
+cat >>conftest.$ac_ext <<_ACEOF
68
+/* end confdefs.h.  */
69
+#include <tunepimp-0.5/tp_c.h>
70
+_ACEOF
71
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
72
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
73
+  ac_status=$?
74
+  grep -v '^ *+' conftest.er1 >conftest.err
75
+  rm -f conftest.er1
76
+  cat conftest.err >&5
77
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
78
+  (exit $ac_status); } >/dev/null; then
79
+  if test -s conftest.err; then
80
+    ac_cpp_err=$ac_c_preproc_warn_flag
81
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
82
+  else
83
+    ac_cpp_err=
84
+  fi
85
+else
86
+  ac_cpp_err=yes
87
+fi
88
+if test -z "$ac_cpp_err"; then
89
+  ac_header_preproc=yes
90
+else
91
+  echo "$as_me: failed program was:" >&5
92
+sed 's/^/| /' conftest.$ac_ext >&5
93
 
94
+  ac_header_preproc=no
95
+fi
96
+rm -f conftest.err conftest.$ac_ext
97
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
98
+echo "${ECHO_T}$ac_header_preproc" >&6
99
 
100
-   kde_safe_cppflags=$CPPFLAGS
101
-   CPPFLAGS="$CPPFLAGS $all_includes"
102
-    ac_ext=cc
103
-ac_cpp='$CXXCPP $CPPFLAGS'
104
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
105
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
106
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
107
-
108
-ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
109
-
110
+# So?  What about this header?
111
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
112
+  yes:no: )
113
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&5
114
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
115
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: proceeding with the compiler's result" >&5
116
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: proceeding with the compiler's result" >&2;}
117
+    ac_header_preproc=yes
118
+    ;;
119
+  no:yes:* )
120
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: present but cannot be compiled" >&5
121
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: present but cannot be compiled" >&2;}
122
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h:     check for missing prerequisite headers?" >&5
123
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h:     check for missing prerequisite headers?" >&2;}
124
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: see the Autoconf documentation" >&5
125
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: see the Autoconf documentation" >&2;}
126
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h:     section \"Present But Cannot Be Compiled\"" >&5
127
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h:     section \"Present But Cannot Be Compiled\"" >&2;}
128
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: proceeding with the preprocessor's result" >&5
129
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: proceeding with the preprocessor's result" >&2;}
130
+    { echo "$as_me:$LINENO: WARNING: tunepimp-0.5/tp_c.h: in the future, the compiler will take precedence" >&5
131
+echo "$as_me: WARNING: tunepimp-0.5/tp_c.h: in the future, the compiler will take precedence" >&2;}
132
+    (
133
+      cat <<\_ASBOX
134
+## ------------------------------------------ ##
135
+## Report this to the AC_PACKAGE_NAME lists.  ##
136
+## ------------------------------------------ ##
137
+_ASBOX
138
+    ) |
139
+      sed "s/^/$as_me: WARNING:     /" >&2
140
+    ;;
141
+esac
142
+echo "$as_me:$LINENO: checking for tunepimp-0.5/tp_c.h" >&5
143
+echo $ECHO_N "checking for tunepimp-0.5/tp_c.h... $ECHO_C" >&6
144
+if test "${ac_cv_header_tunepimp_0_5_tp_c_h+set}" = set; then
145
+  echo $ECHO_N "(cached) $ECHO_C" >&6
146
+else
147
+  ac_cv_header_tunepimp_0_5_tp_c_h=$ac_header_preproc
148
+fi
149
+echo "$as_me:$LINENO: result: $ac_cv_header_tunepimp_0_5_tp_c_h" >&5
150
+echo "${ECHO_T}$ac_cv_header_tunepimp_0_5_tp_c_h" >&6
151
 
152
-   if test "${ac_cv_header_tunepimp_tp_c_h+set}" = set; then
153
+fi
154
+if test $ac_cv_header_tunepimp_0_5_tp_c_h = yes; then
155
+  build_musicbrainz="yes"
156
+else
157
+  if test "${ac_cv_header_tunepimp_tp_c_h+set}" = set; then
158
   echo "$as_me:$LINENO: checking for tunepimp/tp_c.h" >&5
159
 echo $ECHO_N "checking for tunepimp/tp_c.h... $ECHO_C" >&6
160
 if test "${ac_cv_header_tunepimp_tp_c_h+set}" = set; then
161
@@ -31675,7 +31799,7 @@
162
   cat conftest.err >&5
163
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
164
   (exit $ac_status); } &&
165
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
166
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
167
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
168
   (eval $ac_try) 2>&5
169
   ac_status=$?
170
@@ -31718,8 +31842,8 @@
171
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
172
   (exit $ac_status); } >/dev/null; then
173
   if test -s conftest.err; then
174
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
175
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
176
+    ac_cpp_err=$ac_c_preproc_warn_flag
177
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
178
   else
179
     ac_cpp_err=
180
   fi
181
@@ -31739,7 +31863,7 @@
182
 echo "${ECHO_T}$ac_header_preproc" >&6
183
 
184
 # So?  What about this header?
185
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
186
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
187
   yes:no: )
188
     { echo "$as_me:$LINENO: WARNING: tunepimp/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&5
189
 echo "$as_me: WARNING: tunepimp/tp_c.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
190
@@ -31788,19 +31912,14 @@
191
 fi
192
 
193
 
194
-   CPPFLAGS=$kde_safe_cppflags
195
-   ac_ext=c
196
-ac_cpp='$CPP $CPPFLAGS'
197
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
198
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
199
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
200
+fi
201
 
202
 
203
 fi
204
 if test "$build_musicbrainz" = "yes"; then
205
-  echo "$as_me:$LINENO: checking for tp_SetPUIDCollisionThreshold in -ltunepimp" >&5
206
-echo $ECHO_N "checking for tp_SetPUIDCollisionThreshold in -ltunepimp... $ECHO_C" >&6
207
-if test "${ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold+set}" = set; then
208
+  echo "$as_me:$LINENO: checking for tr_GetPUID in -ltunepimp" >&5
209
+echo $ECHO_N "checking for tr_GetPUID in -ltunepimp... $ECHO_C" >&6
210
+if test "${ac_cv_lib_tunepimp_tr_GetPUID+set}" = set; then
211
   echo $ECHO_N "(cached) $ECHO_C" >&6
212
 else
213
   ac_check_lib_save_LIBS=$LIBS
214
@@ -31818,11 +31937,11 @@
215
 #endif
216
 /* We use char because int might match the return type of a gcc2
217
    builtin and then its argument prototype would still apply.  */
218
-char tp_SetPUIDCollisionThreshold ();
219
+char tr_GetPUID ();
220
 int
221
 main ()
222
 {
223
-tp_SetPUIDCollisionThreshold ();
224
+tr_GetPUID ();
225
   ;
226
   return 0;
227
 }
228
@@ -31848,20 +31967,20 @@
229
   ac_status=$?
230
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
231
   (exit $ac_status); }; }; then
232
-  ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold=yes
233
+  ac_cv_lib_tunepimp_tr_GetPUID=yes
234
 else
235
   echo "$as_me: failed program was:" >&5
236
 sed 's/^/| /' conftest.$ac_ext >&5
237
 
238
-ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold=no
239
+ac_cv_lib_tunepimp_tr_GetPUID=no
240
 fi
241
 rm -f conftest.err conftest.$ac_objext \
242
       conftest$ac_exeext conftest.$ac_ext
243
 LIBS=$ac_check_lib_save_LIBS
244
 fi
245
-echo "$as_me:$LINENO: result: $ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold" >&5
246
-echo "${ECHO_T}$ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold" >&6
247
-if test $ac_cv_lib_tunepimp_tp_SetPUIDCollisionThreshold = yes; then
248
+echo "$as_me:$LINENO: result: $ac_cv_lib_tunepimp_tr_GetPUID" >&5
249
+echo "${ECHO_T}$ac_cv_lib_tunepimp_tr_GetPUID" >&6
250
+if test $ac_cv_lib_tunepimp_tr_GetPUID = yes; then
251
 
252
 cat >>confdefs.h <<\_ACEOF
253
 #define HAVE_TUNEPIMP 5
254
@@ -31977,6 +32096,7 @@
255
 
256
 fi;
257
 if test "$with_vorbis" != "no"; then
258
+
259
 
260
 
261
 
(-)/home/makc/porting/ports/audio/kid3/files/patch-doc__Makefile.in (+28 lines)
Line 0 Link Here
1
--- ./doc/Makefile.in.orig	Tue Jun 27 23:34:40 2006
2
+++ ./doc/Makefile.in	Sat Sep 23 01:27:55 2006
3
@@ -307,7 +307,7 @@
4
 #>+ 3
5
 	cd $(top_srcdir) && \
6
 	  $(AUTOMAKE) --gnu  doc/Makefile
7
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/Makefile.in
8
+	cd $(top_srcdir) && perl admin/am_edit doc/Makefile.in
9
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
10
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
11
 
12
@@ -593,7 +593,6 @@
13
 # Otherwise a system limit (for SysV at least) may be exceeded.
14
 .NOEXPORT:
15
 
16
-
17
 #>+ 2
18
 KDE_DIST=Makefile.in 
19
 
20
@@ -604,7 +603,7 @@
21
 force-reedit:
22
 		cd $(top_srcdir) && \
23
 	  $(AUTOMAKE) --gnu  doc/Makefile
24
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/Makefile.in
25
+	cd $(top_srcdir) && perl admin/am_edit doc/Makefile.in
26
 
27
 
28
 #>+ 21
(-)/home/makc/porting/ports/audio/kid3/files/patch-doc__de__Makefile.in (+28 lines)
Line 0 Link Here
1
--- ./doc/de/Makefile.in.orig	Tue Jun 27 23:34:40 2006
2
+++ ./doc/de/Makefile.in	Sat Sep 23 01:27:55 2006
3
@@ -296,7 +296,7 @@
4
 #>+ 3
5
 	cd $(top_srcdir) && \
6
 	  $(AUTOMAKE) --gnu  doc/de/Makefile
7
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/de/Makefile.in
8
+	cd $(top_srcdir) && perl admin/am_edit doc/de/Makefile.in
9
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
10
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
11
 
12
@@ -446,7 +446,6 @@
13
 # Otherwise a system limit (for SysV at least) may be exceeded.
14
 .NOEXPORT:
15
 
16
-
17
 #>+ 2
18
 KDE_DIST=Makefile.in 
19
 
20
@@ -499,7 +498,7 @@
21
 force-reedit:
22
 		cd $(top_srcdir) && \
23
 	  $(AUTOMAKE) --gnu  doc/de/Makefile
24
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/de/Makefile.in
25
+	cd $(top_srcdir) && perl admin/am_edit doc/de/Makefile.in
26
 
27
 
28
 #>+ 21
(-)/home/makc/porting/ports/audio/kid3/files/patch-doc__en__Makefile.in (+28 lines)
Line 0 Link Here
1
--- ./doc/en/Makefile.in.orig	Tue Jun 27 23:34:40 2006
2
+++ ./doc/en/Makefile.in	Sat Sep 23 01:27:55 2006
3
@@ -296,7 +296,7 @@
4
 #>+ 3
5
 	cd $(top_srcdir) && \
6
 	  $(AUTOMAKE) --gnu  doc/en/Makefile
7
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/en/Makefile.in
8
+	cd $(top_srcdir) && perl admin/am_edit doc/en/Makefile.in
9
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
10
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
11
 
12
@@ -446,7 +446,6 @@
13
 # Otherwise a system limit (for SysV at least) may be exceeded.
14
 .NOEXPORT:
15
 
16
-
17
 #>+ 2
18
 KDE_DIST=Makefile.in 
19
 
20
@@ -499,7 +498,7 @@
21
 force-reedit:
22
 		cd $(top_srcdir) && \
23
 	  $(AUTOMAKE) --gnu  doc/en/Makefile
24
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/doc/en/Makefile.in
25
+	cd $(top_srcdir) && perl admin/am_edit doc/en/Makefile.in
26
 
27
 
28
 #>+ 21
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3-oggfile.cpp (-11 lines)
Lines 1-11 Link Here
1
--- kid3/oggfile.cpp.orig	Sat Jan 28 02:15:27 2006
2
+++ kid3/oggfile.cpp	Mon Aug  7 16:13:25 2006
3
@@ -143,7 +143,7 @@
4
 			bool setUtime = false;
5
 			struct utimbuf times;
6
 			if (preserve) {
7
-				int fd = ::fileno(fpIn);
8
+				int fd = fileno(fpIn);
9
 				if (fd >= 0) {
10
 					struct stat fileStat;
11
 					if (::fstat(fd, &fileStat) == 0) {
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__Makefile.in (+28 lines)
Line 0 Link Here
1
--- ./kid3/Makefile.in.orig	Tue Jun 27 23:34:40 2006
2
+++ ./kid3/Makefile.in	Sat Sep 23 01:27:55 2006
3
@@ -491,7 +491,7 @@
4
 #>+ 3
5
 	cd $(top_srcdir) && \
6
 	  $(AUTOMAKE) --gnu  kid3/Makefile
7
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/kid3/Makefile.in
8
+	cd $(top_srcdir) && perl admin/am_edit kid3/Makefile.in
9
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
10
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
11
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
12
@@ -910,7 +910,6 @@
13
 # Otherwise a system limit (for SysV at least) may be exceeded.
14
 .NOEXPORT:
15
 
16
-
17
 #>+ 3
18
 importdialog.moc.cpp: $(srcdir)/importdialog.h
19
 	$(MOC) $(srcdir)/importdialog.h -o importdialog.moc.cpp
20
@@ -1023,7 +1022,7 @@
21
 force-reedit:
22
 		cd $(top_srcdir) && \
23
 	  $(AUTOMAKE) --gnu  kid3/Makefile
24
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/kid3/Makefile.in
25
+	cd $(top_srcdir) && perl admin/am_edit kid3/Makefile.in
26
 
27
 
28
 #>+ 21
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbclient.cpp (+101 lines)
Line 0 Link Here
1
+++ ./kid3/freedbclient.cpp	2006-05-28 15:05:28.000000000 +0200
2
+++ ./kid3/freedbclient.cpp	2006-10-07 21:32:21.000000000 +0200
3
@@ -21,6 +21,7 @@
4
 #include <qregexp.h>
5
 #include <qsocket.h>
6
 #include <qstatusbar.h>
7
+#include <qurl.h>
8
 #include "freedbconfig.h"
9
 #include "freedbclient.h"
10
 
11
@@ -34,7 +35,8 @@
12
  *
13
  * @param sb status bar to display progress information.
14
  */
15
-FreedbClient::FreedbClient(QStatusBar *sb) : statusBar(sb)
16
+FreedbClient::FreedbClient(QStatusBar *sb) :
17
+ statusBar(sb), m_requestType(RT_None)
18
 {
19
 	sock = new QSocket();
20
 	connect(sock, SIGNAL(hostFound()),
21
@@ -158,7 +160,39 @@
22
 	}
23
 #endif
24
 	sock->connectToHost(dest, destPort);
25
-	isAlbumRequest = false;
26
+	m_requestType = RT_FindFreedbSearch;
27
+
28
+	statusBar->message(i18n("Connecting..."));
29
+}
30
+
31
+/**
32
+ * Find keyword in freedb with "cddb album" command of freedb2.org.
33
+ *
34
+ * @param cfg  freedb configuration
35
+ * @param what string with words to search
36
+ */
37
+void FreedbClient::findCddbAlbum(const FreedbConfig *cfg, QString what)
38
+{
39
+	QString destNamePort(getProxyOrDest(cfg, cfg->server));
40
+	QString dest;
41
+	int destPort;
42
+	splitNamePort(destNamePort, dest, destPort);
43
+	what.replace(QRegExp(" +"), " "); // collapse spaces
44
+	QUrl::encode(what);
45
+	what.replace("%20", "+"); // replace spaces by '+'
46
+	request = "GET http://" + cfg->server + cfg->cgiPath +
47
+		"?cmd=cddb+album+" + what + "&hello=noname+localhost+" +
48
+		"Kid3+" VERSION "&proto=1 HTTP/1.1\r\nHost: " + cfg->server +
49
+		"\r\nConnection: close\r\n\r\n";
50
+#if defined WIN32 && QT_VERSION < 300
51
+	int err = hostnameToAddress(dest);
52
+	if (err) {
53
+		statusBar->message(QString("WinSock error %1").arg(err));
54
+		return;
55
+	}
56
+#endif
57
+	sock->connectToHost(dest, destPort);
58
+	m_requestType = RT_FindCddbAlbum;
59
 
60
 	statusBar->message(i18n("Connecting..."));
61
 }
62
@@ -186,14 +220,23 @@
63
  */
64
 void FreedbClient::slotConnectionClosed()
65
 {
66
-	rcvStr = "";
67
-	while (sock->canReadLine()) {
68
-		rcvStr += sock->readLine();
69
-	}
70
-	if (isAlbumRequest) {
71
-		emit albumFinished(rcvStr);
72
-	} else {
73
-		emit findFinished(rcvStr);
74
+	Q_ULONG len = sock->bytesAvailable();
75
+	QCString s;
76
+	s.resize(len + 1);
77
+	sock->readBlock(s.data(), len);
78
+	rcvStr = QString::fromUtf8(s.data());
79
+	switch (m_requestType) {
80
+		case RT_Album:
81
+			emit albumFinished(rcvStr);
82
+			break;
83
+		case RT_FindFreedbSearch:
84
+			emit findFinished(rcvStr);
85
+			break;
86
+		case RT_FindCddbAlbum:
87
+			emit findCddbAlbumFinished(rcvStr);
88
+			break;
89
+		default:
90
+			qWarning("Unknown freedb request type");
91
 	}
92
 	sock->close();
93
 	statusBar->message(i18n("Ready."));
94
@@ -256,6 +299,6 @@
95
 	}
96
 #endif
97
 	sock->connectToHost(dest, destPort);
98
-	isAlbumRequest = true;
99
+	m_requestType = RT_Album;
100
 	statusBar->message(i18n("Connecting..."));
101
 }
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbclient.h (+44 lines)
Line 0 Link Here
1
+++ ./kid3/freedbclient.h	2006-01-05 19:15:21.000000000 +0100
2
+++ ./kid3/freedbclient.h	2006-10-07 16:06:53.000000000 +0200
3
@@ -44,6 +44,13 @@
4
 	 */
5
 	void find(const FreedbConfig *cfg, QString what);
6
 	/**
7
+	 * Find keyword in freedb with "cddb album" command of freedb2.org.
8
+	 *
9
+	 * @param cfg  freedb configuration
10
+	 * @param what string with words to search
11
+	 */
12
+	void findCddbAlbum(const FreedbConfig *cfg, QString what);
13
+	/**
14
 	 * Request track list from freedb server.
15
 	 *
16
 	 * @param cfg freedb configuration
17
@@ -92,6 +99,11 @@
18
 	 */
19
 	void findFinished(QString);
20
 	/**
21
+	 * Emitted when findCddbAlbum request finished.
22
+	 * Parameter: text containing result of findCddbAlbum request
23
+	 */
24
+	void findCddbAlbumFinished(QString);
25
+	/**
26
 	 * Emitted when album track data request finished.
27
 	 * Parameter: text containing result of album request
28
 	 */
29
@@ -105,8 +117,13 @@
30
 	QString request;
31
 	/** buffer for received data */
32
 	QString rcvStr;
33
-	/** true if last request was album track data request */
34
-	bool isAlbumRequest;
35
+	/** type of current request */
36
+	enum RequestType {
37
+		RT_None,
38
+		RT_FindFreedbSearch,
39
+		RT_FindCddbAlbum,
40
+		RT_Album
41
+	} m_requestType;
42
 };
43
 
44
 #endif
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbdialog.cpp (+96 lines)
Line 0 Link Here
1
+++ ./kid3/freedbdialog.cpp	2006-02-23 22:48:14.000000000 +0100
2
+++ ./kid3/freedbdialog.cpp	2006-10-07 21:31:43.000000000 +0200
3
@@ -24,6 +24,7 @@
4
 #include <qlistbox.h>
5
 #include <qlabel.h>
6
 #include <qstatusbar.h>
7
+#include <qregexp.h>
8
 #include "freedbconfig.h"
9
 #include "freedbclient.h"
10
 #include "freedbdialog.h"
11
@@ -109,6 +110,7 @@
12
 	if (serverLayout && serverLabel && serverComboBox &&
13
 		cgiLabel && cgiLineEdit) {
14
 		static const char *serverList[] = {
15
+			"freedb2.org:80",
16
 			"freedb.freedb.org:80",
17
 			"at.freedb.org:80",
18
 			"au.freedb.org:80",
19
@@ -155,6 +157,8 @@
20
 		client = new FreedbClient(statusBar);
21
 		connect(client, SIGNAL(findFinished(QString)),
22
 				this, SLOT(slotFindFinished(QString)));
23
+		connect(client, SIGNAL(findCddbAlbumFinished(QString)),
24
+				this, SLOT(slotFindCddbAlbumFinished(QString)));
25
 		connect(client, SIGNAL(albumFinished(QString)),
26
 				this, SLOT(slotAlbumFinished(QString)));
27
 	}
28
@@ -315,7 +319,8 @@
29
 {
30
 	FreedbConfig cfg;
31
 	getFreedbConfig(&cfg);
32
-	client->find(&cfg, findLineEdit->currentText());
33
+//	client->find(&cfg, findLineEdit->currentText());
34
+	client->findCddbAlbum(&cfg, findLineEdit->currentText());
35
 }
36
 
37
 /**
38
@@ -364,6 +369,58 @@
39
 }
40
 
41
 /**
42
+ * Process finished findCddbAlbum request.
43
+ *
44
+ * @param searchStr search data received
45
+ */
46
+void FreedbDialog::slotFindCddbAlbumFinished(QString searchStr)
47
+{
48
+/*
49
+210 exact matches found
50
+categ discid dtitle
51
+(more matches...)
52
+.
53
+or
54
+211 close matches found
55
+rock 920b810c Catharsis / Imago
56
+.
57
+theoretically, but never seen
58
+200	categ discid dtitle
59
+*/
60
+	QRegExp catIdTitleRe("([a-z]+)\\s+([0-9a-f]+)\\s+([^/]+ / .+)");
61
+	QStringList lines = QStringList::split(QRegExp("[\\r\\n]+"), searchStr);
62
+	bool inEntries = false;
63
+	albumListBox->clear();
64
+	for (QStringList::const_iterator it = lines.begin(); it != lines.end(); ++it) {
65
+		if (*it == ".") {
66
+			break;
67
+		}
68
+		if (inEntries) {
69
+			if (catIdTitleRe.exactMatch(*it)) {
70
+				new AlbumListItem(
71
+					albumListBox,
72
+					catIdTitleRe.cap(3),
73
+					catIdTitleRe.cap(1),
74
+					catIdTitleRe.cap(2));
75
+			}
76
+		} else {
77
+			if ((*it).startsWith("21") && (*it).find(" match") != -1) {
78
+				inEntries = true;
79
+			} else if ((*it).startsWith("200 ")) {
80
+				if (catIdTitleRe.exactMatch((*it).mid(4))) {
81
+					new AlbumListItem(
82
+						albumListBox,
83
+						catIdTitleRe.cap(3),
84
+						catIdTitleRe.cap(1),
85
+						catIdTitleRe.cap(2));
86
+				}
87
+			}
88
+		}
89
+	}
90
+	albumListBox->setFocus();
91
+}
92
+
93
+/**
94
  * Process finished album data.
95
  *
96
  * @param albumStr album track data received
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__freedbdialog.h (+15 lines)
Line 0 Link Here
1
+++ ./kid3/freedbdialog.h	2006-02-23 22:39:28.000000000 +0100
2
+++ ./kid3/freedbdialog.h	2006-10-07 17:19:08.000000000 +0200
3
@@ -117,6 +117,12 @@
4
 	 */
5
 	void slotFindFinished(QString searchStr);
6
 	/**
7
+	 * Process finished findCddbAlbum request.
8
+	 *
9
+	 * @param searchStr search data received
10
+	 */
11
+	void slotFindCddbAlbumFinished(QString searchStr);
12
+	/**
13
 	 * Process finished album data.
14
 	 *
15
 	 * @param albumStr album track data received
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__genres.cpp (+11 lines)
Line 0 Link Here
1
--- ./kid3/genres.cpp.orig	Thu May 25 19:58:19 2006
2
+++ ./kid3/genres.cpp	Sat Sep 23 01:28:25 2006
3
@@ -385,7 +385,7 @@
4
  * @return genre number, 255 for unknown index.
5
  */
6
 
7
-int Genres::getNumber(QString &str)
8
+int Genres::getNumber(const QString &str)
9
 {
10
 	for (int i = 0; i < Genres::count + 1; i++) {
11
 		if (QString(genre[i]) == str) {
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__genres.h (+11 lines)
Line 0 Link Here
1
--- ./kid3/genres.h.orig	Thu Jan  5 21:15:20 2006
2
+++ ./kid3/genres.h	Sat Sep 23 01:28:25 2006
3
@@ -46,7 +46,7 @@
4
 	 *
5
 	 * @return genre number, 255 for unknown index.
6
 	 */
7
-	static int getNumber(QString &str);
8
+	static int getNumber(const QString &str);
9
 	/** Number of genres */
10
 #if defined _WIN32 || defined WIN32
11
 	enum { count = 148 };
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__id3form.cpp (+11 lines)
Line 0 Link Here
1
--- ./kid3/id3form.cpp.orig	Sat Jun 17 14:46:00 2006
2
+++ ./kid3/id3form.cpp	Sat Sep 23 01:28:25 2006
3
@@ -588,7 +588,7 @@
4
 	st->track   = trackV2CheckBox->isChecked()   ? trackV2SpinBox->value()
5
 		: -1;
6
 	st->genre   = genreV2CheckBox->isChecked()   ?
7
-		Genres::getNumber(genreV2ComboBox->currentItem()) : -1;
8
+		Genres::getNumber(genreV2ComboBox->currentText()) : -1;
9
 	st->genreStr = st->genre == 0xff ? genreV2ComboBox->currentText()
10
 		: QString::null;
11
 }
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__mp3file.cpp (+14 lines)
Line 0 Link Here
1
--- ./kid3/mp3file.cpp.orig	Thu Jan  5 21:15:21 2006
2
+++ ./kid3/mp3file.cpp	Sat Sep 23 01:28:25 2006
3
@@ -365,6 +365,11 @@
4
 		if (!ok || n > 0xff) {
5
 			n = 0xff;
6
 		}
7
+	} else {
8
+		// ID3v2 genres can be stored as "(9)", "(9)Metal" or "Metal".
9
+		// If the string does not start with '(', try to get the genre number
10
+		// from a string containing a genre text.
11
+		n = Genres::getNumber(str);
12
 	}
13
 	return n;
14
 }
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__musicbrainzclient.cpp (+356 lines)
Line 0 Link Here
1
--- ./kid3/musicbrainzclient.cpp.orig	Tue Jun  6 00:18:36 2006
2
+++ ./kid3/musicbrainzclient.cpp	Sat Sep 23 01:27:55 2006
3
@@ -17,10 +17,161 @@
4
 #define I18N_NOOP(s) QT_TR_NOOP(s)
5
 #endif
6
 #include <qfile.h>
7
+#if HAVE_TUNEPIMP >= 5
8
+#include <qsocket.h>
9
+#include <qdom.h>
10
+#endif
11
 #include "musicbrainzconfig.h"
12
 #include "freedbclient.h"
13
 #include "importtrackdata.h"
14
 
15
+#if HAVE_TUNEPIMP >= 5
16
+/**
17
+ * Constructor.
18
+ *
19
+ * @param numFiles   number of files to be queried
20
+ * @param serverName server name
21
+ * @param serverPort server port
22
+ * @param proxyName  proxy name, empty if no proxy
23
+ * @param proxyPort  proxy port
24
+ */
25
+LookupQuery::LookupQuery(int numFiles,
26
+												 const QString& serverName, Q_UINT16 serverPort,
27
+												 const QString& proxyName, Q_UINT16 proxyPort) :
28
+	m_numFiles(numFiles), m_serverName(serverName), m_serverPort(serverPort),
29
+	m_proxyName(proxyName), m_proxyPort(proxyPort),
30
+	m_currentFile(-1), m_fileQueries(new FileQuery[numFiles]),
31
+	m_sock(new QSocket)
32
+{
33
+	for (int i = 0; i < m_numFiles; ++i) {
34
+		m_fileQueries[i].requested = false;
35
+		m_fileQueries[i].puid = "";
36
+	}
37
+	connect(m_sock, SIGNAL(connected()),
38
+			this, SLOT(socketConnected()));
39
+	connect(m_sock, SIGNAL(error(int)),
40
+			this, SLOT(socketError()));
41
+	connect(m_sock, SIGNAL(connectionClosed()),
42
+			this, SLOT(socketConnectionClosed()));
43
+}
44
+
45
+/**
46
+ * Destructor.
47
+ */
48
+LookupQuery::~LookupQuery()
49
+{
50
+	m_sock->close();
51
+	m_sock->disconnect();
52
+	delete m_sock;
53
+	delete [] m_fileQueries;
54
+}
55
+
56
+/**
57
+ * Connect to server to query information about the current file.
58
+ */
59
+void LookupQuery::socketQuery()
60
+{
61
+	if (m_currentFile >= 0 && m_currentFile < m_numFiles) {
62
+		QString  destName = m_proxyName.isEmpty() ? m_serverName : m_proxyName;
63
+		Q_UINT16 destPort = m_proxyName.isEmpty() ? m_serverPort : m_proxyPort;
64
+		m_request = "GET http://";
65
+		m_request += m_serverName;
66
+		if (m_serverPort != 80) {
67
+			m_request += ':';
68
+			m_request += QString::number(m_serverPort);
69
+		}
70
+		m_request += "/ws/1/track/?type=xml&puid=";
71
+		m_request += m_fileQueries[m_currentFile].puid;
72
+		m_request += " HTTP/1.0\r\nHost: ";
73
+		m_request += m_serverName;
74
+		m_request += "\r\nUser-agent: Kid3/" VERSION "\r\n\r\n";
75
+		m_sock->connectToHost(destName, destPort);
76
+		m_fileQueries[m_currentFile].requested = true;
77
+	}
78
+}
79
+
80
+/**
81
+ * Query the next file.
82
+ */
83
+void LookupQuery::queryNext()
84
+{
85
+	// handle the first pending query
86
+	for (int i = 0; i < m_numFiles; ++i) {
87
+		if (!m_fileQueries[i].requested &&
88
+				!m_fileQueries[i].puid.isEmpty()) {
89
+			m_currentFile = i;
90
+			socketQuery();
91
+			return;
92
+		}
93
+	}
94
+	// no pending query => socketQuery() will be done in next query()
95
+	m_currentFile = -1;
96
+}
97
+
98
+/**
99
+ * Query a PUID from the server.
100
+ *
101
+ * @param puid  PUID
102
+ * @param index index of file
103
+ */
104
+void LookupQuery::query(const char* puid, int index)
105
+{
106
+	m_fileQueries[index].puid = QString(puid);
107
+	// if no request is being executed, start the current request
108
+	if (m_currentFile < 0 || m_currentFile >= m_numFiles ||
109
+			!m_fileQueries[m_currentFile].requested) {
110
+		m_currentFile = index;
111
+		socketQuery();
112
+	}
113
+}
114
+
115
+/**
116
+ * Send query when the socket is connected.
117
+ */
118
+void LookupQuery::socketConnected()
119
+{
120
+	m_sock->writeBlock(m_request.latin1(), m_request.length());
121
+}
122
+
123
+/**
124
+ * Error on socket connection.
125
+ */
126
+void LookupQuery::socketError()
127
+{
128
+	queryNext();
129
+}
130
+
131
+/**
132
+ * Read received data when the server has closed the connection.
133
+ */
134
+void LookupQuery::socketConnectionClosed()
135
+{
136
+	Q_ULONG len = m_sock->bytesAvailable();
137
+	QCString buf;
138
+	buf.resize(len + 1 );
139
+	m_sock->readBlock(buf.data(), len);
140
+	m_sock->close();
141
+
142
+	int xmlStart = buf.find("<?xml");
143
+	if (xmlStart >= 0 &&
144
+			m_currentFile >= 0 && m_currentFile < m_numFiles &&
145
+			m_fileQueries[m_currentFile].requested) {
146
+		emit queryResponseReceived(m_currentFile, buf.mid(xmlStart, len - xmlStart));
147
+	}
148
+	queryNext();
149
+}
150
+
151
+#else
152
+
153
+LookupQuery::LookupQuery(int, const QString&, Q_UINT16, const QString&, Q_UINT16) {}
154
+LookupQuery::~LookupQuery() {}
155
+void LookupQuery::socketConnected() {}
156
+void LookupQuery::socketError() {}
157
+void LookupQuery::socketConnectionClosed() {}
158
+
159
+#endif
160
+
161
+
162
 /**
163
  * Constructor.
164
  *
165
@@ -29,6 +180,9 @@
166
  */
167
 MusicBrainzClient::MusicBrainzClient(ImportTrackDataVector& trackDataList) :
168
 	m_trackDataVector(trackDataList), m_tp(0), m_ids(0), m_numFiles(0)
169
+#if HAVE_TUNEPIMP >= 5
170
+	, m_lookupQuery(0)
171
+#endif
172
 {
173
 	m_tp = tp_New("kid3", VERSION);
174
 #ifdef WIN32
175
@@ -39,7 +193,11 @@
176
 #else
177
 	tp_SetUseUTF8(m_tp, 1);
178
 #endif
179
+#if HAVE_TUNEPIMP >= 5
180
+	tp_SetMusicDNSClientId(m_tp, "a95f5c7cd37fd4bce12dc86d196fb4fe");
181
+#else
182
 	tp_SetAutoFileLookup(m_tp, 1);
183
+#endif
184
 	tp_SetRenameFiles(m_tp, 0);
185
 	tp_SetMoveFiles(m_tp, 0);
186
 	tp_SetWriteID3v1(m_tp, 0);
187
@@ -110,8 +268,13 @@
188
     { eUnrecognized,  I18N_NOOP("Unrecognized") },
189
     { eRecognized,    I18N_NOOP("Recognized") },
190
     { ePending,       I18N_NOOP("Pending") },
191
+#if HAVE_TUNEPIMP >= 5
192
+    { ePUIDLookup,     I18N_NOOP("PUID Lookup") },
193
+    { ePUIDCollision,  I18N_NOOP("PUID Collision") },
194
+#else
195
     { eTRMLookup,     I18N_NOOP("TRM Lookup") },
196
     { eTRMCollision,  I18N_NOOP("TRM Collision") },
197
+#endif
198
     { eFileLookup,    I18N_NOOP("File Lookup") },
199
     { eUserSelection, I18N_NOOP("User Selection") },
200
     { eVerified,      I18N_NOOP("Verified") },
201
@@ -163,7 +326,11 @@
202
 					track_t track = tp_GetTrack(m_tp, id);
203
 					if (track) {
204
 						tr_Lock(track);
205
+#if HAVE_TUNEPIMP >= 5
206
+						tr_GetPUID(track, trm, sizeof(trm));
207
+#else
208
 						tr_GetTRM(track, trm, sizeof(trm));
209
+#endif
210
 						if (trm[0] == '\0') {
211
 							tr_SetStatus(track, ePending);
212
 							tp_Wake(m_tp, track);
213
@@ -189,13 +356,33 @@
214
 						ImportTrackData trackData;
215
 						getMetaData(id, trackData);
216
 						emit metaDataReceived(index, trackData);
217
-					} else if (statusCode == eTRMCollision ||
218
-										 statusCode == eUserSelection) {
219
+					}
220
+#if HAVE_TUNEPIMP >= 5
221
+					else if (statusCode == ePUIDLookup ||
222
+									 statusCode == ePUIDCollision ||
223
+									 statusCode == eFileLookup) {
224
+						char puid[255];
225
+						puid[0] = '\0';
226
+						track_t track = tp_GetTrack(m_tp, id);
227
+						if (track) {
228
+							tr_Lock(track);
229
+							tr_GetPUID(track, puid, sizeof(puid));
230
+							tr_Unlock(track);
231
+							tp_ReleaseTrack(m_tp, track);
232
+						}
233
+						if (m_lookupQuery) {
234
+							m_lookupQuery->query(puid, index);
235
+						}
236
+					}
237
+#else
238
+					else if (statusCode == eTRMCollision ||
239
+									 statusCode == eUserSelection) {
240
 						ImportTrackDataVector trackDataList;
241
 						if (getResults(id, trackDataList)) {
242
 							emit resultsReceived(index, trackDataList);
243
 						}
244
 					}
245
+#endif
246
 				}
247
 				break;
248
 			}
249
@@ -242,6 +429,16 @@
250
 	m_numFiles = m_trackDataVector.count();
251
 #endif
252
 	m_ids = new int[m_numFiles];
253
+#if HAVE_TUNEPIMP >= 5
254
+	char serverName[80], proxyName[80];
255
+	short serverPort, proxyPort;
256
+	tp_GetServer(m_tp, serverName, sizeof(serverName) - 1, &serverPort);
257
+	tp_GetProxy(m_tp, proxyName, sizeof(proxyName) - 1, &proxyPort);
258
+	m_lookupQuery = new LookupQuery(m_numFiles, serverName, serverPort,
259
+																	proxyName, proxyPort);
260
+	connect(m_lookupQuery, SIGNAL(queryResponseReceived(int, const QCString&)),
261
+					this, SLOT(parseLookupResponse(int, const QCString&)));
262
+#endif
263
 	int i = 0;
264
 	for (
265
 #if QT_VERSION >= 300
266
@@ -271,6 +468,10 @@
267
 		}
268
 		delete [] m_ids;
269
 		m_ids = 0;
270
+#if HAVE_TUNEPIMP >= 5
271
+		delete m_lookupQuery;
272
+		m_lookupQuery = 0;
273
+#endif
274
 		m_numFiles = 0;
275
 	}
276
 }
277
@@ -308,6 +509,68 @@
278
 	}
279
 }
280
 
281
+#if HAVE_TUNEPIMP >= 5
282
+
283
+bool MusicBrainzClient::getResults(int, ImportTrackDataVector&) {
284
+	return false;
285
+}
286
+
287
+/**
288
+ * Process server response with lookup data.
289
+ *
290
+ * @param index    index of file
291
+ * @param response response from server
292
+ */
293
+void MusicBrainzClient::parseLookupResponse(int index, const QCString& response)
294
+{
295
+	ImportTrackDataVector trackDataList;
296
+	QDomDocument doc;
297
+	if (doc.setContent(response)) {
298
+		QDomElement trackList =
299
+			doc.namedItem("metadata").toElement().namedItem("track-list").toElement();
300
+
301
+		for (QDomNode trackNode = trackList.namedItem("track");
302
+				 !trackNode.isNull();
303
+				 trackNode = trackNode.nextSibling()) {
304
+			QDomElement track = trackNode.toElement();
305
+
306
+			ImportTrackData trackData;
307
+			trackData.artist =
308
+				track.namedItem("artist").toElement().namedItem("name").toElement().text();
309
+			trackData.title = track.namedItem("title").toElement().text();
310
+
311
+			for (QDomNode releaseNode =
312
+						 track.namedItem("release-list").toElement().namedItem("release");
313
+					 !releaseNode.isNull();
314
+					 releaseNode = releaseNode.nextSibling() ) {
315
+				QDomElement release = releaseNode.toElement();
316
+
317
+				trackData.album = release.namedItem("title").toElement().text();
318
+				trackData.track = -1;
319
+				QDomNode releaseTrackNode = release.namedItem("track-list");
320
+				if (!releaseTrackNode.isNull()) {
321
+					QDomElement releaseTrack = releaseTrackNode.toElement();
322
+					if (!releaseTrack.attribute("offset").isEmpty())
323
+						trackData.track = releaseTrack.attribute("offset").toInt() + 1;
324
+				}
325
+			}
326
+			trackDataList.append(trackData);
327
+		}
328
+	}
329
+
330
+	if (trackDataList.size() > 1) {
331
+		emit resultsReceived(index, trackDataList);
332
+		emit statusChanged(index, i18n("User Selection"));
333
+	} else if (trackDataList.size() == 1) {
334
+		emit metaDataReceived(index, *trackDataList.begin());
335
+		emit statusChanged(index, i18n("Recognized"));
336
+	} else {
337
+		emit statusChanged(index, i18n("Unrecognized"));
338
+	}
339
+}
340
+
341
+#else
342
+
343
 /**
344
  * Get results for an ambiguous file.
345
  *
346
@@ -387,6 +650,10 @@
347
 	}
348
 	return resultsAvailable;
349
 }
350
+
351
+void MusicBrainzClient::parseLookupResponse(int, const QCString&) {}
352
+
353
+#endif
354
 
355
 #else // HAVE_TUNEPIMP
356
 
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__musicbrainzclient.h (+146 lines)
Line 0 Link Here
1
--- ./kid3/musicbrainzclient.h.orig	Thu Feb 23 22:48:34 2006
2
+++ ./kid3/musicbrainzclient.h	Sat Sep 23 01:27:55 2006
3
@@ -15,7 +15,13 @@
4
 #include <qobject.h>
5
 
6
 #ifdef HAVE_TUNEPIMP
7
+#if HAVE_TUNEPIMP >= 5
8
+#include <qbuffer.h>
9
+#include <tunepimp-0.5/tp_c.h>
10
+class QSocket;
11
+#else
12
 #include <tunepimp/tp_c.h>
13
+#endif
14
 #endif // HAVE_TUNEPIMP
15
 
16
 class MusicBrainzConfig;
17
@@ -23,6 +29,103 @@
18
 class ImportTrackDataVector;
19
 
20
 /**
21
+ * A HTTP query to a musicbrainz server for HAVE_TUNEPIMP >= 5.
22
+ */
23
+class LookupQuery : public QObject {
24
+Q_OBJECT
25
+
26
+public:
27
+	/**
28
+	 * Constructor.
29
+	 *
30
+	 * @param numFiles   number of files to be queried
31
+	 * @param serverName server name
32
+	 * @param serverPort server port
33
+	 * @param proxyName  proxy name, empty if no proxy
34
+	 * @param proxyPort  proxy port
35
+	 */
36
+	LookupQuery(int numFiles,
37
+							const QString& serverName, Q_UINT16 serverPort = 80,
38
+							const QString& proxyName = "", Q_UINT16 proxyPort = 80);
39
+
40
+	/**
41
+	 * Destructor.
42
+	 */
43
+	virtual ~LookupQuery();
44
+
45
+#if HAVE_TUNEPIMP >= 5
46
+	/**
47
+	 * Query a PUID from the server.
48
+	 *
49
+	 * @param puid     PUID
50
+	 * @param index    index of file
51
+	 */
52
+	void query(const char* puid, int index);
53
+#endif
54
+
55
+signals:
56
+	/**
57
+	 * Emitted when the query response is received
58
+	 */
59
+	void queryResponseReceived(int, const QCString&);
60
+
61
+private slots:
62
+	/**
63
+	 * Send query when the socket is connected.
64
+	 */
65
+	void socketConnected();
66
+
67
+	/**
68
+	 * Error on socket connection.
69
+	 */
70
+	void socketError();
71
+
72
+	/**
73
+	 * Read received data when the server has closed the connection.
74
+	 */
75
+	void socketConnectionClosed();
76
+
77
+#if HAVE_TUNEPIMP >= 5
78
+private:
79
+	/**
80
+	 * Connect to server to query information about the current file.
81
+	 */
82
+	void socketQuery();
83
+
84
+	/**
85
+	 * Query the next file.
86
+	 */
87
+	void queryNext();
88
+
89
+	struct FileQuery {
90
+		bool requested;
91
+		QString puid;
92
+	};
93
+
94
+	/** Number of files to be queried. */
95
+	int m_numFiles;
96
+	/** MusicBrainz server */
97
+	QString m_serverName;
98
+	/** Port of MusicBrainz server */
99
+	Q_UINT16 m_serverPort;
100
+	/** Proxy */
101
+	QString m_proxyName;
102
+	/** Port of proxy */
103
+	Q_UINT16 m_proxyPort;
104
+	/**
105
+	 * -1 if not yet started,
106
+	 * 0..m_numFiles-1 if a file is currently processed,
107
+	 * >=m_numFiles if all files processed.
108
+	 */ 
109
+	int m_currentFile;
110
+	FileQuery* m_fileQueries;
111
+	QSocket* m_sock;
112
+	QString m_request;
113
+#endif
114
+};
115
+
116
+
117
+/**
118
  * MusicBrainz client.
119
  */
120
 class MusicBrainzClient : public QObject
121
@@ -85,6 +188,15 @@
122
 	 */
123
 	void resultsReceived(int, ImportTrackDataVector&);
124
 
125
+private slots:
126
+	/**
127
+	 * Process server response with lookup data.
128
+	 *
129
+	 * @param index    index of file
130
+	 * @param response response from server
131
+	 */
132
+	void parseLookupResponse(int index, const QCString& response);
133
+
134
 #ifdef HAVE_TUNEPIMP
135
 private:
136
 	/**
137
@@ -126,6 +238,9 @@
138
 	tunepimp_t m_tp;
139
 	int* m_ids;
140
 	int m_numFiles;
141
+#if HAVE_TUNEPIMP >= 5
142
+	LookupQuery* m_lookupQuery;
143
+#endif
144
 #endif // HAVE_TUNEPIMP
145
 };
146
 
(-)/home/makc/porting/ports/audio/kid3/files/patch-kid3__oggfile.cpp (+11 lines)
Line 0 Link Here
1
--- ./kid3/oggfile.cpp.orig	Fri Jan 27 21:15:27 2006
2
+++ ./kid3/oggfile.cpp	Sat Sep 23 01:27:49 2006
3
@@ -143,7 +143,7 @@
4
 			bool setUtime = false;
5
 			struct utimbuf times;
6
 			if (preserve) {
7
-				int fd = ::fileno(fpIn);
8
+				int fd = fileno(fpIn);
9
 				if (fd >= 0) {
10
 					struct stat fileStat;
11
 					if (::fstat(fd, &fileStat) == 0) {
(-)/home/makc/porting/ports/audio/kid3/files/patch-po__Makefile.in (+28 lines)
Line 0 Link Here
1
--- ./po/Makefile.in.orig	Tue Jun 27 23:34:40 2006
2
+++ ./po/Makefile.in	Sat Sep 23 01:27:55 2006
3
@@ -297,7 +297,7 @@
4
 #>+ 3
5
 	cd $(top_srcdir) && \
6
 	  $(AUTOMAKE) --gnu  po/Makefile
7
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/po/Makefile.in
8
+	cd $(top_srcdir) && perl admin/am_edit po/Makefile.in
9
 Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
10
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
11
 
12
@@ -451,7 +451,6 @@
13
 # Otherwise a system limit (for SysV at least) may be exceeded.
14
 .NOEXPORT:
15
 
16
-
17
 #>+ 2
18
 KDE_DIST=ru.gmo de.po de.gmo es.po es.gmo kid3.pot ru.po Makefile.in 
19
 
20
@@ -511,7 +510,7 @@
21
 force-reedit:
22
 		cd $(top_srcdir) && \
23
 	  $(AUTOMAKE) --gnu  po/Makefile
24
-	cd $(top_srcdir) && perl admin/am_edit -padmin kid3-0.7/po/Makefile.in
25
+	cd $(top_srcdir) && perl admin/am_edit po/Makefile.in
26
 
27
 
28
 #>+ 21

Return to bug 105220