commit:     8331a685705a866be9249ee615fc0f945dbcd167
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Tue Jan 30 06:31:22 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 30 06:57:32 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8331a685

dev-libs/yaz: add 5.34.0

Bug: https://bugs.gentoo.org/730016
Bug: https://bugs.gentoo.org/923291
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/yaz/Manifest                              |   1 +
 .../yaz/files/yaz-5.34.0-fix-atoi-header.patch     |  54 +++++++++++
 .../yaz/files/yaz-5.34.0-fix-libxml2-2.12.patch    | 108 +++++++++++++++++++++
 dev-libs/yaz/yaz-5.34.0.ebuild                     |  76 +++++++++++++++
 4 files changed, 239 insertions(+)

diff --git a/dev-libs/yaz/Manifest b/dev-libs/yaz/Manifest
index 30ab494d9152..83ab11809ca8 100644
--- a/dev-libs/yaz/Manifest
+++ b/dev-libs/yaz/Manifest
@@ -1,2 +1,3 @@
 DIST yaz-3.0.53.tar.gz 2164681 BLAKE2B 
e42a97d63e031f14234258c7c44735a615ebc83774c1532d7e1b50f1f231dc933168e41a1b35a139ec193e694f6253336a666daad627a4aae9a0c7ffe34ca360
 SHA512 
537d54757e401c1b29ad2120209b2cd038f26ff7f43ffc3c1e22808e12a1580aedee3880478e951fd4b3057ca9af4a34afa2a64c0b8ffcbec24f76deb83ddc89
 DIST yaz-5.32.0.tar.gz 2607933 BLAKE2B 
9119b77a262ef2d6f0b1140425384575218a5b93cbe50a716bb254b07e2427eaad55de3c4590d0d6843af31b987b201fa733fdf010e463648a35b5600d055d5a
 SHA512 
a4d40b5c20b1d4acab0e687235eda361fe0550c00396f6aa26d1965d2ecdd217433ba65160eda07fcc4c263d9e2e47b607e4b668412f81123b2904b9deece763
+DIST yaz-5.34.0.tar.gz 2656382 BLAKE2B 
7a16974dc815c1121aaea4179843a6982600a0491c8c95a03f28cf0c68725b986ebc39049e2159cd0d105b23811d35ae3d3538a83e945b64951cc9215efe7f3d
 SHA512 
0c835b98b4640e077459c9ead8043cea941a75f39dace9501efbb56c38837b1525349b8668c135ac0753ba7a4803e38d9c90d7bf3f6f2951c0e7e863b4c51f65

diff --git a/dev-libs/yaz/files/yaz-5.34.0-fix-atoi-header.patch 
b/dev-libs/yaz/files/yaz-5.34.0-fix-atoi-header.patch
new file mode 100644
index 000000000000..c68b85c7017e
--- /dev/null
+++ b/dev-libs/yaz/files/yaz-5.34.0-fix-atoi-header.patch
@@ -0,0 +1,54 @@
+https://bugs.gentoo.org/923291
+https://github.com/indexdata/yaz/issues/104
+https://github.com/indexdata/yaz/pull/105
+
+From 3c61afce2c2517369c2bf1ba6846ff17f81c4b18 Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <[email protected]>
+Date: Tue, 21 Nov 2023 23:47:18 +0900
+Subject: [PATCH] FIX: fix build error with glibc 2.39
+
+glibc 2.39 does some refactoring for header file inclusion
+and some additional header inclusion is needed for yaz
+source.
+
+Closes #104 .
+--- a/src/record_conv.c
++++ b/src/record_conv.c
+@@ -11,6 +11,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <stdlib.h>
+ #include <string.h>
+ #include <yaz/log.h>
+ #include <yaz/yaz-iconv.h>
+--- a/src/xmlquery.c
++++ b/src/xmlquery.c
+@@ -10,6 +10,7 @@
+ #endif
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <assert.h>
+ 
+--- a/test/test_record_conv.c
++++ b/test/test_record_conv.c
+@@ -9,6 +9,7 @@
+ #include <yaz/record_conv.h>
+ #include <yaz/test.h>
+ #include <yaz/wrbuf.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <yaz/log.h>
+ #include <yaz/proto.h>
+--- a/test/test_retrieval.c
++++ b/test/test_retrieval.c
+@@ -9,6 +9,7 @@
+ #include <yaz/retrieval.h>
+ #include <yaz/test.h>
+ #include <yaz/wrbuf.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <yaz/log.h>
+ #include <yaz/oid_db.h>

