summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2024-03-27 23:45:51 +0100
committerSebastian Pipping <sping@gentoo.org>2024-03-27 23:45:51 +0100
commit56085500739ab65b687013d8bd8e7725a8edd413 (patch)
tree7b6aaf527083046f6664b06c7af73b5e90a7ed30 /app-text/xmlstarlet
parentsys-apps/pkgcore: add 0.12.26 (diff)
downloadgentoo-56085500739ab65b687013d8bd8e7725a8edd413.tar.gz
gentoo-56085500739ab65b687013d8bd8e7725a8edd413.tar.bz2
gentoo-56085500739ab65b687013d8bd8e7725a8edd413.zip
app-text/xmlstarlet: Fix compilation for Clang >=17
Closes: https://bugs.gentoo.org/927838 Signed-off-by: Sebastian Pipping <sping@gentoo.org>
Diffstat (limited to 'app-text/xmlstarlet')
-rw-r--r--app-text/xmlstarlet/files/xmlstarlet-1.6.1-clang17.patch59
-rw-r--r--app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild60
2 files changed, 119 insertions, 0 deletions
diff --git a/app-text/xmlstarlet/files/xmlstarlet-1.6.1-clang17.patch b/app-text/xmlstarlet/files/xmlstarlet-1.6.1-clang17.patch
new file mode 100644
index 000000000000..9269349726d5
--- /dev/null
+++ b/app-text/xmlstarlet/files/xmlstarlet-1.6.1-clang17.patch
@@ -0,0 +1,59 @@
+From e1da090da24f5620784daf853eb1353aa164583f Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Wed, 27 Mar 2024 23:25:39 +0100
+Subject: [PATCH] Address -Wincompatible-function-pointer-types for Clang 17
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Also showed with -Werror=incompatible-pointer-types with GCC.
+
+Bug: https://bugs.gentoo.org/927838
+
+Symptom with GCC was:
+> src/xml.c: In function ‘main’:
+> src/xml.c:300:43: error: passing argument 2 of ‘xmlSetStructuredErrorFunc’ from incompatible pointer type [-Werror=incompatible-pointer-types]
+> 300 | xmlSetStructuredErrorFunc(&errorInfo, reportError);
+> | ^~~~~~~~~~~
+> | |
+> | void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
+> In file included from /usr/include/libxml2/libxml/valid.h:15,
+> from /usr/include/libxml2/libxml/parser.h:19,
+> from /usr/include/libxml2/libxml/tree.h:17,
+> from /usr/include/libxslt/xslt.h:13,
+> from src/xml.c:37:
+> /usr/include/libxml2/libxml/xmlerror.h:898:57: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
+---
+ src/xml.c | 2 +-
+ src/xmlstar.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/xml.c b/src/xml.c
+index cf47cc2..e6f19c1 100644
+--- a/src/xml.c
++++ b/src/xml.c
+@@ -104,7 +104,7 @@ void reportGenericError(void* ctx, const char * msg, ...) {
+ /* by default all errors are reported */
+ static ErrorInfo errorInfo = { NULL, NULL, VERBOSE, CONTINUE };
+
+-void reportError(void *ptr, xmlErrorPtr error)
++void reportError(void *ptr, const xmlError *error)
+ {
+ ErrorInfo *errorInfo = (ErrorInfo*) ptr;
+ assert(errorInfo);
+diff --git a/src/xmlstar.h b/src/xmlstar.h
+index 3e1eed3..e8d7177 100644
+--- a/src/xmlstar.h
++++ b/src/xmlstar.h
+@@ -32,7 +32,7 @@ typedef struct _errorInfo {
+ ErrorStop stop;
+ } ErrorInfo;
+
+-void reportError(void *ptr, xmlErrorPtr error);
++void reportError(void *ptr, const xmlError *error);
+ void suppressErrors(void);
+
+ typedef struct _gOptions {
+--
+2.44.0
+
diff --git a/app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild b/app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild
new file mode 100644
index 000000000000..8d84085ae390
--- /dev/null
+++ b/app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic toolchain-funcs
+
+DESCRIPTION="A set of tools to transform, query, validate, and edit XML documents"
+HOMEPAGE="https://xmlstar.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xmlstar/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+
+RDEPEND="
+ dev-libs/libxml2
+ dev-libs/libxslt
+ dev-libs/libgcrypt:0=
+ virtual/libiconv"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.6.1-clang16.patch
+ "${FILESDIR}"/${PN}-1.6.1-clang17.patch
+)
+
+src_prepare() {
+ default
+
+ # We need to patch use of /usr/lib because it is a problem with
+ # linker lld with profile 17.1 on amd64 (see https://bugs.gentoo.org/729600).
+ # The grep sandwich acts as a regression test so that a future
+ # version bump cannot break patching without noticing.
+ if [[ $(get_libdir) != lib ]]; then
+ grep -wq _PREFIX/lib m4/xstar-check-libs.m4 || die
+ sed "s,_PREFIX/lib,_PREFIX/$(get_libdir)," -i m4/xstar-check-libs.m4 || die
+ grep -w _PREFIX/lib m4/xstar-check-libs.m4 && die
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags libxml-2.0)
+
+ # NOTE: Fully built documentation is already shipped with the tarball:
+ # - doc/xmlstarlet-ug.{pdf,ps,html}
+ # - doc/xmlstarlet.txt
+ # - doc/xmlstarlet.1
+ econf \
+ --disable-build-docs \
+ --disable-static-libs
+}
+
+src_install() {
+ default
+ dosym xml /usr/bin/xmlstarlet
+}