diff --git a/mingw-w64-libcddb/0001-include-winsock2-before-windows.mingw.patch b/mingw-w64-libcddb/0001-include-winsock2-before-windows.mingw.patch new file mode 100644 index 0000000000..cc947f8e7a --- /dev/null +++ b/mingw-w64-libcddb/0001-include-winsock2-before-windows.mingw.patch @@ -0,0 +1,24 @@ +--- libcddb-1.3.2/include/cddb/cddb_ni.h.orig 2013-04-07 03:11:45 +0400 ++++ libcddb-1.3.2/include/cddb/cddb_ni.h 2013-04-07 03:30:10 +0400 +@@ -37,10 +37,6 @@ + typedef void *iconv_t; /* for code uniformity */ + #endif + +-#ifdef HAVE_WINDOWS_H +-#include +-#endif +- + #ifdef HAVE_WINSOCK2_H + #include + #ifndef ETIMEDOUT +@@ -54,6 +50,10 @@ + #endif + #endif + ++#ifdef HAVE_WINDOWS_H ++#include ++#endif ++ + #include "cddb/cddb_regex.h" + #include "cddb/cddb.h" + #include "cddb/cddb_conn_ni.h" diff --git a/mingw-w64-libcddb/0002-fix-header-conflict.mingw.patch b/mingw-w64-libcddb/0002-fix-header-conflict.mingw.patch new file mode 100644 index 0000000000..c4275728b3 --- /dev/null +++ b/mingw-w64-libcddb/0002-fix-header-conflict.mingw.patch @@ -0,0 +1,86 @@ +--- libcddb-1.3.2/include/cddb/cddb_conn.h.orig 2013-04-07 03:11:45 +0400 ++++ libcddb-1.3.2/include/cddb/cddb_conn.h 2013-04-07 03:33:25 +0400 +@@ -60,12 +60,12 @@ + * more of the constants below. + */ + typedef enum { +- SEARCH_NONE = 0, /**< no fields */ +- SEARCH_ARTIST = 1, /**< artist name field */ +- SEARCH_TITLE = 2, /**< disc title field */ +- SEARCH_TRACK = 4, /**< track title field */ +- SEARCH_OTHER = 8, /**< other fields */ +- SEARCH_ALL = ~0, /**< all fields */ ++ CDDB_SEARCH_NONE = 0, /**< no fields */ ++ CDDB_SEARCH_ARTIST = 1, /**< artist name field */ ++ CDDB_SEARCH_TITLE = 2, /**< disc title field */ ++ CDDB_SEARCH_TRACK = 4, /**< track title field */ ++ CDDB_SEARCH_OTHER = 8, /**< other fields */ ++ CDDB_SEARCH_ALL = ~0, /**< all fields */ + } cddb_search_t; + + /** +@@ -539,14 +539,14 @@ + * Set the bit-string specifying which categories to examine when + * performing a text search. The #SEARCHCAT macro needs to be used to + * build the actual bit-string from individual categories. The +- * #cddb_search_t values #SEARCH_NONE and #SEARCH_ALL are also valid. ++ * #cddb_search_t values #CDDB_SEARCH_NONE and #CDDB_SEARCH_ALL are also valid. + * The example below shows some possible combinations. By default all + * categories are searched. + * + * @code + * unsigned int cats = SEARCHCAT(CDDB_CAT_ROCK) | SEARCHCAT(CDDB_CAT_MISC); +- * unsigned int cats = SEARCH_ALL; +- * unsigned int cats = SEARCH_NONE; ++ * unsigned int cats = CDDB_SEARCH_ALL; ++ * unsigned int cats = CDDB_SEARCH_NONE; + * @endcode + * + * @param c The connection structure. +--- libcddb-1.3.2/lib/cddb_conn.c.orig 2013-04-07 03:11:45 +0400 ++++ libcddb-1.3.2/lib/cddb_conn.c 2013-04-07 03:34:09 +0400 +@@ -118,8 +118,8 @@ + c->charset->cd_to_freedb = NULL; + c->charset->cd_from_freedb = NULL; + +- c->srch.fields = SEARCH_ARTIST | SEARCH_TITLE; +- c->srch.cats = SEARCH_ALL; ++ c->srch.fields = CDDB_SEARCH_ARTIST | CDDB_SEARCH_TITLE; ++ c->srch.cats = CDDB_SEARCH_ALL; + } else { + cddb_log_crit(cddb_error_str(CDDB_ERR_OUT_OF_MEMORY)); + } +--- libcddb-1.3.2/lib/cddb_cmd.c.orig 2013-04-07 03:11:45 +0400 ++++ libcddb-1.3.2/lib/cddb_cmd.c 2013-04-07 03:34:04 +0400 +@@ -1256,25 +1256,25 @@ + + /* XXX: to buffer overflow checking */ + strcpy(p, "&allfields="); p += 11; +- if (params->fields == SEARCH_ALL) { ++ if (params->fields == CDDB_SEARCH_ALL) { + strcpy(p, "YES"); p += 3; + } else { + strcpy(p, "NO"); p += 2; +- if (params->fields & SEARCH_ARTIST) { ++ if (params->fields & CDDB_SEARCH_ARTIST) { + strcpy(p, "&fields=artist"); p += 14; + } +- if (params->fields & SEARCH_TITLE) { ++ if (params->fields & CDDB_SEARCH_TITLE) { + strcpy(p, "&fields=title"); p += 13; + } +- if (params->fields & SEARCH_TRACK) { ++ if (params->fields & CDDB_SEARCH_TRACK) { + strcpy(p, "&fields=track"); p += 13; + } +- if (params->fields & SEARCH_OTHER) { ++ if (params->fields & CDDB_SEARCH_OTHER) { + strcpy(p, "&fields=rest"); p += 12; + } + } + strcpy(p, "&allcats="); p += 9; +- if (params->cats == SEARCH_ALL) { ++ if (params->cats == CDDB_SEARCH_ALL) { + strcpy(p, "YES"); p += 3; + } else { + strcpy(p, "NO"); p += 2; diff --git a/mingw-w64-libcddb/0003-silent-rules.mingw.patch b/mingw-w64-libcddb/0003-silent-rules.mingw.patch new file mode 100644 index 0000000000..aab3276af5 --- /dev/null +++ b/mingw-w64-libcddb/0003-silent-rules.mingw.patch @@ -0,0 +1,22 @@ +--- libcddb-1.3.2/configure.ac.orig 2013-04-07 03:34:43 +0400 ++++ libcddb-1.3.2/configure.ac 2013-04-07 03:36:58 +0400 +@@ -13,7 +13,7 @@ + examples/Makefile \ + tests/Makefile \ + tests/settings.sh]) +-AM_INIT_AUTOMAKE([dist-bzip2]) ++AM_INIT_AUTOMAKE([silent-rules dist-bzip2]) + AM_MAINTAINER_MODE + + LIBCDDB_VERSION_NUM=131 +--- libcddb-1.3.2/configure.ac.orig 2013-04-07 03:37:21 +0400 ++++ libcddb-1.3.2/configure.ac 2013-04-07 03:38:02 +0400 +@@ -2,7 +2,7 @@ + AC_PREREQ(2.55) + AC_INIT(libcddb, 1.3.2) + AC_CONFIG_SRCDIR(configure.ac) +-AM_CONFIG_HEADER(config.h) ++AC_CONFIG_HEADER(config.h) + AC_CONFIG_FILES([Makefile \ + libcddb.pc \ + include/Makefile \ diff --git a/mingw-w64-libcddb/0004-hack-around-dummy-alarm.mingw.patch b/mingw-w64-libcddb/0004-hack-around-dummy-alarm.mingw.patch new file mode 100644 index 0000000000..a8b02f63b1 --- /dev/null +++ b/mingw-w64-libcddb/0004-hack-around-dummy-alarm.mingw.patch @@ -0,0 +1,11 @@ +--- libcddb-1.3.2/configure.ac.orig 2013-04-07 03:41:23 +0400 ++++ libcddb-1.3.2/configure.ac 2013-04-07 03:49:49 +0400 +@@ -112,7 +112,7 @@ + AC_FUNC_STAT + AC_FUNC_VPRINTF + AC_FUNC_SELECT_ARGTYPES +-AC_CHECK_FUNCS([mkdir regcomp socket strdup strtol strchr memset alarm select realloc]) ++AC_CHECK_FUNCS([mkdir regcomp socket strdup strtol strchr memset select realloc]) + AC_CHECK_FUNC([gethostbyname], , AC_CHECK_LIB([nsl], [gethostbyname])) + + dnl Check for libcdio diff --git a/mingw-w64-libcddb/0005-fix-m4-dir.all.patch b/mingw-w64-libcddb/0005-fix-m4-dir.all.patch new file mode 100644 index 0000000000..7684f39dd6 --- /dev/null +++ b/mingw-w64-libcddb/0005-fix-m4-dir.all.patch @@ -0,0 +1,10 @@ +--- libcddb-1.3.2/configure.ac.orig 2013-08-11 13:54:03.236705300 +0000 ++++ libcddb-1.3.2/configure.ac 2013-08-11 14:06:32.045792000 +0000 +@@ -13,6 +13,7 @@ + examples/Makefile \ + tests/Makefile \ + tests/settings.sh]) ++AC_CONFIG_MACRO_DIR([m4]) + AM_INIT_AUTOMAKE([silent-rules dist-bzip2]) + AM_MAINTAINER_MODE + diff --git a/mingw-w64-libcddb/0006-update-gettext-req.mingw.patch b/mingw-w64-libcddb/0006-update-gettext-req.mingw.patch new file mode 100644 index 0000000000..c7e470c6bf --- /dev/null +++ b/mingw-w64-libcddb/0006-update-gettext-req.mingw.patch @@ -0,0 +1,11 @@ +--- libcddb-1.3.2/configure.ac.orig 2013-08-11 14:30:08.872206100 +0000 ++++ libcddb-1.3.2/configure.ac 2013-08-11 15:06:19.082787900 +0000 +@@ -21,7 +21,7 @@ + AC_SUBST(LIBCDDB_VERSION_NUM) + + dnl iconv uses gettext macros (dependency on config.rpath) +-AM_GNU_GETTEXT_VERSION(0.14.4) ++AM_GNU_GETTEXT_VERSION(0.18.3) + + dnl Process custom command-line options + AC_ARG_ENABLE([loglevel], diff --git a/mingw-w64-libcddb/0007-link-to-libiconv-properly.mingw.patch b/mingw-w64-libcddb/0007-link-to-libiconv-properly.mingw.patch new file mode 100644 index 0000000000..b336f6590d --- /dev/null +++ b/mingw-w64-libcddb/0007-link-to-libiconv-properly.mingw.patch @@ -0,0 +1,8 @@ +--- libcddb-1.3.2/lib/Makefile.am.orig 2009-03-01 03:28:07.000000000 +0000 ++++ libcddb-1.3.2/lib/Makefile.am 2013-08-11 15:50:41.118323400 +0000 +@@ -6,4 +6,4 @@ + cddb_conn.c cddb_cmd.c cddb_net.c cddb_log.c cddb_util.c \ + cddb.c cddb_site.c ll.c + libcddb_la_LDFLAGS = -no-undefined -version-info 4:3:2 +-libcddb_la_LIBADD = $(LIBICONV) ++libcddb_la_LIBADD = $(LTLIBICONV) diff --git a/mingw-w64-libcddb/PKGBUILD b/mingw-w64-libcddb/PKGBUILD new file mode 100644 index 0000000000..5f7efa24c0 --- /dev/null +++ b/mingw-w64-libcddb/PKGBUILD @@ -0,0 +1,61 @@ +# Maintainer: Alexey Pavlov +# Contributor: AlexWMF + +_realname=libcddb +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=1.3.2 +pkgrel=1 +pkgdesc="Library that implements the different protocols (CDDBP, HTTP, SMTP) to access data on a CDDB server (e.g. http://freedb.org)." +arch=('any') +license=('LGPL') +url="http://sourceforge.net/projects/libcddb/" +options=('staticlibs' 'strip') +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-pkg-config") +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") +source=(http://downloads.sourceforge.net/sourceforge/${_realname}/${_realname}-${pkgver}.tar.bz2 + 0001-include-winsock2-before-windows.mingw.patch + 0002-fix-header-conflict.mingw.patch + 0003-silent-rules.mingw.patch + 0004-hack-around-dummy-alarm.mingw.patch + 0005-fix-m4-dir.all.patch + 0006-update-gettext-req.mingw.patch + 0007-link-to-libiconv-properly.mingw.patch) +md5sums=('8bb4a6f542197e8e9648ae597cd6bc8a' + '002cfcf7e6546d0f8a61db838ffcf8ee' + 'f10190b965b393b88342bed19cb885c8' + 'fa707c87961396c60208ea5252886d2b' + '6b2f413c58cddd59d7438d7b9c424abb' + '981ff1dd9cb3f64751ec565a93fed8e6' + 'c5ad153f6e223bf31e43d764f6d3aa85' + '880ef92c7e93bfefc8e96c5201c225f8') + +prepare() { + cd ${_realname}-${pkgver} + patch -p1 -i ${srcdir}/0001-include-winsock2-before-windows.mingw.patch + patch -p1 -i ${srcdir}/0002-fix-header-conflict.mingw.patch + patch -p1 -i ${srcdir}/0003-silent-rules.mingw.patch + patch -p1 -i ${srcdir}/0004-hack-around-dummy-alarm.mingw.patch + patch -p1 -i ${srcdir}/0005-fix-m4-dir.all.patch + patch -p1 -i ${srcdir}/0006-update-gettext-req.mingw.patch + patch -p1 -i ${srcdir}/0007-link-to-libiconv-properly.mingw.patch + + WANT_AUTOMAKE=latest autoreconf -fi +} + +build() { + mkdir -p build-${MINGW_CHOST} + cd build-${MINGW_CHOST} + ../${_realname}-${pkgver}/configure \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --enable-shared \ + --enable-static + make +} + +package() { + cd build-${MINGW_CHOST} + make DESTDIR="${pkgdir}" install +}