diff --git a/dev-libs/yaz/files/yaz-5.34.0-fix-libxml2-2.12.patch 
b/dev-libs/yaz/files/yaz-5.34.0-fix-libxml2-2.12.patch
new file mode 100644
index 000000000000..379d15e4ab2d
--- /dev/null
+++ b/dev-libs/yaz/files/yaz-5.34.0-fix-libxml2-2.12.patch
@@ -0,0 +1,108 @@
+https://bugs.gentoo.org/917537
+https://github.com/indexdata/yaz/issues/102
+https://github.com/indexdata/yaz/pull/103
+
+From b10643c42ea64b1ee09fe53aec2490129f903bcb Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <[email protected]>
+Date: Tue, 21 Nov 2023 23:39:48 +0900
+Subject: [PATCH] FIX: fix build error with libxml2 2.12.0
+
+libxml2 2.12.0 changed which header file to define functions
+and header inclusion. Due to this refactoring, some yaz source
+files need additional inclusion of libxml2 header file,
+especially for libxml/parser.h .
+
+Closes #102 .
+--- a/client/client.c
++++ b/client/client.c
+@@ -73,6 +73,10 @@
+ #include <readline/history.h>
+ #endif
+ 
++#if YAZ_HAVE_XML2
++#include <libxml/parser.h>
++#endif
++
+ 
+ #include "admin.h"
+ #include "tabcomplete.h"
+--- a/src/record_render.c
++++ b/src/record_render.c
+@@ -23,6 +23,7 @@
+ #include <yaz/base64.h>
+ 
+ #if YAZ_HAVE_XML2
++#include <libxml/parser.h>
+ #include <libxml/xpath.h>
+ #include <libxml/xpathInternals.h>
+ #endif
+--- a/test/test_ccl.c
++++ b/test/test_ccl.c
+@@ -11,6 +11,9 @@
+ #include <yaz/log.h>
+ #include <yaz/test.h>
+ 
++#if YAZ_HAVE_XML2
++#include <libxml/parser.h>
++#endif
+ 
+ static int tst_ccl_query(CCL_bibset bibset,
+                          const char *query,
+--- a/test/test_icu.c
++++ b/test/test_icu.c
+@@ -28,6 +28,7 @@
+ #endif
+ 
+ #if YAZ_HAVE_XML2
++#include <libxml/parser.h>
+ #include <libxml/xmlmemory.h>
+ #endif
+ 
+--- a/test/test_xml_include.c
++++ b/test/test_xml_include.c
+@@ -12,6 +12,9 @@
+ 
+ #include <yaz/xml_include.h>
+ #include <yaz/test.h>
++#if YAZ_HAVE_XML2
++#include <libxml/parser.h>
++#endif
+ 
+ static void tst_xml_include1(void)
+ {
+--- a/util/cclsh.c
++++ b/util/cclsh.c
+@@ -20,6 +20,9 @@
+ #include <readline/history.h>
+ #endif
+ 
++#if YAZ_HAVE_XML2
++#include <libxml/parser.h>
++#endif
+ 
+ static int debug = 0;
+ static char *prog;
+--- a/util/yaz-icu.c
++++ b/util/yaz-icu.c
+@@ -17,6 +17,8 @@
+ 
+ #if YAZ_HAVE_ICU
+ 
++#include <libxml/parser.h>
++
+ #include <unicode/ucnv.h>
+ #include <unicode/ustring.h>
+ #include <unicode/ucol.h>
+--- a/util/yaz-record-conv.c
++++ b/util/yaz-record-conv.c
+@@ -13,6 +13,10 @@
+ #include <yaz/record_conv.h>
+ #include <yaz/backtrace.h>
+ 
++#if YAZ_HAVE_XML2
++#include <libxml/parser.h>
++#endif
++
+ const char *prog = "yaz-record-conv";
+ 
+ static void usage(void)

diff --git a/dev-libs/yaz/yaz-5.34.0.ebuild b/dev-libs/yaz/yaz-5.34.0.ebuild
new file mode 100644
index 000000000000..53aea1c836f6
--- /dev/null
+++ b/dev-libs/yaz/yaz-5.34.0.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="C/C++ toolkit for Z39.50v3 clients and servers"
+HOMEPAGE="https://www.indexdata.com/resources/software/yaz/";
+
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/indexdata/yaz.git";
+else
+       SRC_URI="https://ftp.indexdata.com/pub/${PN}/${P}.tar.gz";
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 
~sparc ~x86"
+fi
+
+LICENSE="BSD GPL-2"
+SLOT="0/5"
+IUSE="gnutls tcpd ziffy"
+
+RDEPEND="
+       dev-libs/icu:=
+       dev-libs/libxml2
+       dev-libs/libxslt
+       sys-libs/readline:=
+       sys-libs/ncurses:=
+       virtual/libintl
+       !gnutls? ( dev-libs/openssl:0= )
+       gnutls? ( net-libs/gnutls:= )
+       tcpd? ( sys-apps/tcp-wrappers )
+       ziffy? ( net-libs/libpcap )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       dev-lang/tcl:0
+       app-alternatives/yacc
+       >=dev-build/libtool-2
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       "${FILESDIR}"/yaz-5.34.0-fix-atoi-header.patch
+       "${FILESDIR}"/yaz-5.34.0-fix-libxml2-2.12.patch
+)
+
+src_prepare() {
+       default
+
+       # Hardcoded assumption of libraries reciding in lib/ bug #730016
+       sed -i -e "s|/lib\"|/$(get_libdir)\"|" configure.ac || die
+
+       eautoreconf
+}
+
+src_configure() {
+       econf \
+               --enable-shared \
+               $(use_with gnutls) \
+               $(use_enable tcpd tcpd /usr)
+}
+
+src_install() {
+       local docdir="/usr/share/doc/${PF}"
+       emake DESTDIR="${D}" docdir="${EPREFIX}/${docdir}" install
+
+       find "${D}" -name '*.la' -delete || die
+
+       dodir "${docdir}"/html
+       mv -f "${ED}"/${docdir}/*.{html,png} "${ED}"/${docdir}/html/ || die 
"Failed to move HTML docs"
+       mv -f "${ED}"/usr/share/doc/${PN}/common "${ED}"/${docdir}/html/ || die 
"Failed to move HTML docs"
+       rm -rf "${ED}"/usr/share/doc/${PN} || die
+
+       dodoc ChangeLog NEWS
+}

Reply via email to