Contrib: libcddb for Windows.
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 24 Oct 2009 15:28:54 +0000 (17:28 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 26 Oct 2009 21:13:31 +0000 (22:13 +0100)
Libcddb doesn't work as advertised, you need regex to make it work.
Regex is supposed to be in your libc, but isn't in mingw... Great...
So, add a regex target and patch libcddb to not build tests and examples
Also, don't use AC_FUNC_MALLOC and REALLOC when crosscompiling and change the .pc file

extras/contrib/src/Makefile
extras/contrib/src/Patches/libcddb-cross.patch [new file with mode: 0644]
extras/contrib/src/packages.mak

index cc04f41..151f62d 100644 (file)
@@ -1426,8 +1426,13 @@ libcddb-$(CDDB_VERSION).tar.bz2:
 
 libcddb: libcddb-$(CDDB_VERSION).tar.bz2
        $(EXTRACT_BZ2)
+       (cd $@; patch -p0 < ../Patches/libcddb-cross.patch && autoreconf -fisv)
 
+ifdef HAVE_WIN32
+.cddb: libcddb .regex
+else
 .cddb: libcddb
+endif
        (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-shared --enable-static CFLAGS="$(CFLAGS) -D_BSD_SOCKLEN_T_=int" LDFLAGS="$(LDFLAGS) -liconv" && make && make install)
        touch $@
 
@@ -2597,6 +2602,25 @@ peflags/peflags.c:
 
 CLEAN_PKG += peflags
 CLEAN_FILES += .peflags
+
+# ************
+# Regex
+# ************
+
+regex-$(REGEX_VERSION).tar.gz:
+       $(WGET) $(REGEX_URL)
+
+regex: regex-$(REGEX_VERSION).tar.gz
+       $(EXTRACT_GZ)
+
+.regex: regex
+       (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) && make subirs= && $(AR) ru libregex.a regex.o && $(RANLIB) libregex.a && cp -v regex.h $(PREFIX)/include && cp -v libregex.a $(PREFIX)/lib )
+
+CLEAN_FILE += .regex
+CLEAN_PKG += regex
+DISTCLEAN_PKG += regex-$(REGEX_VERSION).tar.gz
+
+
 # ***************************************************************************
 # Some cleaning
 # ***************************************************************************
diff --git a/extras/contrib/src/Patches/libcddb-cross.patch b/extras/contrib/src/Patches/libcddb-cross.patch
new file mode 100644 (file)
index 0000000..b5215dd
--- /dev/null
@@ -0,0 +1,29 @@
+--- Makefile.am.orig   2009-10-24 17:24:43.000000000 +0200
++++ 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:
+--- configure.ac.orig  2009-10-25 01:51:35.000000000 +0200
++++ 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.pc.in.orig 2009-10-25 21:36:57.000000000 +0100
++++ 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 ${libdir}/libregex.a @LIBICONV@
+ Cflags: -I${includedir}
index 8444f1e..0667e4a 100644 (file)
@@ -129,6 +129,8 @@ LIBDTS_URL=http://debian.unnet.nl/pub/videolan/libdts/$(LIBDTS_VERSION)/libdts-$
 LIBDCA_SVN=svn://svn.videolan.org/libdca/trunk
 MODPLUG_VERSION=0.8.7
 MODPLUG_URL=$(SF)/modplug-xmms/libmodplug-$(MODPLUG_VERSION).tar.gz
+REGEX_VERSION=0.12
+REGEX_URL=http://ftp.gnu.org/old-gnu/regex/regex-$(REGEX_VERSION).tar.gz
 CDDB_VERSION=1.3.2
 CDDB_URL=$(SF)/libcddb/libcddb-$(CDDB_VERSION).tar.bz2
 VCDIMAGER_VERSION=0.7.23