From 747aebab93a20b5df9e281d00a5cd93e35db17ab Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Fri, 18 Jul 2025 09:16:39 +0200 Subject: [PATCH] libxml2, add 2.14.2 (#12548) SONAME changes, so need to keep the older one alive for now --- dev-libs/libxml2/libxml2_2.14-2.14.4.recipe | 193 ++++++++++++++++++ .../patches/libxml2_2.14-2.14.4.patchset | 136 ++++++++++++ 2 files changed, 329 insertions(+) create mode 100644 dev-libs/libxml2/libxml2_2.14-2.14.4.recipe create mode 100644 dev-libs/libxml2/patches/libxml2_2.14-2.14.4.patchset diff --git a/dev-libs/libxml2/libxml2_2.14-2.14.4.recipe b/dev-libs/libxml2/libxml2_2.14-2.14.4.recipe new file mode 100644 index 000000000..863126887 --- /dev/null +++ b/dev-libs/libxml2/libxml2_2.14-2.14.4.recipe @@ -0,0 +1,193 @@ +SUMMARY="The XML C parser and toolkit of Gnome" +DESCRIPTION="Libxml2 is the XML C parser and toolkit developed for the Gnome \ +project, but is usable outside of the Gnome platform as well. +XML itself is a metalanguage to design markup languages, i.e. text language \ +where semantic and structure are added to the content using extra \"markup\" \ +information enclosed between angle brackets. HTML is the most well-known \ +markup language. +Though the library is written in C a variety of language bindings make it \ +available in other environments." +HOMEPAGE="http://www.xmlsoft.org/" +COPYRIGHT="1998-2012 Daniel Veillard. All Rights Reserved." +LICENSE="MIT" +REVISION="1" +SOURCE_URI="https://download.gnome.org/sources/libxml2/${portVersion%.*}/libxml2-$portVersion.tar.xz" +CHECKSUM_SHA256="24175ec30a97cfa86bdf9befb7ccf4613f8f4b2713c5103e0dd0bc9c711a2773" +SOURCE_DIR="libxml2-$portVersion" +SOURCE_URI_2="https://www.w3.org/XML/Test/xmlts20130923.tar.gz" +CHECKSUM_SHA256_2="9b61db9f5dbffa545f4b8d78422167083a8568c59bd1129f94138f936cf6fc1f" +PATCHES="libxml2_2.14-$portVersion.patchset" + +ARCHITECTURES="all" +SECONDARY_ARCHITECTURES="x86" + +libVersion="16.0.4" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + +pythonModuleEnabled=false +if [ "$targetArchitecture" = x86_gcc2 ]; then + if [ -n "$secondaryArchSuffix" ]; then + pythonModuleEnabled=true + fi +else + if [ -z "$secondaryArchSuffix" ]; then + pythonModuleEnabled=true + fi +fi + +PROVIDES=" + libxml2_2.14$secondaryArchSuffix = $portVersion compat >= 2 + lib:libxml2$secondaryArchSuffix = $libVersionCompat + " +if [ -z "$secondaryArchSuffix" ]; then + PROVIDES="$PROVIDES + cmd:xmlcatalog = $portVersion compat >= 2 + cmd:xmllint = $portVersion compat >= 2 + " +fi +REQUIRES=" + haiku$secondaryArchSuffix + lib:libz$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + " + +PROVIDES_devel=" + libxml2_2.14${secondaryArchSuffix}_devel = $portVersion + cmd:xml2_config$secondaryArchSuffix = $portVersion compat >= 2 + devel:libxml2$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + libxml2_2.14$secondaryArchSuffix == $portVersion base + devel:libiconv$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +CONFLICTS_devel=" + libxml2${secondaryArchSuffix}_devel + " + +if $pythonModuleEnabled; then + SUMMARY_python="The python module for libxml2" + PROVIDES_python=" + libxml2_2.14${secondaryArchSuffix}_python = $portVersion + " + if [ -n "$secondaryArchSuffix" ]; then + PROVIDES_python+=" + libxml2_2.14_python = $portVersion + " + fi + REQUIRES_python=" + libxml2_2.14$secondaryArchSuffix == $portVersion base + haiku$secondaryArchSuffix + lib:libz$secondaryArchSuffix + cmd:python3 + " +fi + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libiconv$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +if $pythonModuleEnabled; then + BUILD_REQUIRES="$BUILD_REQUIRES + cmd:python3 + " +fi +BUILD_PREREQUIRES=" + lib:libicudata$secondaryArchSuffix + cmd:aclocal + cmd:autoconf + cmd:automake + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + cmd:make + cmd:sed + cmd:pkg_config$secondaryArchSuffix + " + +PATCH() +{ + # replace hard-coded references to the development documentation dir + sed -i "s,^devhelpdir = \(.*\),devhelpdir = ${developDocDir}," \ + doc/devhelp/Makefile.am +} + +BUILD() +{ + withPython= + if $pythonModuleEnabled; then + # We symlink python's directories into our packaging directory and tell + # configure that it can find python there. This way the correct + # installation directory for the python module is determined. + pythonDir="$portPackageLinksDir/cmd~python3.10" + ln -s $pythonDir/bin $pythonDir/develop $pythonDir/lib $prefix + withPython="--with-python=$prefix" + else + withPython="--without-python" + fi + + runConfigure ./configure LDFLAGS="-lnetwork" \ + --disable-static \ + --with-legacy \ + $withPython + make $jobArgs +} + +INSTALL() +{ + if $pythonModuleEnabled; then + # Unfortunately we can't just remove the in symlinks we created in + # BUILD() and install normally, since then make detects that the + # Python.h is missing and tries to rebuild the module. So we leave + # things as is and use DESTDIR to install the everything in a subdir. + # Then we remove the symlinks and move everything where it belongs. + make DESTDIR=$prefix install + rm -f $prefix/bin $prefix/develop $prefix/lib + mv $prefix/$prefix/* $prefix + rm -r $prefix/packages + else + make install + fi + + mkdir -p $dataDir/aclocal + cp aclocal.m4 $dataDir/aclocal + + rm $libDir/libxml2.la + # prepare develop/lib + prepareInstalledDevelLibs libxml2 + fixPkgconfig + fixDevelopLibDirReferences $binDir/xml2-config + + # python package + if $pythonModuleEnabled; then + packageEntries python \ + $prefix/lib/python* + fi + + # devel package + packageEntries devel \ + $binDir/xml2-config \ + $dataDir \ + $developDir \ + $docDir \ + $manDir/man1/xml2-config.1 \ + $libDir/cmake + + # Remove stuff we don't need in the secondary architecture base package. + if [ -n "$secondaryArchSuffix" ]; then + rm -rf $binDir + rm -rf $documentationDir + else + # left-over since all contents has been moved to other packages + rmdir $(dirname $docDir) + fi +} + +TEST() +{ + # link the conformance suite + ln -sf ../../sources-2/xmlconf + + make check +} diff --git a/dev-libs/libxml2/patches/libxml2_2.14-2.14.4.patchset b/dev-libs/libxml2/patches/libxml2_2.14-2.14.4.patchset new file mode 100644 index 000000000..97ac26b85 --- /dev/null +++ b/dev-libs/libxml2/patches/libxml2_2.14-2.14.4.patchset @@ -0,0 +1,136 @@ +From 226718a81e4721605f287aec28f6b016634852f7 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Wed, 1 Jan 2014 22:13:22 +0100 +Subject: Port patches from libxml2-2.8.0. + + +diff --git a/xml2-config.in b/xml2-config.in +index 0097751..c0583b2 100644 +--- a/xml2-config.in ++++ b/xml2-config.in +@@ -40,8 +40,8 @@ while test $# -gt 0; do + case "$1" in + --prefix=*) + prefix=$optarg +- includedir=$prefix/include +- libdir=$prefix/lib ++ includedir=$prefix/develop/headers ++ libdir=$prefix/develop/lib + ;; + + --prefix) +@@ -50,7 +50,7 @@ while test $# -gt 0; do + + --exec-prefix=*) + exec_prefix=$optarg +- libdir=$exec_prefix/lib ++ libdir=$exec_prefix/develop/lib + ;; + + --exec-prefix) +-- +2.48.1 + + +From 2074a8b3174a3716147b2d5cda6e766aa40546d1 Mon Sep 17 00:00:00 2001 +From: Jessica Hamilton +Date: Sat, 30 May 2015 11:38:15 +1200 +Subject: Haiku: search for catalogs in directories + + +diff --git a/catalog.c b/catalog.c +index dc22e27..92b9309 100644 +--- a/catalog.c ++++ b/catalog.c +@@ -20,6 +20,10 @@ + #include + #include + ++#ifdef __HAIKU__ ++#include ++#endif ++ + #include + #include + +@@ -55,10 +59,10 @@ + #define XML_URN_PUBID "urn:publicid:" + #define XML_CATAL_BREAK ((xmlChar *) -1) + #ifndef XML_XML_DEFAULT_CATALOG +-#define XML_XML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/xml/catalog" ++#define XML_XML_DEFAULT_CATALOG "/boot/system/data/xml/catalog" + #endif + #ifndef XML_SGML_DEFAULT_CATALOG +-#define XML_SGML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/sgml/catalog" ++#define XML_SGML_DEFAULT_CATALOG "/boot/system/data/sgml/catalog" + #endif + + static xmlChar *xmlCatalogNormalizePublic(const xmlChar *pubID); +@@ -3036,6 +3040,21 @@ xmlCatalogIsEmpty(xmlCatalogPtr catal) { + * * + ************************************************************************/ + ++#ifdef __HAIKU__ ++static xmlCatalogEntryPtr *__haikuNextEntry; ++static int __haikuAddCatalog(const char* subpath, const struct stat* sb, int typeflag) ++{ ++ if (typeflag == FTW_F) { ++ *__haikuNextEntry = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL, ++ NULL, BAD_CAST subpath, xmlCatalogDefaultPrefer, NULL); ++ if (*__haikuNextEntry != NULL) ++ __haikuNextEntry = &((*__haikuNextEntry)->next); ++ } ++ ++ return 0; ++} ++#endif ++ + /** + * xmlInitCatalogInternal: + * +@@ -3090,10 +3109,16 @@ xmlInitializeCatalog(void) { + cur++; + path = (char *) xmlStrndup((const xmlChar *)paths, cur - paths); + if (path != NULL) { ++#ifdef __HAIKU__ ++ __haikuNextEntry = nextent; ++ ftw(path, __haikuAddCatalog, 3); ++ nextent = __haikuNextEntry; ++#else + *nextent = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL, + NULL, BAD_CAST path, xmlCatalogDefaultPrefer, NULL); + if (*nextent != NULL) + nextent = &((*nextent)->next); ++#endif + xmlFree(path); + } + } +-- +2.48.1 + + +From e266c8c240004d3a5e2c9a8550be0d45f5fa73e2 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Wed, 3 Apr 2019 18:27:19 +0200 +Subject: Remove options unknown to gcc2 + + +diff --git a/configure.ac b/configure.ac +index aaa02e3..63f3b52 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -372,9 +372,9 @@ if test "${GCC}" != "yes" ; then + esac + else + # warnings we'd like to see +- AM_CFLAGS="${AM_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" ++ AM_CFLAGS="${AM_CFLAGS} -pedantic -Wall -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" + # warnings we'd like to suppress +- AM_CFLAGS="${AM_CFLAGS} -Wno-long-long -Wno-format-extra-args -Wno-array-bounds" ++ AM_CFLAGS="${AM_CFLAGS} -Wno-long-long -Wno-format-extra-args" + case "${host}" in + alpha*-*-linux* ) + AM_CFLAGS="${AM_CFLAGS} -mieee" +-- +2.48.1 +