summaryrefslogtreecommitdiffstats
path: root/system/osinfo-db-tools
diff options
context:
space:
mode:
Diffstat (limited to 'system/osinfo-db-tools')
-rw-r--r--system/osinfo-db-tools/libxml-2.12.patch85
-rw-r--r--system/osinfo-db-tools/osinfo-db-tools.SlackBuild52
-rw-r--r--system/osinfo-db-tools/osinfo-db-tools.info8
3 files changed, 122 insertions, 23 deletions
diff --git a/system/osinfo-db-tools/libxml-2.12.patch b/system/osinfo-db-tools/libxml-2.12.patch
new file mode 100644
index 0000000000..af42e41229
--- /dev/null
+++ b/system/osinfo-db-tools/libxml-2.12.patch
@@ -0,0 +1,85 @@
+From 34378a4ac257f2f5fcf364786d1634a8c36b304f Mon Sep 17 00:00:00 2001
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Mon, 27 Nov 2023 15:04:43 +0100
+Subject: [PATCH 1/2] Make xmlError structs constant
+
+In libxml2 commits v2.12.0~14 and v2.12.0~77 the API changed so
+that:
+
+1) xmlGetLastError() returns pointer to a constant xmlError
+ struct, and
+
+2) xmlSetStructuredErrorFunc() changed the signature of callback
+ (validate_structured_error_nop()), it too is passed pointer to
+ a constant xmlError struct.
+
+But of course, older libxml2 expects different callback
+signature. Therefore, we need to typecast it anyway.
+
+Also, drop obviously incorrect @error annotation in
+validate_structured_error_nop; the variable is used.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ tools/osinfo-db-validate.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tools/osinfo-db-validate.c b/tools/osinfo-db-validate.c
+index a721b4d..b1434a6 100644
+--- a/tools/osinfo-db-validate.c
++++ b/tools/osinfo-db-validate.c
+@@ -35,7 +35,7 @@ static void validate_generic_error_nop(void *userData G_GNUC_UNUSED,
+ }
+
+ static void validate_structured_error_nop(void *userData G_GNUC_UNUSED,
+- xmlErrorPtr error G_GNUC_UNUSED)
++ const xmlError *error)
+ {
+ if (error->file)
+ g_printerr("%s:%d %s", error->file, error->line, error->message);
+@@ -173,7 +173,8 @@ static gboolean validate_files(GFile *schema, gsize nfiles, GFile **files, GErro
+ g_autofree gchar *schemapath = NULL;
+
+ xmlSetGenericErrorFunc(NULL, validate_generic_error_nop);
+- xmlSetStructuredErrorFunc(NULL, validate_structured_error_nop);
++ /* Drop this typecast when >=libxml2-2.12.0 is required */
++ xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc) validate_structured_error_nop);
+
+ schemapath = g_file_get_path(schema);
+ rngParser = xmlRelaxNGNewParserCtxt(schemapath);
+--
+GitLab
+
+
+From 019487cbc79925e49988789bf533c78dab7e1842 Mon Sep 17 00:00:00 2001
+From: Michal Privoznik <mprivozn@redhat.com>
+Date: Mon, 27 Nov 2023 15:06:04 +0100
+Subject: [PATCH 2/2] osinfo-db-validate: Add more libxml/ includes
+
+In its 2.12.0 release, libxml reworked their header files (some
+might even call it cleaning up, I call it API incompatible
+change) and now we don't get all declarations we need by just
+including one file. Add missing includes.
+
+Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
+---
+ tools/osinfo-db-validate.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tools/osinfo-db-validate.c b/tools/osinfo-db-validate.c
+index b1434a6..f3275db 100644
+--- a/tools/osinfo-db-validate.c
++++ b/tools/osinfo-db-validate.c
+@@ -20,7 +20,9 @@
+ * Daniel P. Berrange <berrange@redhat.com>
+ */
+
++#include <libxml/parser.h>
+ #include <libxml/relaxng.h>
++#include <libxml/tree.h>
+ #include <locale.h>
+ #include <glib/gi18n.h>
+
+--
+GitLab
+
diff --git a/system/osinfo-db-tools/osinfo-db-tools.SlackBuild b/system/osinfo-db-tools/osinfo-db-tools.SlackBuild
index 9fb7bbf9d1..368b4424a6 100644
--- a/system/osinfo-db-tools/osinfo-db-tools.SlackBuild
+++ b/system/osinfo-db-tools/osinfo-db-tools.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for osinfo-db-tools
-# Copyright 2016-2019 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy
+# Copyright 2016-2024 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +22,13 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=osinfo-db-tools
-VERSION=${VERSION:-1.6.0}
+VERSION=${VERSION:-1.11.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +38,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -54,7 +64,7 @@ else
LIBDIRSUFFIX=""
fi
-DOCS="AUTHORS ChangeLog COPYING NEWS README"
+DOCS="CONTRIBUTING.md COPYING NEWS README"
set -e
@@ -71,19 +81,23 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --mandir=/usr/man \
- --docdir=/usr/doc/$PRGNAM-$VERSION \
- --build=$ARCH-slackware-linux
-
-make
-make install DESTDIR=$PKG
+patch -p1 < $CWD/libxml-2.12.patch
+
+mkdir build
+cd build
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ meson .. \
+ --buildtype=release \
+ --infodir=/usr/info \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --prefix=/usr \
+ --sysconfdir=/etc
+ "${NINJA:=ninja}"
+ DESTDIR=$PKG $NINJA install
+cd ..
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -99,4 +113,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/system/osinfo-db-tools/osinfo-db-tools.info b/system/osinfo-db-tools/osinfo-db-tools.info
index 906b8fceca..99dae01bac 100644
--- a/system/osinfo-db-tools/osinfo-db-tools.info
+++ b/system/osinfo-db-tools/osinfo-db-tools.info
@@ -1,10 +1,10 @@
PRGNAM="osinfo-db-tools"
-VERSION="1.6.0"
+VERSION="1.11.0"
HOMEPAGE="http://libosinfo.org"
-DOWNLOAD="https://releases.pagure.org/libosinfo/osinfo-db-tools-1.6.0.tar.gz"
-MD5SUM="edfb599f960161d348c67f3261627136"
+DOWNLOAD="https://releases.pagure.org/libosinfo/osinfo-db-tools-1.11.0.tar.xz"
+MD5SUM="8fed1cfc692b6fa1a80f002b0a8447ac"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="json-glib"
+REQUIRES=""
MAINTAINER="Matteo Bernardini"
EMAIL="ponce@slackbuilds.org"