From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- external/libxml2/ExternalPackage_libxml2.mk | 28 +++++++++++++ external/libxml2/ExternalProject_libxml2.mk | 47 +++++++++++++++++++++ external/libxml2/Makefile | 7 ++++ external/libxml2/Module_libxml2.mk | 18 ++++++++ external/libxml2/README | 1 + external/libxml2/UnpackedTarball_libxml2.mk | 27 ++++++++++++ external/libxml2/libxml2-android.patch | 11 +++++ external/libxml2/libxml2-config.patch.1 | 43 +++++++++++++++++++ external/libxml2/libxml2-global-symbols.patch | 59 +++++++++++++++++++++++++++ external/libxml2/libxml2-icu-sym.patch.0 | 37 +++++++++++++++++ external/libxml2/libxml2-icu.patch.0 | 33 +++++++++++++++ external/libxml2/libxml2-vc10.patch | 12 ++++++ external/libxml2/ubsan.patch.0 | 11 +++++ 13 files changed, 334 insertions(+) create mode 100644 external/libxml2/ExternalPackage_libxml2.mk create mode 100644 external/libxml2/ExternalProject_libxml2.mk create mode 100644 external/libxml2/Makefile create mode 100644 external/libxml2/Module_libxml2.mk create mode 100644 external/libxml2/README create mode 100644 external/libxml2/UnpackedTarball_libxml2.mk create mode 100644 external/libxml2/libxml2-android.patch create mode 100644 external/libxml2/libxml2-config.patch.1 create mode 100644 external/libxml2/libxml2-global-symbols.patch create mode 100644 external/libxml2/libxml2-icu-sym.patch.0 create mode 100644 external/libxml2/libxml2-icu.patch.0 create mode 100644 external/libxml2/libxml2-vc10.patch create mode 100644 external/libxml2/ubsan.patch.0 (limited to 'external/libxml2') diff --git a/external/libxml2/ExternalPackage_libxml2.mk b/external/libxml2/ExternalPackage_libxml2.mk new file mode 100644 index 000000000..d38eb68df --- /dev/null +++ b/external/libxml2/ExternalPackage_libxml2.mk @@ -0,0 +1,28 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,libxml2,libxml2)) + +$(eval $(call gb_ExternalPackage_use_external_project,libxml2,libxml2)) + +ifneq ($(DISABLE_DYNLOADING),TRUE) +ifeq ($(OS),MACOSX) +$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.2.dylib,.libs/libxml2.2.dylib)) +else ifeq ($(OS),WNT) +ifeq ($(COM),GCC) +$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,.libs/libxml2.dll)) +else # COM=MSC +$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,win32/bin.msvc/libxml2.dll)) +endif +else # OS!=WNT +$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.9.$(LIBXML_VERSION_MICRO))) +endif +endif # DISABLE_DYNLOADING + +# vim: set noet sw=4 ts=4: diff --git a/external/libxml2/ExternalProject_libxml2.mk b/external/libxml2/ExternalProject_libxml2.mk new file mode 100644 index 000000000..778befade --- /dev/null +++ b/external/libxml2/ExternalProject_libxml2.mk @@ -0,0 +1,47 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalProject_ExternalProject,libxml2)) + +$(eval $(call gb_ExternalProject_register_targets,libxml2,\ + build \ +)) + +ifeq ($(OS),WNT) +$(call gb_ExternalProject_use_external_project,libxml2,icu) + +$(eval $(call gb_ExternalProject_use_nmake,libxml2,build)) + +$(call gb_ExternalProject_get_state_target,libxml2,build): + $(call gb_Trace_StartRange,libxml2,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + cscript /e:javascript configure.js \ + iconv=no icu=yes sax1=yes $(if $(MSVC_USE_DEBUG_RUNTIME),run_debug=yes cruntime=/MDd) \ + $(if $(filter TRUE,$(ENABLE_DBGUTIL)),debug=yes) \ + && nmake \ + ,win32) + $(call gb_Trace_EndRange,libxml2,EXTERNAL) +else # OS!=WNT +$(call gb_ExternalProject_get_state_target,libxml2,build): + $(call gb_Trace_StartRange,libxml2,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + ./configure --disable-ipv6 --without-python --without-zlib --with-sax1 \ + --without-lzma \ + $(if $(debug),--with-run-debug) \ + $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ + $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________URELIB) \ + LDFLAGS="$(if $(SYSBASE),-L$(SYSBASE)/usr/lib)" \ + CFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(if $(debug),-g)" \ + $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \ + && $(MAKE) \ + ) + $(call gb_Trace_EndRange,libxml2,EXTERNAL) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/libxml2/Makefile b/external/libxml2/Makefile new file mode 100644 index 000000000..e4968cf85 --- /dev/null +++ b/external/libxml2/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/libxml2/Module_libxml2.mk b/external/libxml2/Module_libxml2.mk new file mode 100644 index 000000000..31a90fadd --- /dev/null +++ b/external/libxml2/Module_libxml2.mk @@ -0,0 +1,18 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,libxml2)) + +$(eval $(call gb_Module_add_targets,libxml2,\ + ExternalPackage_libxml2 \ + ExternalProject_libxml2 \ + UnpackedTarball_libxml2 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libxml2/README b/external/libxml2/README new file mode 100644 index 000000000..12d96977c --- /dev/null +++ b/external/libxml2/README @@ -0,0 +1 @@ +Gnome xml parser library written in C, from [http://xmlsoft.org/] diff --git a/external/libxml2/UnpackedTarball_libxml2.mk b/external/libxml2/UnpackedTarball_libxml2.mk new file mode 100644 index 000000000..37b5bad97 --- /dev/null +++ b/external/libxml2/UnpackedTarball_libxml2.mk @@ -0,0 +1,27 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,libxml2)) + +$(eval $(call gb_UnpackedTarball_set_tarball,libxml2,$(LIBXML_TARBALL),,libxml2)) + +$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libxml2)) + +$(eval $(call gb_UnpackedTarball_add_patches,libxml2,\ + external/libxml2/libxml2-config.patch.1 \ + external/libxml2/libxml2-global-symbols.patch \ + external/libxml2/libxml2-vc10.patch \ + $(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \ + $(if $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED), \ + external/libxml2/libxml2-icu-sym.patch.0, \ + external/libxml2/libxml2-icu.patch.0) \ + external/libxml2/ubsan.patch.0 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libxml2/libxml2-android.patch b/external/libxml2/libxml2-android.patch new file mode 100644 index 000000000..42af83274 --- /dev/null +++ b/external/libxml2/libxml2-android.patch @@ -0,0 +1,11 @@ +--- misc/libxml2-2.7.6/Makefile.in ++++ misc/build/libxml2-2.7.6/Makefile.in +@@ -1635,7 +1635,7 @@ + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +-all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \ ++all-am: Makefile $(LTLIBRARIES) \ + config.h + install-binPROGRAMS: install-libLTLIBRARIES + diff --git a/external/libxml2/libxml2-config.patch.1 b/external/libxml2/libxml2-config.patch.1 new file mode 100644 index 000000000..8c28fb6a7 --- /dev/null +++ b/external/libxml2/libxml2-config.patch.1 @@ -0,0 +1,43 @@ +Hack the xml2-config to return paths into WORKDIR. + +--- a/xml2-config.in 2009-12-17 11:45:20.000000000 +0000 ++++ b/xml2-config.in 2009-12-17 11:45:36.000000000 +0000 +@@ -1,9 +1,14 @@ + #! /bin/sh + +-prefix=@prefix@ +-exec_prefix=@exec_prefix@ +-includedir=@includedir@ +-libdir=@libdir@ ++#prefix=@prefix@ ++#exec_prefix=@exec_prefix@ ++#includedir=@includedir@ ++#libdir=@libdir@ ++ ++prefix=${WORKDIR}/UnpackedTarball/libxml2 ++exec_prefix=${WORKDIR}/UnpackedTarball/libxml2 ++includedir=${WORKDIR}/UnpackedTarball/libxml2/include ++libdir=${WORKDIR}/UnpackedTarball/libxml2/.libs + + usage() + { +@@ -67,7 +72,8 @@ + ;; + + --cflags) +- cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@" ++ #cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@" ++ cflags="-I${includedir}" + ;; + + --libtool-libs) +@@ -91,7 +96,8 @@ + libs="@XML_LIBDIR@ $libs" + fi + +- libs="$libs @WIN32_EXTRA_LIBADD@" ++ #libs="$libs @WIN32_EXTRA_LIBADD@" ++ libs="-L${libdir} -lxml2 -lm" + ;; + + *) diff --git a/external/libxml2/libxml2-global-symbols.patch b/external/libxml2/libxml2-global-symbols.patch new file mode 100644 index 000000000..49ee73731 --- /dev/null +++ b/external/libxml2/libxml2-global-symbols.patch @@ -0,0 +1,59 @@ +--- misc/libxml2-2.7.6/libxml2.syms Tue Oct 6 18:31:35 2009 ++++ misc/build/libxml2-2.7.6/libxml2.syms Wed Jul 7 15:43:17 2010 +@@ -2184,10 +2184,10 @@ + } LIBXML2_2.6.27; + + LIBXML2_2.6.29 { +- global: ++# global: + + # threads +- xmlDllMain; ++#WIN32 only! xmlDllMain; + } LIBXML2_2.6.28; + + LIBXML2_2.6.32 { +@@ -2231,3 +2231,43 @@ + xmlHashDefaultDeallocator; + } LIBXML2_2.9.1; + ++# HACK: export global variable accessor functions (globals.h) ++LIBXML2_GLOBAL_VARIABLES { ++ global: ++# __xmlMalloc; ++# __xmlMallocAtomic; ++# __xmlRealloc; ++# __xmlFree; ++# __xmlMemStrdup; ++ __docbDefaultSAXHandler; ++ __htmlDefaultSAXHandler; ++ __xmlLastError; ++ __oldXMLWDcompatibility; ++ __xmlBufferAllocScheme; ++ __xmlDefaultBufferSize; ++ __xmlDefaultSAXHandler; ++ __xmlDefaultSAXLocator; ++ __xmlDoValidityCheckingDefaultValue; ++ __xmlGenericError; ++ __xmlStructuredError; ++ __xmlGenericErrorContext; ++ __xmlStructuredErrorContext; ++ __xmlGetWarningsDefaultValue; ++ __xmlIndentTreeOutput; ++ __xmlTreeIndentString; ++ __xmlKeepBlanksDefaultValue; ++ __xmlLineNumbersDefaultValue; ++ __xmlLoadExtDtdDefaultValue; ++ __xmlParserDebugEntities; ++ __xmlParserVersion; ++ __xmlPedanticParserDefaultValue; ++ __xmlSaveNoEmptyTags; ++ __xmlSubstituteEntitiesDefaultValue; ++ __xmlRegisterNodeDefaultValue; ++ __xmlDeregisterNodeDefaultValue; ++ __xmlParserInputBufferCreateFilenameValue; ++ __xmlOutputBufferCreateFilenameValue; ++# Solaris ld needs explicit auto-reduction (or, alternatively, "-B local") ++ local: ++ *; ++} LIBXML2_2.7.4; diff --git a/external/libxml2/libxml2-icu-sym.patch.0 b/external/libxml2/libxml2-icu-sym.patch.0 new file mode 100644 index 000000000..aac9d09ef --- /dev/null +++ b/external/libxml2/libxml2-icu-sym.patch.0 @@ -0,0 +1,37 @@ +Find bundled ICU in workdir and use debug .libs when needed + +diff -up win32/Makefile.msvc.dt win32/Makefile.msvc +--- win32/Makefile.msvc.dt 2014-07-18 19:00:23.372103963 +0200 ++++ win32/Makefile.msvc 2014-07-18 19:01:39.347982929 +0200 +@@ -46,6 +46,7 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT" + CC = cl.exe + CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(CRUNTIME) + CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX) ++CFLAGS = $(CFLAGS) /I$(WORKDIR)/UnpackedTarball/icu/source/i18n /I$(WORKDIR)/UnpackedTarball/icu/source/common + !if "$(WITH_THREADS)" != "no" + CFLAGS = $(CFLAGS) /D "_REENTRANT" + !endif +@@ -62,7 +63,9 @@ + # The linker and its options. + LD = link.exe + LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION) ++LDFLAGS = $(LDFLAGS) /LIBPATH:$(WORKDIR)/UnpackedTarball/icu/source/lib + LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) ++LDFLAGS = $(LDFLAGS) /DEBUG /OPT:REF + LIBS = + !if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1" + LIBS = $(LIBS) wsock32.lib ws2_32.lib +@@ -74,9 +77,13 @@ + !if "$(STATIC)" == "1" + LIBS = $(LIBS) advapi32.lib sicuuc.lib sicuin.lib sicudt.lib + !else ++!if "$(WITH_RUN_DEBUG)" == "1" ++LIBS = $(LIBS) icuind.lib icuucd.lib icudtd.lib ++!else + LIBS = $(LIBS) icuuc.lib icuin.lib icudt.lib + !endif + !endif ++!endif + !if "$(WITH_ZLIB)" == "1" + # could be named differently zdll or zlib + # LIBS = $(LIBS) zdll.lib diff --git a/external/libxml2/libxml2-icu.patch.0 b/external/libxml2/libxml2-icu.patch.0 new file mode 100644 index 000000000..b390b03d8 --- /dev/null +++ b/external/libxml2/libxml2-icu.patch.0 @@ -0,0 +1,33 @@ +Find bundled ICU in workdir and use debug .libs when needed + +diff -up win32/Makefile.msvc.dt win32/Makefile.msvc +--- win32/Makefile.msvc.dt 2014-07-18 19:00:23.372103963 +0200 ++++ win32/Makefile.msvc 2014-07-18 19:01:39.347982929 +0200 +@@ -45,6 +45,7 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT" + CC = cl.exe + CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(CRUNTIME) + CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX) ++CFLAGS = $(CFLAGS) /I$(WORKDIR)/UnpackedTarball/icu/source/i18n /I$(WORKDIR)/UnpackedTarball/icu/source/common + !if "$(WITH_THREADS)" != "no" + CFLAGS = $(CFLAGS) /D "_REENTRANT" + !endif +@@ -67,6 +68,7 @@ CFLAGS = $(CFLAGS) $(SOLARINC) + # The linker and its options. + LD = link.exe + LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION) ++LDFLAGS = $(LDFLAGS) /LIBPATH:$(WORKDIR)/UnpackedTarball/icu/source/lib + LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) + LIBS = + !if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1" +@@ -78,7 +78,11 @@ LIBS = $(LIBS) wsock32.lib ws2_32.lib + !if "$(STATIC)" == "1" + LIBS = $(LIBS) advapi32.lib sicuuc.lib sicuin.lib sicudt.lib + !else ++!if "$(WITH_RUN_DEBUG)" == "1" ++LIBS = $(LIBS) icuind.lib icuucd.lib icudtd.lib ++!else + LIBS = $(LIBS) icuuc.lib icuin.lib icudt.lib ++!endif + !endif + !endif + !if "$(WITH_ZLIB)" == "1" diff --git a/external/libxml2/libxml2-vc10.patch b/external/libxml2/libxml2-vc10.patch new file mode 100644 index 000000000..15bc4d973 --- /dev/null +++ b/external/libxml2/libxml2-vc10.patch @@ -0,0 +1,12 @@ +Add SOLARINC, and disable SSE2 default for MSVC2012 + +--- build/libxml2-2.7.6/win32/Makefile.msvc.old 2010-09-20 20:22:41.500000000 +0200 ++++ build/libxml2-2.7.6/win32/Makefile.msvc 2010-09-20 20:23:00.250000000 +0200 +@@ -59,6 +59,7 @@ + CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H" + !endif + CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE ++CFLAGS = $(CFLAGS) $(SOLARINC) + + # The linker and its options. + LD = link.exe diff --git a/external/libxml2/ubsan.patch.0 b/external/libxml2/ubsan.patch.0 new file mode 100644 index 000000000..b52259719 --- /dev/null +++ b/external/libxml2/ubsan.patch.0 @@ -0,0 +1,11 @@ +--- xpath.c ++++ xpath.c +@@ -14529,7 +14529,7 @@ + } + + stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH, +- &namespaces[0]); ++ namespaces); // i.e., &namespaces[0] if namespaces != NULL + if (namespaces != NULL) { + xmlFree((xmlChar **)namespaces); + } -- cgit v1.2.3