[vlmc-devel] contribs: Add libxml2

Hugo Beauzée-Luyssen git at videolan.org
Tue Aug 2 01:00:43 CEST 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Aug  2 00:56:39 2016 +0200| [429e8c2a4e42cc66117343ecb877f7bff8d39963] | committer: Hugo Beauzée-Luyssen

contribs: Add libxml2

> https://code.videolan.org/videolan/vlmc/commit/429e8c2a4e42cc66117343ecb877f7bff8d39963
---

 contribs/src/libxml2/SHA512SUMS     |  1 +
 contribs/src/libxml2/bins.patch     | 20 +++++++++++++++
 contribs/src/libxml2/no-tests.patch | 17 +++++++++++++
 contribs/src/libxml2/nogetcwd.patch | 47 ++++++++++++++++++++++++++++++++++
 contribs/src/libxml2/pthread.patch  | 22 ++++++++++++++++
 contribs/src/libxml2/rules.mak      | 50 +++++++++++++++++++++++++++++++++++++
 contribs/src/libxml2/win32.patch    | 31 +++++++++++++++++++++++
 7 files changed, 188 insertions(+)

diff --git a/contribs/src/libxml2/SHA512SUMS b/contribs/src/libxml2/SHA512SUMS
new file mode 100644
index 0000000..453e3aa
--- /dev/null
+++ b/contribs/src/libxml2/SHA512SUMS
@@ -0,0 +1 @@
+078afa65229de4f23e6538767253fb4f9f61d96cb72e445179c71d536b224d54922f22972a2b71434796f83f8c99f6a46c3b8813cb4582ad9fca696d141e0abb  libxml2-2.9.3.tar.gz
diff --git a/contribs/src/libxml2/bins.patch b/contribs/src/libxml2/bins.patch
new file mode 100644
index 0000000..3fef23a
--- /dev/null
+++ b/contribs/src/libxml2/bins.patch
@@ -0,0 +1,20 @@
+--- libxml2/Makefile.am.orig	2013-08-20 13:57:37.911178174 +0200
++++ libxml2/Makefile.am	2013-08-20 13:57:44.543177895 +0200
+@@ -2,7 +2,7 @@
+ 
+ ACLOCAL_AMFLAGS = -I m4
+ 
+-SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
++SUBDIRS = include . xstc $(PYTHON_SUBDIR)
+ 
+ DIST_SUBDIRS = include . doc example python xstc
+ 
+@@ -15,7 +15,7 @@
+ #                 testReader testapi testModule runtest runsuite testchar \
+ # 		testdict runxmlconf testrecurse testlimits
+ 
+-bin_PROGRAMS = xmllint xmlcatalog
++bin_PROGRAMS =
+ 
+ bin_SCRIPTS=xml2-config
+ 
diff --git a/contribs/src/libxml2/no-tests.patch b/contribs/src/libxml2/no-tests.patch
new file mode 100644
index 0000000..9e2fd15
--- /dev/null
+++ b/contribs/src/libxml2/no-tests.patch
@@ -0,0 +1,17 @@
+--- libxml2-2.9.0/Makefile.am.orig	2012-11-01 18:55:04.214524833 +0100
++++ libxml2-2.9.0/Makefile.am	2012-11-01 18:55:56.838557494 +0100
+@@ -10,10 +10,10 @@
+ 
+ AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
+ 
+-noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
+-                testThreads testC14N testAutomata testRegexp \
+-                testReader testapi testModule runtest runsuite testchar \
+-		testdict runxmlconf testrecurse testlimits
++# noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
++#                 testThreads testC14N testAutomata testRegexp \
++#                 testReader testapi testModule runtest runsuite testchar \
++# 		testdict runxmlconf testrecurse testlimits
+ 
+ bin_PROGRAMS = xmllint xmlcatalog
+ 
diff --git a/contribs/src/libxml2/nogetcwd.patch b/contribs/src/libxml2/nogetcwd.patch
new file mode 100644
index 0000000..cef4efe
--- /dev/null
+++ b/contribs/src/libxml2/nogetcwd.patch
@@ -0,0 +1,47 @@
+--- libxml2/xmlIO.c.orig	2016-05-03 11:27:32.110248362 +0200
++++ libxml2/xmlIO.c	2016-05-03 11:27:55.310675774 +0200
+@@ -3810,44 +3810,7 @@
+  */
+ char *
+ xmlParserGetDirectory(const char *filename) {
+-    char *ret = NULL;
+-    char dir[1024];
+-    char *cur;
+-
+-#ifdef _WIN32_WCE  /* easy way by now ... wince does not have dirs! */
+     return NULL;
+-#endif
+-
+-    if (xmlInputCallbackInitialized == 0)
+-	xmlRegisterDefaultInputCallbacks();
+-
+-    if (filename == NULL) return(NULL);
+-
+-#if defined(WIN32) && !defined(__CYGWIN__)
+-#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
+-#else
+-#   define IS_XMLPGD_SEP(ch) (ch=='/')
+-#endif
+-
+-    strncpy(dir, filename, 1023);
+-    dir[1023] = 0;
+-    cur = &dir[strlen(dir)];
+-    while (cur > dir) {
+-         if (IS_XMLPGD_SEP(*cur)) break;
+-	 cur --;
+-    }
+-    if (IS_XMLPGD_SEP(*cur)) {
+-        if (cur == dir) dir[1] = 0;
+-	else *cur = 0;
+-	ret = xmlMemStrdup(dir);
+-    } else {
+-        if (getcwd(dir, 1024) != NULL) {
+-	    dir[1023] = 0;
+-	    ret = xmlMemStrdup(dir);
+-	}
+-    }
+-    return(ret);
+-#undef IS_XMLPGD_SEP
+ }
+ 
+ /****************************************************************
diff --git a/contribs/src/libxml2/pthread.patch b/contribs/src/libxml2/pthread.patch
new file mode 100644
index 0000000..777b7bb
--- /dev/null
+++ b/contribs/src/libxml2/pthread.patch
@@ -0,0 +1,22 @@
+--- libxml2-2.9.2/configure.ac	2015-01-21 10:40:13.706152933 +0100
++++ libxml2-2.9.2/configure.ac.new	2015-01-21 10:39:36.014876563 +0100
+@@ -1049,12 +1049,17 @@
+     dnl Use pthread by default in other cases
+     if test -z "$THREADS_W32"; then
+         if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
++            LIBS_saved="$LIBS"
+             AC_CHECK_HEADER(pthread.h,
+-                AC_CHECK_LIB(pthread, pthread_join,[
+-                THREAD_LIBS="-lpthread"
++                AC_SEARCH_LIBS(pthread_join, pthread,[
++                THREAD_LIBS="$ac_cv_search_pthread_join"
++                if test "$THREAD_LIBS" = "none required"; then
++                  THREAD_LIBS=""
++                fi
+                 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
+                 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
+                 WITH_THREADS="1"]))
++            LIBS="$LIBS_saved"
+         fi
+     fi
+ 
diff --git a/contribs/src/libxml2/rules.mak b/contribs/src/libxml2/rules.mak
new file mode 100644
index 0000000..5ace4cf
--- /dev/null
+++ b/contribs/src/libxml2/rules.mak
@@ -0,0 +1,50 @@
+# libxml2
+
+LIBXML2_VERSION := 2.9.3
+LIBXML2_URL := http://xmlsoft.org/sources/libxml2-$(LIBXML2_VERSION).tar.gz
+
+PKGS += libxml2
+ifeq ($(call need_pkg,"libxml-2.0"),)
+PKGS_FOUND += libxml2
+endif
+
+$(TARBALLS)/libxml2-$(LIBXML2_VERSION).tar.gz:
+	$(call download_pkg,$(LIBXML2_URL),libxml2)
+
+.sum-libxml2: libxml2-$(LIBXML2_VERSION).tar.gz
+
+XMLCONF = --with-minimal     \
+          --with-catalog     \
+          --with-reader      \
+          --with-tree        \
+          --with-push        \
+          --with-xptr        \
+          --with-valid       \
+          --with-xpath       \
+          --with-xinclude    \
+          --with-sax1        \
+          --without-zlib     \
+          --without-iconv    \
+          --without-http     \
+          --without-ftp      \
+          --without-debug    \
+          --without-docbook  \
+          --without-regexps  \
+          --without-python
+
+libxml2: libxml2-$(LIBXML2_VERSION).tar.gz .sum-libxml2
+	$(UNPACK)
+	$(APPLY) $(SRC)/libxml2/no-tests.patch
+	$(APPLY) $(SRC)/libxml2/win32.patch
+	$(APPLY) $(SRC)/libxml2/bins.patch
+	$(APPLY) $(SRC)/libxml2/pthread.patch
+ifdef HAVE_WINSTORE
+	$(APPLY) $(SRC)/libxml2/nogetcwd.patch
+endif
+	$(MOVE)
+
+.libxml2: libxml2
+	$(RECONF)
+	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) CFLAGS="-DLIBXML_STATIC" $(XMLCONF)
+	cd $< && $(MAKE) install
+	touch $@
diff --git a/contribs/src/libxml2/win32.patch b/contribs/src/libxml2/win32.patch
new file mode 100644
index 0000000..b496529
--- /dev/null
+++ b/contribs/src/libxml2/win32.patch
@@ -0,0 +1,31 @@
+--- libxml2/xmlIO.c.orig	2013-04-22 19:24:23.613036400 +0200
++++ libxml2/xmlIO.c	2013-04-22 19:24:56.249035859 +0200
+@@ -726,14 +726,14 @@
+ xmlInitPlatformSpecificIo(void)
+ {
+     static int xmlPlatformIoInitialized = 0;
+-    OSVERSIONINFO osvi;
++    /*OSVERSIONINFO osvi;*/
+ 
+     if(xmlPlatformIoInitialized)
+       return;
+ 
+-    osvi.dwOSVersionInfoSize = sizeof(osvi);
++    /*osvi.dwOSVersionInfoSize = sizeof(osvi);*/
+ 
+-    if(GetVersionEx(&osvi) && (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)) {
++    if(1 /*GetVersionEx(&osvi) && (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)*/) {
+       xmlWrapStat = xmlWrapStatUtf8;
+       xmlWrapOpen = xmlWrapOpenUtf8;
+ #ifdef HAVE_ZLIB_H
+--- libxml2-2.9.2/configure.ac	2014-10-16 06:06:15.000000000 +0200
++++ libxml2-2.9.2/configure.ac.new	2015-01-21 10:07:09.001484882 +0100
+@@ -1041,7 +1041,7 @@
+        *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then
+                WITH_THREADS="1"
+                THREADS_W32="1"
+-               THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
++               THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS -DHAVE_COMPILER_TLS"
+            fi
+        ;;
+     esac



More information about the Vlmc-devel mailing list