diff --git a/libxml2/2.7.3-doc-install.patch b/libxml2/2.7.3-doc-install.patch new file mode 100644 index 00000000..ebeb5a7f --- /dev/null +++ b/libxml2/2.7.3-doc-install.patch @@ -0,0 +1,24 @@ +--- libxml2-2.7.3/Makefile.am 2008-09-25 11:21:07.000000000 -0500 ++++ libxml2-2.7.3/Makefile.am 2009-03-16 21:42:28.390625000 -0500 +@@ -1198,7 +1198,7 @@ pkgconfig_DATA = libxml-2.0.pc + # Install the tests program sources as examples + # + BASE_DIR=$(datadir)/doc +-DOC_MODULE=libxml2-$(VERSION) ++DOC_MODULE=libxml2 + EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples + + install-data-local: +--- libxml2-2.7.3/python/Makefile.am 2008-02-21 15:53:06.000000000 -0600 ++++ libxml2-2.7.3/python/Makefile.am 2009-03-16 21:08:12.859375000 -0500 +@@ -9,1 +9,1 @@ INCLUDES = \ +-docsdir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION) ++docsdir = $(datadir)/doc/python-libxml2 +--- libxml2-2.7.3/python/tests/Makefile.am 2008-09-25 11:21:03.000000000 -0500 ++++ libxml2-2.7.3/python/tests/Makefile.am 2009-03-16 21:07:47.468750000 -0500 +@@ -1,4 +1,4 @@ +-exampledir = $(datadir)/doc/libxml2-python-$(LIBXML_VERSION)/examples ++exampledir = $(datadir)/doc/python-libxml2/examples + dist_example_DATA = $(PYTESTS) $(XMLS) + + PYTESTS= \ diff --git a/libxml2/PKGBUILD b/libxml2/PKGBUILD new file mode 100644 index 00000000..02554a14 --- /dev/null +++ b/libxml2/PKGBUILD @@ -0,0 +1,99 @@ +# Maintainer: Alexey Pavlov + +pkgname=('libxml2' 'libxml2-devel') +pkgver=2.9.1 +pkgrel=1 +pkgdesc="XML parsing library, version 2" +arch=(i686 x86_64) +license=('MIT') +depends=('zlib' 'libreadline' 'ncurses' 'liblzma') +makedepends=('python2' 'python3') +install=libxml2.install +url="http://www.xmlsoft.org/" +source=(ftp://ftp.xmlsoft.org/${pkgname}/${pkgname}-${pkgver}.tar.gz + http://www.w3.org/XML/Test/xmlts20080827.tar.gz + libxml2-2.9.0-do-not-check-crc.patch + 2.7.3-doc-install.patch + libxml2-2.8.0_rc1-winnt.patch + libxml2-2.9.1-compression-detection.patch + libxml2-2.9.1-missing-break.patch + libxml2-2.9.1-msys2.patch + libxml2-2.9.1-non-ascii-cr-lf.patch + libxml2-2.9.1-python-2.6.patch + libxml2-2.9.1-python3.patch + libxml2-2.9.1-python3a.patch) +md5sums=('9c0cfef285d5c4a5c80d00904ddab380' + 'ae3d1ebe000a3972afa104ca7f0e1b4a' + '08e92a1d05827f4152ab30bd56655fdd' + 'f55c43ccb3ec01a61c1436b0bcd1a4ca' + '2a38e25bead58e4b4dc4550317369c90' + 'e5e9b6425531b8f757d77dfd96280dc0' + '459e4b2b3f37113df6c731598b91e2b7' + '3bbefa352e2f560f630b5d5fae1d645a' + 'a73813838ec20f8b7eb47db9cb96f09e' + 'efc796f7fa5aa9678b61bb5cb7d87561' + '1fbd4215c81ca3286873bfb2a3f101f3' + 'c024dbf5eb208fad6dde89dc9819bc90') + +prepare() { + cd ${srcdir} + mv xmlconf -t ${pkgname}-${pkgver} + + cd ${pkgname}-${pkgver} + + patch -p1 -i ${srcdir}/libxml2-2.9.0-do-not-check-crc.patch + patch -p1 -i ${srcdir}/2.7.3-doc-install.patch + patch -p1 -i ${srcdir}/libxml2-2.8.0_rc1-winnt.patch + patch -p1 -i ${srcdir}/libxml2-2.9.1-compression-detection.patch + patch -p1 -i ${srcdir}/libxml2-2.9.1-missing-break.patch + patch -p1 -i ${srcdir}/libxml2-2.9.1-non-ascii-cr-lf.patch + patch -p1 -i ${srcdir}/libxml2-2.9.1-python-2.6.patch + patch -p1 -i ${srcdir}/libxml2-2.9.1-python3.patch + patch -p1 -i ${srcdir}/libxml2-2.9.1-python3a.patch + patch -p1 -i ${srcdir}/libxml2-2.9.1-msys2.patch + + sed -e 's|/usr/bin/python -u|/usr/bin/python2 -u|g' -e 's|/usr/bin/python$|/usr/bin/python2|g' -i python/tests/*.py + + autoreconf -fi +} + +build() { + cd ${pkgname}-${pkgver} + ./configure --build=${CHOST} --host=${CHOST} --target=${CHOST} \ + --prefix=/usr \ + --enable-ipv6 \ + --with-history \ + --with-html-dir=/usr/share/doc \ + --with-html-subdir=libxml2/html + make + make DESTDIR=${srcdir}/dest install +} + +check() { + cd ${pkgname}-${pkgver} + make check +} + +package_libxml2() { + groups=('libraries') + + mkdir -p ${pkgdir}/usr/share + cp -rf ${srcdir}/dest/usr/bin ${pkgdir}/usr/ + rm -f ${pkgdir}/usr/bin/*-config + cp -rf ${srcdir}/dest/usr/share/man ${pkgdir}/usr/share/ + install -Dm644 ${srcdir}/${pkgname}-${pkgver}/COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING" +} + +package_libxml2-devel() { + pkgdesc="Libxml2 headers and libraries" + groups=('development') + options=('staticlibs') + + mkdir -p ${pkgdir}/usr/{bin,share} + cp -f ${srcdir}/dest/usr/bin/*-config ${pkgdir}/usr/bin/ + cp -rf ${srcdir}/dest/usr/include ${pkgdir}/usr/ + cp -rf ${srcdir}/dest/usr/lib ${pkgdir}/usr/ + cp -rf ${srcdir}/dest/usr/share/aclocal ${pkgdir}/usr/share/ + cp -rf ${srcdir}/dest/usr/share/doc ${pkgdir}/usr/share/ + cp -rf ${srcdir}/dest/usr/share/gtk-doc ${pkgdir}/usr/share/ +} \ No newline at end of file diff --git a/libxml2/libxml2-2.8.0_rc1-winnt.patch b/libxml2/libxml2-2.8.0_rc1-winnt.patch new file mode 100644 index 00000000..cce3ecb0 --- /dev/null +++ b/libxml2/libxml2-2.8.0_rc1-winnt.patch @@ -0,0 +1,91 @@ +From 168e20836fe9614dd2dd4b42006c17a783f11c48 Mon Sep 17 00:00:00 2001 +From: Markus Duft +Date: Thu, 20 Nov 2008 11:04:33 -0500 +Subject: [PATCH] Fix for ~x86-winnt + +[Alexandre Rostovtsev : port to 2.8.0-rc1] +--- + dict.c | 2 +- + include/wsockcompat.h | 2 +- + nanohttp.c | 2 +- + xmlIO.c | 4 ++++ + 4 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/dict.c b/dict.c +index 3579f64..71e7bc6 100644 +--- a/dict.c ++++ b/dict.c +@@ -47,7 +47,7 @@ + #else + #ifdef HAVE_INTTYPES_H + #include +-#elif defined(WIN32) ++#elif defined(WIN32) || defined (__PARITY__) + typedef unsigned __int32 uint32_t; + #endif + #endif +diff --git a/include/wsockcompat.h b/include/wsockcompat.h +index c762a64..1ed822b 100644 +--- a/include/wsockcompat.h ++++ b/include/wsockcompat.h +@@ -27,7 +27,7 @@ + #endif + #endif + +-#if defined( __MINGW32__ ) || defined( _MSC_VER ) ++#if defined( __MINGW32__ ) || defined( _MSC_VER ) || defined(__PARITY__) + /* Include here to ensure that it doesn't get included later + * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */ + #include +diff --git a/nanohttp.c b/nanohttp.c +index 2437fed..dbe97a7 100644 +--- a/nanohttp.c ++++ b/nanohttp.c +@@ -74,7 +74,7 @@ + #define XML_SOCKLEN_T unsigned int + #endif + +-#if defined(__MINGW32__) || defined(_WIN32_WCE) ++#if defined(__MINGW32__) || defined(_WIN32_WCE) || defined(__PARITY__) + #ifndef _WINSOCKAPI_ + #define _WINSOCKAPI_ + #endif +diff --git a/xmlIO.c b/xmlIO.c +index 73a995d..99562f6 100644 +--- a/xmlIO.c ++++ b/xmlIO.c +@@ -47,6 +47,7 @@ + #include /* for CP_UTF8 */ + #endif + ++#ifndef __PARITY__ + /* Figure a portable way to know if a file is a directory. */ + #ifndef HAVE_STAT + # ifdef HAVE__STAT +@@ -82,6 +83,7 @@ + # endif + # endif + #endif ++#endif /* __PARITY__ */ + + #include + #include +@@ -657,6 +659,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info) + { + #ifdef HAVE_STAT + int retval = -1; ++#ifndef __PARITY__ + wchar_t *wPath; + + wPath = __xmlIOWin32UTF8ToWChar(path); +@@ -665,6 +668,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info) + retval = _wstat(wPath,info); + xmlFree(wPath); + } ++#endif + /* maybe path in native encoding */ + if(retval < 0) + retval = stat(path,info); +-- +1.7.8.6 + diff --git a/libxml2/libxml2-2.9.0-do-not-check-crc.patch b/libxml2/libxml2-2.9.0-do-not-check-crc.patch new file mode 100644 index 00000000..3e650776 --- /dev/null +++ b/libxml2/libxml2-2.9.0-do-not-check-crc.patch @@ -0,0 +1,35 @@ +diff -up libxml2-2.9.0/xzlib.c.do-not-check-crc libxml2-2.9.0/xzlib.c +--- libxml2-2.9.0/xzlib.c.do-not-check-crc 2012-09-11 05:52:46.000000000 +0200 ++++ libxml2-2.9.0/xzlib.c 2012-11-19 19:28:42.431700534 +0100 +@@ -552,17 +552,20 @@ xz_decomp(xz_statep state) + #ifdef HAVE_ZLIB_H + if (state->how == GZIP) { + if (gz_next4(state, &crc) == -1 || gz_next4(state, &len) == -1) { +- xz_error(state, LZMA_DATA_ERROR, "unexpected end of file"); +- return -1; +- } +- if (crc != state->zstrm.adler) { +- xz_error(state, LZMA_DATA_ERROR, "incorrect data check"); +- return -1; +- } +- if (len != (state->zstrm.total_out & 0xffffffffL)) { +- xz_error(state, LZMA_DATA_ERROR, "incorrect length check"); +- return -1; +- } ++ /* ++ xz_error(state, LZMA_DATA_ERROR, "unexpected end of file"); ++ return -1; ++ */ ++ } else { ++ if (crc != state->zstrm.adler) { ++ xz_error(state, LZMA_DATA_ERROR, "incorrect data check"); ++ return -1; ++ } ++ if (len != (state->zstrm.total_out & 0xffffffffL)) { ++ xz_error(state, LZMA_DATA_ERROR, "incorrect length check"); ++ return -1; ++ } ++ } + state->strm.avail_in = 0; + state->strm.next_in = NULL; + state->strm.avail_out = 0; diff --git a/libxml2/libxml2-2.9.1-compression-detection.patch b/libxml2/libxml2-2.9.1-compression-detection.patch new file mode 100644 index 00000000..16ea5c19 --- /dev/null +++ b/libxml2/libxml2-2.9.1-compression-detection.patch @@ -0,0 +1,126 @@ +From 63588f476f2dc89d4c6ef70a474d7230fbf4d45e Mon Sep 17 00:00:00 2001 +From: Daniel Veillard +Date: Fri, 10 May 2013 14:01:46 +0800 +Subject: [PATCH] Fix a regression in xmlGetDocCompressMode() + +The switch to xzlib had for consequence that the compression +level of the input was not gathered anymore in ctxt->input->buf, +then the parser compression flags was left to -1 and propagated +to the resulting document. +Fix the I/O layer to get compression detection in xzlib, +then carry it in the input buffer and the resulting document + + This should fix + https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3456 +--- + parser.c | 4 ++++ + xmlIO.c | 17 +++++++++++++++++ + xzlib.c | 25 +++++++++++++++++++++++++ + xzlib.h | 1 + + 4 files changed, 47 insertions(+) + +diff --git a/parser.c b/parser.c +index 1d478c3..4a442bb 100644 +--- a/parser.c ++++ b/parser.c +@@ -10681,6 +10681,10 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { + ctxt->sax->startDocument(ctxt->userData); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); ++ if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) && ++ (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) { ++ ctxt->myDoc->compression = ctxt->input->buf->compressed; ++ } + + /* + * The Misc part of the Prolog +diff --git a/xmlIO.c b/xmlIO.c +index 847cb7e..fc4e111 100644 +--- a/xmlIO.c ++++ b/xmlIO.c +@@ -2669,6 +2669,12 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) { + #endif + } + #endif ++#ifdef HAVE_LZMA_H ++ if ((xmlInputCallbackTable[i].opencallback == xmlXzfileOpen) && ++ (strcmp(URI, "-") != 0)) { ++ ret->compressed = __libxml2_xzcompressed(context); ++ } ++#endif + } + else + xmlInputCallbackTable[i].closecallback (context); +@@ -3325,6 +3331,17 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) { + if (res < 0) { + return(-1); + } ++ ++ /* ++ * try to establish compressed status of input if not done already ++ */ ++ if (in->compressed == -1) { ++#ifdef HAVE_LZMA_H ++ if (in->readcallback == xmlXzfileRead) ++ in->compressed = __libxml2_xzcompressed(in->context); ++#endif ++ } ++ + len = res; + if (in->encoder != NULL) { + unsigned int use; +diff --git a/xzlib.c b/xzlib.c +index 928bd17..150e803 100644 +--- a/xzlib.c ++++ b/xzlib.c +@@ -182,12 +182,37 @@ xz_open(const char *path, int fd, const char *mode ATTRIBUTE_UNUSED) + return (xzFile) state; + } + ++static int ++xz_compressed(xzFile f) { ++ xz_statep state; ++ ++ if (f == NULL) ++ return(-1); ++ state = (xz_statep) f; ++ if (state->init <= 0) ++ return(-1); ++ ++ switch (state->how) { ++ case COPY: ++ return(0); ++ case GZIP: ++ case LZMA: ++ return(1); ++ } ++ return(-1); ++} ++ + xzFile + __libxml2_xzopen(const char *path, const char *mode) + { + return xz_open(path, -1, mode); + } + ++int ++__libxml2_xzcompressed(xzFile f) { ++ return xz_compressed(f); ++} ++ + xzFile + __libxml2_xzdopen(int fd, const char *mode) + { +diff --git a/xzlib.h b/xzlib.h +index 43c75e1..29ba55e 100644 +--- a/xzlib.h ++++ b/xzlib.h +@@ -15,4 +15,5 @@ xzFile __libxml2_xzopen(const char *path, const char *mode); + xzFile __libxml2_xzdopen(int fd, const char *mode); + int __libxml2_xzread(xzFile file, void *buf, unsigned len); + int __libxml2_xzclose(xzFile file); ++int __libxml2_xzcompressed(xzFile f); + #endif /* LIBXML2_XZLIB_H */ +-- +1.8.3.2 + diff --git a/libxml2/libxml2-2.9.1-missing-break.patch b/libxml2/libxml2-2.9.1-missing-break.patch new file mode 100644 index 00000000..57665323 --- /dev/null +++ b/libxml2/libxml2-2.9.1-missing-break.patch @@ -0,0 +1,25 @@ +From 10ec19ab0a49936ca8ca0d6962d24d3f889960a5 Mon Sep 17 00:00:00 2001 +From: dcb +Date: Thu, 2 May 2013 16:11:46 +0800 +Subject: [PATCH] Fix missing break on last() function for attributes + +pointed out by cppcheck +--- + python/libxml.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/python/libxml.c b/python/libxml.c +index 03cfb9f..3338b83 100644 +--- a/python/libxml.c ++++ b/python/libxml.c +@@ -2683,6 +2683,7 @@ libxml_last(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) + xmlAttrPtr attr = (xmlAttrPtr) cur; + + res = attr->last; ++ break; + } + default: + res = NULL; +-- +1.8.3.2 + diff --git a/libxml2/libxml2-2.9.1-msys2.patch b/libxml2/libxml2-2.9.1-msys2.patch new file mode 100644 index 00000000..90d44a12 --- /dev/null +++ b/libxml2/libxml2-2.9.1-msys2.patch @@ -0,0 +1,739 @@ +diff -Naur libxml2-2.9.1-orig/config.guess libxml2-2.9.1/config.guess +--- libxml2-2.9.1-orig/config.guess 2013-04-19 07:36:12.000000000 +0000 ++++ libxml2-2.9.1/config.guess 2013-04-29 06:01:34.328757800 +0000 +@@ -844,6 +844,9 @@ + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; ++ amd64:MSYS*:*:* | x86_64:MSYS*:*:*) ++ echo x86_64-unknown-msys ++ exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; +diff -Naur libxml2-2.9.1-orig/configure libxml2-2.9.1/configure +--- libxml2-2.9.1-orig/configure 2013-04-19 07:36:11.000000000 +0000 ++++ libxml2-2.9.1/configure 2013-04-29 06:01:07.297507800 +0000 +@@ -5233,7 +5233,7 @@ + lt_cv_sys_max_cmd_len=-1; + ;; + +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, +@@ -5422,7 +5422,7 @@ + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix +@@ -5430,12 +5430,12 @@ + ;; + esac + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix +@@ -5501,7 +5501,7 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi +@@ -5659,7 +5659,7 @@ + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +-cygwin*) ++cygwin* | msys*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' +@@ -5980,7 +5980,7 @@ + lt_cv_sharedlib_from_linklib_cmd='unknown' + + case $host_os in +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in +@@ -6473,7 +6473,7 @@ + aix*) + symcode='[BCDT]' + ;; +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; + hpux*) +@@ -8426,7 +8426,7 @@ + # PIC is the default for these OSes. + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -8510,7 +8510,7 @@ + fi + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' +@@ -9001,7 +9001,7 @@ + extract_expsyms_cmds= + + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +@@ -9116,7 +9116,7 @@ + fi + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' +@@ -9573,7 +9573,7 @@ + export_dynamic_flag_spec=-rdynamic + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is +@@ -10526,7 +10526,7 @@ + # libtool to hard-code these into programs + ;; + +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no +@@ -10558,6 +10558,12 @@ + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; ++ msys*) ++ # MSYS DLLs use 'msys-' prefix rather than 'lib' ++ soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ++ ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' +@@ -10592,7 +10598,7 @@ + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; +- cygwin*) ++ cygwin* | msys*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... +@@ -11257,7 +11263,7 @@ + lt_cv_dlopen_libs= + ;; + +- cygwin*) ++ cygwin* | msys*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; +@@ -13996,7 +14002,7 @@ + hppa*-hp-mpeix) + NEED_TRIO=1 + ;; +- *-*-mingw* | *-*-cygwin* | *-*-msvc* ) ++ *-*-mingw* | *-*-cygwin* | *-*-msys* | *-*-msvc* ) + # If the host is Windows, and shared libraries are disabled, we + # need to add -DLIBXML_STATIC to CFLAGS in order for linking to + # work properly (without it, xmlexports.h would force the use of +@@ -14205,6 +14211,55 @@ + fi + + ;; ++ *-*-msys*) ++ MODULE_EXTENSION=".dll" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lmsys-2.0" >&5 ++$as_echo_n "checking for dlopen in -lmsys-2.0... " >&6; } ++if ${ac_cv_lib_cygwin_dlopen+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lmsys-2.0 $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char dlopen (); ++int ++main () ++{ ++return dlopen (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_cygwin_dlopen=yes ++else ++ ac_cv_lib_cygwin_dlopen=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cygwin_dlopen" >&5 ++$as_echo "$ac_cv_lib_cygwin_dlopen" >&6; } ++if test "x$ac_cv_lib_cygwin_dlopen" = xyes; then : ++ ++ WITH_MODULES=1 ++ MODULE_PLATFORM_LIBS= ++ ++$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h ++ ++ ++fi ++ ++ ;; + *-*-mingw*) + MODULE_EXTENSION=".dll" + WITH_MODULES=1 +@@ -14472,7 +14527,7 @@ + fi + + case $host_os in +- *cygwin*) THREAD_LIBS="" ++ *cygwin* | *msys*) THREAD_LIBS="" + ;; + *beos*) WITH_THREADS="1" + THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" +@@ -15196,7 +15251,7 @@ + WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" + fi + ;; +- *-*-cygwin*) ++ *-*-cygwin* | *-*-msys*) + CYGWIN_EXTRA_LDFLAGS="-no-undefined" + if test "${PYTHON}" != "" + then +diff -Naur libxml2-2.9.1-orig/configure.in libxml2-2.9.1/configure.in +--- libxml2-2.9.1-orig/configure.in 2013-04-19 07:25:20.000000000 +0000 ++++ libxml2-2.9.1/configure.in 2013-04-29 05:55:24.313132800 +0000 +@@ -724,7 +724,7 @@ + hppa*-hp-mpeix) + NEED_TRIO=1 + ;; +- *-*-mingw* | *-*-cygwin* | *-*-msvc* ) ++ *-*-mingw* | *-*-cygwin* | *-*-msys* | *-*-msvc* ) + # If the host is Windows, and shared libraries are disabled, we + # need to add -DLIBXML_STATIC to CFLAGS in order for linking to + # work properly (without it, xmlexports.h would force the use of +@@ -850,6 +850,14 @@ + AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) + ]) + ;; ++ *-*-msys*) ++ MODULE_EXTENSION=".dll" ++ AC_CHECK_LIB(msys-2.0, dlopen, [ ++ WITH_MODULES=1 ++ MODULE_PLATFORM_LIBS= ++ AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) ++ ]) ++ ;; + *-*-mingw*) + MODULE_EXTENSION=".dll" + WITH_MODULES=1 +@@ -986,7 +994,7 @@ + fi + + case $host_os in +- *cygwin*) THREAD_LIBS="" ++ *cygwin* | *-*-msys*) THREAD_LIBS="" + ;; + *beos*) WITH_THREADS="1" + THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" +@@ -1503,7 +1511,7 @@ + WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" + fi + ;; +- *-*-cygwin*) ++ *-*-cygwin* | *-*-msys*) + CYGWIN_EXTRA_LDFLAGS="-no-undefined" + if test "${PYTHON}" != "" + then +diff -Naur libxml2-2.9.1-orig/ltmain.sh libxml2-2.9.1/ltmain.sh +--- libxml2-2.9.1-orig/ltmain.sh 2013-04-19 07:36:08.000000000 +0000 ++++ libxml2-2.9.1/ltmain.sh 2013-04-29 06:04:40.438132800 +0000 +@@ -1180,7 +1180,7 @@ + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in +- *cygwin* | *mingw* | *pw32* | *cegcc*) ++ *cygwin* | *msys* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; +@@ -2123,7 +2123,7 @@ + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in +- cygwin* | mingw* | pw32* | os2* | cegcc*) ++ cygwin* | *msys* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac +@@ -2992,7 +2992,7 @@ + 'exit $?' + tstripme="$stripme" + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | *msys* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" +@@ -3098,7 +3098,7 @@ + + # Do a test to see if this is really a libtool program. + case $host in +- *cygwin* | *mingw*) ++ *cygwin* | *msys* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result +@@ -3173,7 +3173,7 @@ + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in +- */usr/bin/install*,*cygwin*) ++ */usr/bin/install*,*cygwin*|*/usr/bin/install*,*msys*) + case $file:$destfile in + *.exe:*.exe) + # this is ok +@@ -3323,7 +3323,7 @@ + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; +@@ -3335,7 +3335,7 @@ + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; +@@ -3349,7 +3349,7 @@ + func_basename "$dlprefile" + name="$func_basename_result" + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" +@@ -3502,7 +3502,7 @@ + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` +@@ -4375,7 +4375,7 @@ + { + EOF + case "$host" in +- *mingw* | *cygwin* ) ++ *mingw* | *cygwin* | *msys* ) + # make stdout use "unix" line endings + echo " setmode(1,_O_BINARY);" + ;; +@@ -5094,7 +5094,7 @@ + { + $opt_debug + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra +@@ -5581,7 +5581,7 @@ + ;; + esac + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; +@@ -5601,7 +5601,7 @@ + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; +@@ -5679,7 +5679,7 @@ + + -no-install) + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" +@@ -6545,7 +6545,7 @@ + fi + case "$host" in + # special handling for platforms with PE-DLLs. +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present +@@ -6689,7 +6689,7 @@ + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in +- *cygwin* | *mingw* | *cegcc*) ++ *cygwin* | *msys* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no +@@ -6759,7 +6759,7 @@ + elif test -n "$soname_spec"; then + # bleh windows + case $host in +- *cygwin* | mingw* | *cegcc*) ++ *cygwin* | *msys* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" +@@ -7620,7 +7620,7 @@ + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) +@@ -8134,7 +8134,7 @@ + + orig_export_symbols= + case $host_os in +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then +@@ -8690,7 +8690,7 @@ + + prog) + case $host in +- *cygwin*) func_stripname '' '.exe' "$output" ++ *cygwin* | *msys*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ +@@ -8803,7 +8803,7 @@ + esac + fi + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; +@@ -8881,7 +8881,7 @@ + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; +- *cygwin* | *mingw* ) ++ *cygwin* | *msys* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi +@@ -9028,14 +9028,14 @@ + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in +- *cygwin*) ++ *cygwin* | *msys*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in +- *cygwin* | *mingw* ) ++ *cygwin* | *msys* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result +@@ -9365,7 +9365,7 @@ + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in +- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) ++ *cygwin*,*lai,yes,no,*.dll | *msys*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then +diff -Naur libxml2-2.9.1-orig/m4/libtool.m4 libxml2-2.9.1/m4/libtool.m4 +--- libxml2-2.9.1-orig/m4/libtool.m4 2013-04-19 07:36:08.000000000 +0000 ++++ libxml2-2.9.1/m4/libtool.m4 2013-04-29 06:19:38.868796900 +0000 +@@ -1616,7 +1616,7 @@ + lt_cv_sys_max_cmd_len=-1; + ;; + +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, +@@ -1863,7 +1863,7 @@ + lt_cv_dlopen_libs= + ;; + +- cygwin*) ++ cygwin* | msys*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; +@@ -2334,7 +2334,7 @@ + # libtool to hard-code these into programs + ;; + +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no +@@ -2366,6 +2366,12 @@ + m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; ++ msys*) ++ # MSYS DLLs use 'msys-' prefix rather than 'lib' ++ soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++m4_if([$1], [],[ ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ++ ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +@@ -2400,7 +2406,7 @@ + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; +- cygwin*) ++ cygwin* | msys*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... +@@ -3144,7 +3150,7 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi +@@ -3200,7 +3206,7 @@ + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +-cygwin*) ++cygwin* | msys*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' +@@ -3510,7 +3516,7 @@ + [lt_cv_sharedlib_from_linklib_cmd='unknown' + + case $host_os in +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in +@@ -3565,7 +3571,7 @@ + [AC_REQUIRE([AC_CANONICAL_HOST])dnl + LIBM= + case $host in +-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) ++*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; + *-ncr-sysv4.3*) +@@ -3640,7 +3646,7 @@ + aix*) + symcode='[[BCDT]]' + ;; +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; + hpux*) +@@ -3908,7 +3914,7 @@ + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; +- mingw* | cygwin* | os2* | pw32* | cegcc*) ++ mingw* | cygwin* | msys* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -3979,7 +3985,7 @@ + ;; + esac + ;; +- mingw* | cygwin* | os2* | pw32* | cegcc*) ++ mingw* | cygwin* | msys* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], +@@ -4226,7 +4232,7 @@ + # PIC is the default for these OSes. + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -4311,7 +4317,7 @@ + fi + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], +@@ -4571,7 +4577,7 @@ + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' +@@ -4629,7 +4635,7 @@ + extract_expsyms_cmds= + + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +@@ -4744,7 +4750,7 @@ + fi + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +@@ -5117,7 +5123,7 @@ + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is +@@ -6118,7 +6124,7 @@ + esac + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC +@@ -7934,7 +7940,7 @@ + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix +@@ -7942,12 +7948,12 @@ + ;; + esac + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix +diff -Naur libxml2-2.9.1-orig/m4/ltoptions.m4 libxml2-2.9.1/m4/ltoptions.m4 +--- libxml2-2.9.1-orig/m4/ltoptions.m4 2013-04-19 07:36:08.000000000 +0000 ++++ libxml2-2.9.1/m4/ltoptions.m4 2013-04-29 06:20:04.493796900 +0000 +@@ -126,7 +126,7 @@ + [enable_win32_dll=yes + + case $host in +-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) ++*-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) diff --git a/libxml2/libxml2-2.9.1-non-ascii-cr-lf.patch b/libxml2/libxml2-2.9.1-non-ascii-cr-lf.patch new file mode 100644 index 00000000..51a92ada --- /dev/null +++ b/libxml2/libxml2-2.9.1-non-ascii-cr-lf.patch @@ -0,0 +1,168 @@ +From dcc19503193c71596278a252064a8ce66331b3cd Mon Sep 17 00:00:00 2001 +From: Daniel Veillard +Date: Wed, 22 May 2013 22:56:45 +0200 +Subject: [PATCH] Fix a parsing bug on non-ascii element and CR/LF usage + +https://bugzilla.gnome.org/show_bug.cgi?id=698550 + +Somehow the behaviour of the internal parser routine changed +slightly when encountering CR/LF, which led to a bug when +parsing document with non-ascii Names +--- + parser.c | 6 +++++- + result/japancrlf.xml | 4 ++++ + result/japancrlf.xml.rde | 7 +++++++ + result/japancrlf.xml.rdr | 7 +++++++ + result/japancrlf.xml.sax | 11 +++++++++++ + result/japancrlf.xml.sax2 | 11 +++++++++++ + result/noent/japancrlf.xml | 4 ++++ + test/japancrlf.xml | 6 ++++++ + 8 files changed, 55 insertions(+), 1 deletion(-) + create mode 100644 result/japancrlf.xml + create mode 100644 result/japancrlf.xml.rde + create mode 100644 result/japancrlf.xml.rdr + create mode 100644 result/japancrlf.xml.sax + create mode 100644 result/japancrlf.xml.sax2 + create mode 100644 result/noent/japancrlf.xml + create mode 100644 test/japancrlf.xml + +diff --git a/parser.c b/parser.c +index 4a442bb..4739add 100644 +--- a/parser.c ++++ b/parser.c +@@ -3404,6 +3404,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + int len = 0, l; + int c; + int count = 0; ++ const xmlChar *end; /* needed because CUR_CHAR() can move cur on \r\n */ + + #ifdef DEBUG + nbParseNCNameComplex++; +@@ -3413,6 +3414,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + * Handler for more complex cases + */ + GROW; ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */ + (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) { +@@ -3434,12 +3436,14 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + } + len += l; + NEXTL(l); ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + if (c == 0) { + count = 0; + GROW; + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); ++ end = ctxt->input->cur; + c = CUR_CHAR(l); + } + } +@@ -3448,7 +3452,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + return(NULL); + } +- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); ++ return(xmlDictLookup(ctxt->dict, end - len, len)); + } + + /** +diff --git a/result/japancrlf.xml b/result/japancrlf.xml +new file mode 100644 +index 0000000..60b307c +--- /dev/null ++++ b/result/japancrlf.xml +@@ -0,0 +1,4 @@ ++ ++<入力メッセージ xmlns="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826"> ++ ++ +diff --git a/result/japancrlf.xml.rde b/result/japancrlf.xml.rde +new file mode 100644 +index 0000000..0bc5af7 +--- /dev/null ++++ b/result/japancrlf.xml.rde +@@ -0,0 +1,7 @@ ++0 1 入力メッセージ 0 0 ++1 14 #text 0 1 ++ ++1 1 c8c:Ele 1 0 ++1 14 #text 0 1 ++ ++0 15 入力メッセージ 0 0 +diff --git a/result/japancrlf.xml.rdr b/result/japancrlf.xml.rdr +new file mode 100644 +index 0000000..0bc5af7 +--- /dev/null ++++ b/result/japancrlf.xml.rdr +@@ -0,0 +1,7 @@ ++0 1 入力メッセージ 0 0 ++1 14 #text 0 1 ++ ++1 1 c8c:Ele 1 0 ++1 14 #text 0 1 ++ ++0 15 入力メッセージ 0 0 +diff --git a/result/japancrlf.xml.sax b/result/japancrlf.xml.sax +new file mode 100644 +index 0000000..c3bbdc6 +--- /dev/null ++++ b/result/japancrlf.xml.sax +@@ -0,0 +1,11 @@ ++SAX.setDocumentLocator() ++SAX.startDocument() ++SAX.startElement(入力メッセージ, xmlns='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826') ++SAX.characters( ++ , 2) ++SAX.startElement(c8c:Ele, xmlns:c8c='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826') ++SAX.endElement(c8c:Ele) ++SAX.characters( ++, 1) ++SAX.endElement(入力メッセージ) ++SAX.endDocument() +diff --git a/result/japancrlf.xml.sax2 b/result/japancrlf.xml.sax2 +new file mode 100644 +index 0000000..878eae4 +--- /dev/null ++++ b/result/japancrlf.xml.sax2 +@@ -0,0 +1,11 @@ ++SAX.setDocumentLocator() ++SAX.startDocument() ++SAX.startElementNs(入力メッセージ, NULL, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 1, xmlns='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 0, 0) ++SAX.characters( ++ , 2) ++SAX.startElementNs(Ele, c8c, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 1, xmlns:c8c='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 0, 0) ++SAX.endElementNs(Ele, c8c, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826') ++SAX.characters( ++, 1) ++SAX.endElementNs(入力メッセージ, NULL, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826') ++SAX.endDocument() +diff --git a/result/noent/japancrlf.xml b/result/noent/japancrlf.xml +new file mode 100644 +index 0000000..60b307c +--- /dev/null ++++ b/result/noent/japancrlf.xml +@@ -0,0 +1,4 @@ ++ ++<入力メッセージ xmlns="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826"> ++ ++ +diff --git a/test/japancrlf.xml b/test/japancrlf.xml +new file mode 100644 +index 0000000..480cb2d +--- /dev/null ++++ b/test/japancrlf.xml +@@ -0,0 +1,6 @@ ++<入力メッセージ ++ xmlns="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826"> ++ ++ +\ No newline at end of file +-- +1.8.3.2 + diff --git a/libxml2/libxml2-2.9.1-python-2.6.patch b/libxml2/libxml2-2.9.1-python-2.6.patch new file mode 100644 index 00000000..c79709db --- /dev/null +++ b/libxml2/libxml2-2.9.1-python-2.6.patch @@ -0,0 +1,32 @@ +From 722923bc9b788f028e4221c77138fc66735a3113 Mon Sep 17 00:00:00 2001 +From: Petr Sumbera +Date: Fri, 3 May 2013 22:25:38 +0800 +Subject: [PATCH] Fix for compilation with python 2.6.8 + +Remap PyCapsule to PyCObject based on the macro being available +instead of using the python version +--- + python/libxml_wrap.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/python/libxml_wrap.h b/python/libxml_wrap.h +index a9b9739..53a0618 100644 +--- a/python/libxml_wrap.h ++++ b/python/libxml_wrap.h +@@ -34,11 +34,11 @@ + #define PyBytes_AsString PyString_AsString + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE +- ++#endif ++#ifndef PyCapsule_New + #define PyCapsule_New PyCObject_FromVoidPtrAndDesc + #define PyCapsule_CheckExact PyCObject_Check + #define PyCapsule_GetPointer(o, n) PyCObject_GetDesc((o)) +- + #endif + #endif + +-- +1.8.3.2 + diff --git a/libxml2/libxml2-2.9.1-python3.patch b/libxml2/libxml2-2.9.1-python3.patch new file mode 100644 index 00000000..5c4e83da --- /dev/null +++ b/libxml2/libxml2-2.9.1-python3.patch @@ -0,0 +1,50 @@ +From 927faac6113b625a9a3423eef8f144fc7d9a8547 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev +Date: Wed, 10 Jul 2013 23:00:54 -0400 +Subject: [PATCH] python: fix drv_libxml2.py for python3 compatibility + +https://bugzilla.gnome.org/show_bug.cgi?id=703979 +--- + python/drv_libxml2.py | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/python/drv_libxml2.py b/python/drv_libxml2.py +index e43fb1d..c9075e6 100644 +--- a/python/drv_libxml2.py ++++ b/python/drv_libxml2.py +@@ -34,12 +34,20 @@ TODO + + """ + +-__author__ = u"Stéphane Bidoul " ++__author__ = "Stéphane Bidoul " + __version__ = "0.3" + ++import sys + import codecs +-from types import StringType, UnicodeType +-StringTypes = (StringType,UnicodeType) ++ ++if sys.version < "3": ++ __author__ = codecs.unicode_escape_decode(__author__)[0] ++ ++ from types import StringType, UnicodeType ++ StringTypes = (StringType,UnicodeType) ++ ++else: ++ StringTypes = (str) + + from xml.sax._exceptions import * + from xml.sax import xmlreader, saxutils +@@ -65,7 +73,7 @@ def _d(s): + + try: + import libxml2 +-except ImportError, e: ++except ImportError as e: + raise SAXReaderNotAvailable("libxml2 not available: " \ + "import error was: %s" % e) + +-- +1.8.3.2 + diff --git a/libxml2/libxml2-2.9.1-python3a.patch b/libxml2/libxml2-2.9.1-python3a.patch new file mode 100644 index 00000000..d07a1e28 --- /dev/null +++ b/libxml2/libxml2-2.9.1-python3a.patch @@ -0,0 +1,55 @@ +From 6dd7775f3506741093890d99f09c242e0b34b55f Mon Sep 17 00:00:00 2001 +From: Arfrever Frehtes Taifersar Arahesis +Date: Fri, 12 Jul 2013 11:18:11 +0800 +Subject: [PATCH] Another round of fixes for older versions of Python + +--- + python/drv_libxml2.py | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/python/drv_libxml2.py b/python/drv_libxml2.py +index c9075e6..c2ec3e2 100644 +--- a/python/drv_libxml2.py ++++ b/python/drv_libxml2.py +@@ -40,14 +40,12 @@ __version__ = "0.3" + import sys + import codecs + +-if sys.version < "3": ++if sys.version_info[0] < 3: + __author__ = codecs.unicode_escape_decode(__author__)[0] + +- from types import StringType, UnicodeType +- StringTypes = (StringType,UnicodeType) +- ++ StringTypes = (str, unicode) + else: +- StringTypes = (str) ++ StringTypes = str + + from xml.sax._exceptions import * + from xml.sax import xmlreader, saxutils +@@ -73,9 +71,9 @@ def _d(s): + + try: + import libxml2 +-except ImportError as e: ++except ImportError: + raise SAXReaderNotAvailable("libxml2 not available: " \ +- "import error was: %s" % e) ++ "import error was: %s" % sys.exc_info()[1]) + + class Locator(xmlreader.Locator): + """SAX Locator adapter for libxml2.xmlTextReaderLocator""" +@@ -142,7 +140,7 @@ class LibXml2Reader(xmlreader.XMLReader): + self.__parsing = 1 + try: + # prepare source and create reader +- if type(source) in StringTypes: ++ if isinstance(source, StringTypes): + reader = libxml2.newTextReaderFilename(source) + else: + source = saxutils.prepare_input_source(source) +-- +1.8.3.2 + diff --git a/libxml2/libxml2.install b/libxml2/libxml2.install new file mode 100644 index 00000000..4a13c66a --- /dev/null +++ b/libxml2/libxml2.install @@ -0,0 +1,6 @@ +post_install() { + if test ! -f etc/xml/catalog; then + bin/mkdir -p etc/xml + usr/bin/xmlcatalog --noout --create etc/xml/catalog + fi +}