[vlc-commits] Contribs: add CDDB
Jean-Baptiste Kempf
git at videolan.org
Sun Aug 7 00:24:55 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Aug 6 21:47:22 2011 +0200| [5a09c805337adeeeacd317bd58dd9f4974fb730b] | committer: Jean-Baptiste Kempf
Contribs: add CDDB
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5a09c805337adeeeacd317bd58dd9f4974fb730b
---
contrib/src/cddb/SHA512SUMS | 1 +
contrib/src/cddb/cross.patch | 30 ++++++++++++++++++++++++++++++
contrib/src/cddb/getenv-crash.patch | 23 +++++++++++++++++++++++
contrib/src/cddb/rules.mak | 30 ++++++++++++++++++++++++++++++
contrib/src/cddb/win32-pkg.patch | 9 +++++++++
5 files changed, 93 insertions(+), 0 deletions(-)
diff --git a/contrib/src/cddb/SHA512SUMS b/contrib/src/cddb/SHA512SUMS
new file mode 100644
index 0000000..089ec92
--- /dev/null
+++ b/contrib/src/cddb/SHA512SUMS
@@ -0,0 +1 @@
+0e07e7d37f2013164d75b530a5528f54847271fd20f3b7bedb192a05d1f61dcf006d10dc2927efe155a01eddcc57b940bc31d8ac88d5dfc4f1a09771caa84e0a libcddb-1.3.2.tar.bz2
diff --git a/contrib/src/cddb/cross.patch b/contrib/src/cddb/cross.patch
new file mode 100644
index 0000000..c57746f
--- /dev/null
+++ b/contrib/src/cddb/cross.patch
@@ -0,0 +1,30 @@
+--- libcddb/Makefile.am.orig 2009-10-24 17:24:43.000000000 +0200
++++ libcddb/Makefile.am 2009-10-24 17:26:58.000000000 +0200
+@@ -1,5 +1,5 @@
+
+-SUBDIRS = include lib examples tests
++SUBDIRS = include lib
+ EXTRA_DIST = doc/doxygen.conf misc/$(PACKAGE).ebuild
+
+ dist-hook:
+--- libcddb/configure.ac.orig 2009-10-25 01:51:35.000000000 +0200
++++ libcddb/configure.ac 2009-10-25 01:51:44.000000000 +0200
+@@ -107,8 +107,6 @@
+ AC_TYPE_SIZE_T
+
+ dnl Checks for library functions.
+-AC_FUNC_MALLOC
+-AC_FUNC_REALLOC
+ AC_FUNC_STAT
+ AC_FUNC_VPRINTF
+ AC_FUNC_SELECT_ARGTYPES
+--- libcddb/include/cddb/cddb_ni.h.orig 2009-10-25 21:58:20.000000000 +0100
++++ libcddb/include/cddb/cddb_ni.h 2009-10-25 21:58:46.000000000 +0100
+@@ -35,6 +35,7 @@
+ # include <iconv.h>
+ #else
+ typedef void *iconv_t; /* for code uniformity */
++ #define ICONV_CONST const
+ #endif
+
+ #ifdef HAVE_WINDOWS_H
diff --git a/contrib/src/cddb/getenv-crash.patch b/contrib/src/cddb/getenv-crash.patch
new file mode 100644
index 0000000..48888ef
--- /dev/null
+++ b/contrib/src/cddb/getenv-crash.patch
@@ -0,0 +1,23 @@
+--- libcddb/lib/cddb_conn.c 2006-10-15 13:53:11.000000000 +0200
++++ libcddb.new/lib/cddb_conn.c 2010-11-28 21:03:39.012749230 +0100
+@@ -100,9 +100,17 @@
+ c->use_cache = CACHE_ON;
+ /* construct cache dir '$HOME/[DEFAULT_CACHE]' */
+ s = getenv("HOME");
+- c->cache_dir = (char*)malloc(strlen(s) + 1 + sizeof(DEFAULT_CACHE) + 1);
+- sprintf(c->cache_dir, "%s/%s", s, DEFAULT_CACHE);
+- c->cache_read = FALSE;
++ if( s )
++ {
++ c->cache_dir = (char*)malloc(strlen(s) + 1 + sizeof(DEFAULT_CACHE) + 1);
++ sprintf(c->cache_dir, "%s/%s", s, DEFAULT_CACHE);
++ c->cache_read = FALSE;
++ }
++ else
++ {
++ c->cache_dir = NULL;
++ c->use_cache = CACHE_OFF;
++ }
+
+ /* use anonymous at localhost */
+ c->user = strdup(DEFAULT_USER);
diff --git a/contrib/src/cddb/rules.mak b/contrib/src/cddb/rules.mak
new file mode 100644
index 0000000..93063b8
--- /dev/null
+++ b/contrib/src/cddb/rules.mak
@@ -0,0 +1,30 @@
+# CDDB
+CDDB_VERSION := 1.3.2
+CDDB_URL := $(SF)/libcddb/libcddb-$(CDDB_VERSION).tar.bz2
+
+ifdef BUILD_DISCS
+PKGS += cddb
+endif
+ifeq ($(call need_pkg,"libcddb"),)
+PKGS_FOUND += cddb
+endif
+
+$(TARBALLS)/libcddb-$(CDDB_VERSION).tar.bz2:
+ $(call download,$(CDDB_URL))
+
+.sum-cddb: libcddb-$(CDDB_VERSION).tar.bz2
+
+cddb: libcddb-$(CDDB_VERSION).tar.bz2 .sum-cddb
+ $(UNPACK)
+ $(APPLY) $(SRC)/cddb/cross.patch
+ $(APPLY) $(SRC)/cddb/getenv-crash.patch
+ifdef HAVE_WIN32
+ $(APPLY) $(SRC)/cddb/win32-pkg.patch
+endif
+ $(MOVE)
+
+.cddb: cddb .regex
+ $(RECONF)
+ cd $< && $(HOSTVARS) ./configure $(HOSTCONF) --without-iconv CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int"
+ cd $< && $(MAKE) install
+ touch $@
diff --git a/contrib/src/cddb/win32-pkg.patch b/contrib/src/cddb/win32-pkg.patch
new file mode 100644
index 0000000..06ca851
--- /dev/null
+++ b/contrib/src/cddb/win32-pkg.patch
@@ -0,0 +1,9 @@
+--- libcddb/libcddb.pc.in.orig 2009-10-25 21:36:57.000000000 +0100
++++ libcddb/libcddb.pc.in 2009-10-25 21:36:11.000000000 +0100
+@@ -6,5 +6,5 @@
+ Name: libcddb
+ Description: CDDB server access library
+ Version: @VERSION@
+-Libs: -L${libdir} -lcddb @LIBICONV@
++Libs: -L${libdir} -lcddb -lregex ${libdir}/libregex.a @LIBICONV@ -lws2_32
+ Cflags: -I${includedir}
More information about the vlc-commits
mailing list