From 56a4d8f72db1cc23ab929bd82fd6cc8e663dae48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= Date: Sun, 12 Apr 2026 19:23:08 +0200 Subject: [PATCH] dev-libs/xmlrpc-c: add 1.64.03 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix C23 bool misbehaviour - rebase system-expat patch - tests pass with gcc-15/clang-22 and both libxml2/system-expat - remove IUSE=threads, use upstream default Closes: https://bugs.gentoo.org/972567 Signed-off-by: Holger Hoffstätte Part-of: https://codeberg.org/gentoo/gentoo/pulls/608 Merges: https://codeberg.org/gentoo/gentoo/pulls/608 Signed-off-by: Sam James --- dev-libs/xmlrpc-c/Manifest | 1 + .../files/xmlrpc-c-1.64.03-use-stdbool.patch | 16 ++ .../xmlrpc-c-1.64.03-use-system-expat.patch | 203 ++++++++++++++++++ dev-libs/xmlrpc-c/xmlrpc-c-1.64.03.ebuild | 89 ++++++++ 4 files changed, 309 insertions(+) create mode 100644 dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-stdbool.patch create mode 100644 dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-system-expat.patch create mode 100644 dev-libs/xmlrpc-c/xmlrpc-c-1.64.03.ebuild diff --git a/dev-libs/xmlrpc-c/Manifest b/dev-libs/xmlrpc-c/Manifest index 90ac0515dc976..3e1ca42d460f8 100644 --- a/dev-libs/xmlrpc-c/Manifest +++ b/dev-libs/xmlrpc-c/Manifest @@ -1 +1,2 @@ +DIST xmlrpc-1.64.03.tgz 937735 BLAKE2B 6da8a4872b8e6a6a9131e20be0c0953f0fad852152866e3e13ce713f1079b9d8d81105d0942b3892902414f972719a4b29dfaba958d1476cfc0eade7abdf7935 SHA512 8a20442e89f2cbd593345fd93596ddfce088a0f22477829dbccf94055b102626f00a97e70a6f107945bd5dc931e05f534fa79e35dba18f09cd8e1988395b4031 DIST xmlrpc-c-1.59.03.tgz 935404 BLAKE2B 7a8d2ea19fe698538747d8b5735eb3247dec0c0ef87204cdec3a2aa051581e2d23b1a7b41673ff422c69474c5a4f24243945d5474c30beafc59235bc60c2cad5 SHA512 10b984421e7f4a7c1434b03f542ba1c9f9027ae72ed6022aca5efee55fc630b0f630f1ca5193fd2477c743ffd994c199064b15b73d1b019004f1f8e36cbd6921 diff --git a/dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-stdbool.patch b/dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-stdbool.patch new file mode 100644 index 0000000000000..b58b6dc887a90 --- /dev/null +++ b/dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-stdbool.patch @@ -0,0 +1,16 @@ +Replace custom bool definitions with stdbool.h to work with C23. + +--- a/lib/util/include/bool.h ++++ b/lib/util/include/bool.h +@@ -9,10 +9,7 @@ + /* At least the GNU compiler defines __bool_true_false_are_defined */ + #ifndef __bool_true_false_are_defined + #define __bool_true_false_are_defined +-typedef enum { +- false = 0, +- true = 1 +-} bool; ++#include + #endif + #endif + diff --git a/dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-system-expat.patch b/dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-system-expat.patch new file mode 100644 index 0000000000000..3c0d4347812dc --- /dev/null +++ b/dev-libs/xmlrpc-c/files/xmlrpc-c-1.64.03-use-system-expat.patch @@ -0,0 +1,203 @@ +Rebased version of expat unbundling to 1.64.03: +https://codeberg.org/gentoo/gentoo/commit/61b6130343a41b49da1ffe7376ab5d2077a37411 +Bug: https://bugs.gentoo.org/952113 + +--- a/common.mk ++++ b/common.mk +@@ -216,22 +216,6 @@ LIBXMLRPC_SERVER_CGI_A = $(BLDDIR)/src + + endif + +-LIBXMLRPC_XMLTOK_DIR = $(BLDDIR)/lib/expat/xmltok +- +-ifneq ($(OMIT_XMLTOK_LIB_RULE),Y) +-LIBXMLRPC_XMLTOK = \ +- $(call shliblefn, $(LIBXMLRPC_XMLTOK_DIR)/libxmlrpc_xmltok) +-LIBXMLRPC_XMLTOK_A = $(LIBXMLRPC_XMLTOK_DIR)/libxmlrpc_xmltok.a +-endif +- +-LIBXMLRPC_XMLPARSE_DIR = $(BLDDIR)/lib/expat/xmlparse +- +-ifneq ($(OMIT_XMLPARSE_LIB_RULE),Y) +-LIBXMLRPC_XMLPARSE = \ +- $(call shliblefn, $(LIBXMLRPC_XMLPARSE_DIR)/libxmlrpc_xmlparse) +-LIBXMLRPC_XMLPARSE_A = $(LIBXMLRPC_XMLPARSE_DIR)/libxmlrpc_xmlparse.a +-endif +- + LIBXMLRPC_ABYSS_DIR = $(BLDDIR)/lib/abyss/src + + ifneq ($(OMIT_ABYSS_LIB_RULE),Y) +@@ -270,16 +254,11 @@ LIBXMLRPC_SERVER_PSTREAMPP = \ + $(call shliblefn, $(BLDDIR)/src/cpp/libxmlrpc_server_pstream++) + LIBXMLRPC_SERVER_PSTREAMPP_A = $(BLDDIR)/src/cpp/libxmlrpc_server_pstream++.a + +-# LIBXMLRPC_XML is the list of Xmlrpc-c libraries we need to parse +-# XML. If we're using an external library to parse XML, this is null. + # LDLIBS_XML is the corresponding -L/-l options + + ifneq ($(ENABLE_LIBXML2_BACKEND),yes) + # We're using the internal Expat XML parser +- LIBXMLRPC_XML = $(LIBXMLRPC_XMLPARSE) $(LIBXMLRPC_XMLTOK) +- LDLIBS_XML = \ +- -L$(BLDDIR)/lib/expat/xmlparse -lxmlrpc_xmlparse \ +- -L$(BLDDIR)/lib/expat/xmltok -lxmlrpc_xmltok ++ LDLIBS_XML = $(shell $(PKG_CONFIG) --libs expat) + else + LDLIBS_XML = $(shell $(PKG_CONFIG) libxml-2.0 --libs) + endif +@@ -472,14 +451,6 @@ $(LIBXMLRPC_UTILPP) $(LIBXMLRPC_UTILPP_A + $(MAKE) -C $(dir $@) -f $(SRCDIR)/lib/libutil++/Makefile \ + $(notdir $@) + +-$(LIBXMLRPC_XMLPARSE) $(LIBXMLRPC_XMLPARSE_A) : FORCE +- $(MAKE) -C $(dir $@) -f $(SRCDIR)/lib/expat/xmlparse/Makefile \ +- $(notdir $@) +- +-$(LIBXMLRPC_XMLTOK) $(LIBXMLRPC_XMLTOK_A) : FORCE +- $(MAKE) -C $(dir $@) -f $(SRCDIR)/lib/expat/xmltok/Makefile \ +- $(notdir $@) +- + $(LIBXMLRPC_ABYSS) $(LIBXMLRPC_ABYSS_A): FORCE + $(MAKE) -C $(dir $@) -f $(SRCDIR)/lib/abyss/src/Makefile \ + $(notdir $@) +--- a/config.mk.in ++++ b/config.mk.in +@@ -52,6 +52,7 @@ CXX = @CXX@ + CCLD = $(CC) + CXXLD = $(CXX) + AR = @AR@ ++PKG_CONFIG = pkg-config + RANLIB = @RANLIB@ + LN_S = ln -s + INSTALL = $(SRCDIR)/install-sh +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -28,9 +28,6 @@ endif + ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes) + SUBDIRS += libwww_transport + endif +-ifneq ($(ENABLE_LIBXML2_BACKEND),yes) +- SUBDIRS += expat +-endif + + ifeq ($(HAVE_OPENSSL),yes) + SUBDIRS += openssl +--- a/src/Makefile ++++ b/src/Makefile +@@ -73,10 +73,8 @@ ifeq ($(ENABLE_LIBXML2_BACKEND),yes) + XML_PKGCONFIG_REQ = libxml-2.0 + else + XMLRPC_XML_PARSER = xmlrpc_expat +- XML_PARSER_LIBDEP = \ +- -Lblddir/lib/expat/xmlparse -lxmlrpc_xmlparse \ +- -Lblddir/lib/expat/xmltok -lxmlrpc_xmltok +- XML_PARSER_LIBDEP_DEP = $(LIBXMLRPC_XMLPARSE) $(LIBXMLRPC_XMLTOK) ++ XML_PARSER_LIBDEP = $(shell $(PKG_CONFIG) expat --libs) ++ XML_PARSER_LIBDEP_DEP = + XML_PKGCONFIG_REQ = xmlrpc_expat + endif + +@@ -278,7 +276,7 @@ BASIC_INCLUDES = \ + ifeq ($(ENABLE_LIBXML2_BACKEND),yes) + LIBXML_INCLUDES = $(shell $(PKG_CONFIG) libxml-2.0 --cflags) + else +- LIBXML_INCLUDES = -Isrcdir/lib/expat/xmlparse ++ LIBXML_INCLUDES = $(shell $(PKG_CONFIG) --cflags expat) + endif + + $(LIBXMLRPC_MODS:%=%.o) \ +--- a/src/cpp/Makefile ++++ b/src/cpp/Makefile +@@ -42,7 +42,7 @@ DEP_SOURCES = *.cpp + ifeq ($(ENABLE_LIBXML2_BACKEND),yes) + LIBXML_INCLUDES = $(LIBXML2_CFLAGS) + else +- LIBXML_INCLUDES = -Isrcdir/lib/expat/xmlparse ++ LIBXML_INCLUDES = $(shell $(PKG_CONFIG) --cflags expat) + endif + + LIBXMLRPCPP_MODS = fault global outcome param_list value xml +--- a/src/xmlrpc_expat.c ++++ b/src/xmlrpc_expat.c +@@ -6,7 +6,7 @@ + #include + #include + +-#include /* Expat */ ++#include + + #include "bool.h" + +@@ -419,18 +419,18 @@ createParser(xmlrpc_env * const env + -----------------------------------------------------------------------------*/ + XML_Parser parser; + +- parser = xmlrpc_XML_ParserCreate(NULL); ++ parser = XML_ParserCreate(NULL); + if (parser == NULL) + xmlrpc_faultf(envP, "Could not create expat parser"); + else { + initParseContext(contextP, memPoolP); + +- xmlrpc_XML_SetUserData(parser, contextP); +- xmlrpc_XML_SetElementHandler( ++ XML_SetUserData(parser, contextP); ++ XML_SetElementHandler( + parser, + (XML_StartElementHandler) startElement, + (XML_EndElementHandler) endElement); +- xmlrpc_XML_SetCharacterDataHandler( ++ XML_SetCharacterDataHandler( + parser, + (XML_CharacterDataHandler) characterData); + } +@@ -445,7 +445,7 @@ destroyParser(XML_Parser const parse + + termParseContext(contextP); + +- xmlrpc_XML_ParserFree(parser); ++ XML_ParserFree(parser); + } + + +@@ -483,15 +483,18 @@ xml_parse(xmlrpc_env * const envP, + if (!envP->fault_occurred) { + bool ok; + +- ok = xmlrpc_XML_Parse(parser, xmlData, xmlDataLen, 1); ++ ok = XML_Parse(parser, xmlData, xmlDataLen, 1); + /* sets 'context', *envP */ + if (!ok) { + /* Expat failed on its own to parse it -- this is not an error + that our handlers detected. + */ ++ const enum XML_Error error_code = XML_GetErrorCode(parser); ++ const char * const error_string = (error_code == XML_ERROR_NONE) ? NULL : XML_ErrorString(error_code); ++ + xmlrpc_env_set_fault( + envP, XMLRPC_PARSE_ERROR, +- xmlrpc_XML_GetErrorString(parser)); ++ error_string); + if (!context.env.fault_occurred) { + /* Have to clean up what our handlers built before Expat + barfed. +--- a/xmlrpc-c-config.test.main ++++ b/xmlrpc-c-config.test.main +@@ -19,13 +19,12 @@ sopath= + # It's important that packetsocket lib go after client, server libs + packetsocket_lib= + ++[ -n "${PKG_CONFIG}" ] || PKG_CONFIG=pkg-config ++ + if test "${ENABLE_LIBXML2_BACKEND}" = "yes"; then +- LIBXML=$(shell $(PKG_CONFIG) libxml-2.0 --libs) ++ LIBXML=$(${PKG_CONFIG} libxml-2.0 --libs) + else +- LIBXML="${BLDDIR}/lib/expat/xmlparse/libxmlrpc_xmlparse.a" +- sopath="${BLDDIR}/lib/expat/xmlparse:$sopath" +- LIBXML="${LIBXML} ${BLDDIR}/lib/expat/xmltok/libxmlrpc_xmltok.a" +- sopath="${BLDDIR}/lib/expat/xmltok:$sopath" ++ LIBXML=$(${PKG_CONFIG} expat --libs) + fi + + needCpp=no diff --git a/dev-libs/xmlrpc-c/xmlrpc-c-1.64.03.ebuild b/dev-libs/xmlrpc-c/xmlrpc-c-1.64.03.ebuild new file mode 100644 index 0000000000000..fa1f9b3b87aba --- /dev/null +++ b/dev-libs/xmlrpc-c/xmlrpc-c-1.64.03.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic toolchain-funcs + +# Upstream maintains 3 release channels: https://xmlrpc-c.sourceforge.net/release.html +# 1. Only the "Super Stable" series is released as a tarball +# 2. SVN tagging of releases seems spotty: https://svn.code.sf.net/p/xmlrpc-c/code/release_number/ +# Because of this, we are following the "Super Stable" release channel + +DESCRIPTION="A lightweight RPC library based on XML and HTTP" +HOMEPAGE="https://xmlrpc-c.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/${PN}/Xmlrpc-c%20Super%20Stable/${PV}/xmlrpc-${PV}.tgz" +S="${WORKDIR}/xmlrpc-${PV}" + +LICENSE="BSD" +SLOT="0/4.59" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~x64-solaris" +IUSE="abyss +cgi +curl +cxx +libxml2 static-libs test" +RESTRICT="!test? ( test )" +REQUIRED_USE="test? ( abyss curl cxx )" + +RDEPEND=" + dev-libs/openssl:= + sys-libs/ncurses:= + sys-libs/readline:= + curl? ( net-misc/curl ) + libxml2? ( dev-libs/libxml2:= ) +" +DEPEND="${RDEPEND}" + +# configure calls curl-config, hence curl in BDEPEND +BDEPEND=" + virtual/pkgconfig + curl? ( net-misc/curl ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.64.03-use-stdbool.patch + "${FILESDIR}"/${PN}-1.64.03-use-system-expat.patch +) + +pkg_setup() { + use curl || ewarn "Curl support disabled: No client library will be built" +} + +src_prepare() { + rm -R lib/expat/ || die + + default + + sed -i \ + -e "/CFLAGS_COMMON/s|-g -O3$||" \ + -e "/CXXFLAGS_COMMON/s|-g$||" \ + common.mk || die + eautoconf +} + +src_configure() { + tc-export PKG_CONFIG + + econf \ + --disable-libwww-client \ + --disable-wininet-client \ + --without-libwww-ssl \ + $(use_enable abyss abyss-server) \ + $(use_enable cgi cgi-server) \ + $(use_enable curl curl-client) \ + $(use_enable cxx cplusplus) \ + $(use_enable libxml2 libxml2-backend) +} + +src_compile() { + default + + # Tools building is broken in this release + #use tools && emake -rC "${S}"/tools +} + +src_install() { + default + + use static-libs || find "${D}" -type f -name \*.a -delete + + # Tools building is broken in this release + #use tools && emake DESTDIR="${D}" -rC "${S}"/tools install +}