dev-libs/jansson: Sync with Gentoo

It's from Gentoo commit 46f988e1136ebde62cff1dbdf87d71ef1ba198ec.
This commit is contained in:
Flatcar Buildbot 2025-06-16 07:08:01 +00:00 committed by Krzesimir Nowak
parent 7d4c23b224
commit 4c9a623c9f
4 changed files with 113 additions and 0 deletions

View File

@ -1 +1,2 @@
DIST jansson-2.14.1.tar.bz2 482990 BLAKE2B b3efb1cbe018bb88664167249edca65c5194922c69fa82a0514d5bbcd24324464ddcc30ae57f8ab0f9c43f28d2364adc973f87146ceff0889ea2b6eafb91b1ea SHA512 668d8ffbd13b83e8a55449c588f267220c2a9e4690281c2386e3dada4c8b890c80effd6a946b3500bb1cf800eb8cf1bb3da3c6476ceea4f462d2ccc9cd4911d8
DIST jansson-2.14.tar.bz2 434481 BLAKE2B b7b7e98360fd73f7925b88e3729a7a18307b4f05fed4b37659d24ddc03208469471d508dcd245534f73af3b5e93f595e49e3cb2c99733955b03d471bd5a32f15 SHA512 1a659c0f41b0672757c13ebd16bd10ad7d6484366aefda078aa816266ce4f5638bc121f1ce8c4234b0b9f201ea73c227b9084125857452cbcba058a111e4a6fd

View File

@ -1,3 +1,5 @@
https://github.com/akheron/jansson/pull/666
From https://github.com/akheron/jansson/pull/666/commits/1e2ac681e5f39fc7a7e8b8deb2162a93976d4622 Mon Sep 17 00:00:00 2001
From: Violet Purcell <vimproved@inventati.org>
Date: Wed, 11 Oct 2023 20:51:57 -0400

View File

@ -0,0 +1,62 @@
https://github.com/akheron/jansson/issues/715
Modified https://github.com/akheron/jansson/pull/666 with lessons taken from https://github.com/akheron/jansson/pull/704.
From https://github.com/akheron/jansson/pull/666/commits/1e2ac681e5f39fc7a7e8b8deb2162a93976d4622 Mon Sep 17 00:00:00 2001
From: Violet Purcell <vimproved@inventati.org>
Date: Wed, 11 Oct 2023 20:51:57 -0400
Subject: [PATCH] Port check for --default-symver to autoconf
This commit ports the configure check for -Wl,--default-symver that is
present in CMake to autoconf. This fixes building Jansson via autoconf
with non-bfd linkers on glibc systems.
Signed-off-by: Violet Purcell <vimproved@inventati.org>
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,9 @@ AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
AC_TYPE_LONG_LONG_INT
+jansson_soversion="4"
+AC_SUBST([jansson_soversion])
+
AC_C_INLINE
case $ac_cv_c_inline in
yes) json_inline=inline;;
@@ -138,8 +141,12 @@ AS_IF([test "x$with_Bsymbolic" = "xyes"], [JSON_BSYMBOLIC_LDFLAGS=-Wl[,]-Bsymbol
AC_SUBST(JSON_BSYMBOLIC_LDFLAGS)
# Enable symbol versioning on GNU libc
+m4_pattern_forbid([^AX_CHECK_LINK_FLAG$])
JSON_SYMVER_LDFLAGS=
-AC_CHECK_DECL([__GLIBC__], [JSON_SYMVER_LDFLAGS=-Wl,--default-symver])
+AC_CHECK_DECL([__GLIBC__],
+ [AX_CHECK_LINK_FLAG([-Wl,--default-symver],
+ [JSON_SYMVER_LDFLAGS=-Wl,--default-symver],
+ [JSON_SYMVER_LDFLAGS=-Wl,--version-script,$ac_abs_confdir/jansson.sym])])
AC_SUBST([JSON_SYMVER_LDFLAGS])
AC_ARG_ENABLE([ossfuzzers],
@@ -168,6 +175,7 @@ AC_SUBST([AM_CFLAGS])
AC_CONFIG_FILES([
jansson.pc
+ jansson.sym
Makefile
doc/Makefile
src/Makefile
--- /dev/null
+++ b/jansson.sym.in
@@ -0,0 +1,8 @@
+JANSSON_@jansson_soversion@ {
+ global:
+ json_*;
+ jansson_*;
+ local:
+ *;
+};
+
--
2.42.0

View File

@ -0,0 +1,48 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools
DESCRIPTION="C library for encoding, decoding and manipulating JSON data"
HOMEPAGE="https://www.digip.org/jansson/"
SRC_URI="https://github.com/akheron/jansson/releases/download/v${PV}/${P}.tar.bz2"
LICENSE="MIT"
SLOT="0/4"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
IUSE="doc static-libs"
BDEPEND="
dev-build/autoconf-archive
doc? ( dev-python/sphinx )
"
PATCHES=(
"${FILESDIR}"/jansson-2.14.1-default-symver-test.patch
)
src_prepare() {
default
eautoreconf
}
src_configure() {
econf $(use_enable static-libs static)
}
src_compile() {
default
if use doc ; then
emake html
HTML_DOCS=( doc/_build/html/. )
fi
}
src_install() {
default
find "${ED}" -name '*.la' -delete || die
}