* [gentoo-commits] repo/gentoo:master commit in: dev-libs/json-parser/, dev-libs/json-parser/files/
@ 2022-08-18 7:06 Joonas Niilola
0 siblings, 0 replies; 2+ messages in thread
From: Joonas Niilola @ 2022-08-18 7:06 UTC (permalink / raw
To: gentoo-commits
commit: 3d84addb0089529e1b6ef37cb19db59eb63a02cf
Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Fri Jul 29 11:54:22 2022 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Aug 18 07:06:18 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d84addb
dev-libs/json-parser: new package, add 1.1.0_p20211208
Original version 1.1.0 is from a year 2014, which is quite old. The
snapshot is from latest commit 531a49062975 ("Add author of #154 to
AUTHORS") in master branch, which contains (among others) two fixes
related to strict aliasing. New release is anticipated [1], but it is
not clear when it will happen, as the ticket is open for 2 years
already.
It was necessary to apply one patch proposed as PR [2] to upstream,
which changes pkgconfig file installation path from datadir to libdir.
This library is currently known to be bundled in multiple packages in
::gentoo, see the corresponding bugs bellow.
[1] https://github.com/json-parser/json-parser/issues/82
[2] https://github.com/json-parser/json-parser/pull/164
Bug: https://bugs.gentoo.org/858524
Bug: https://bugs.gentoo.org/861143
Bug: https://bugs.gentoo.org/861371
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
dev-libs/json-parser/Manifest | 1 +
.../files/json-parser-1.1.0-pkgconfig-libdir.patch | 22 ++++++
.../json-parser/json-parser-1.1.0_p20211208.ebuild | 82 ++++++++++++++++++++++
dev-libs/json-parser/metadata.xml | 15 ++++
4 files changed, 120 insertions(+)
diff --git a/dev-libs/json-parser/Manifest b/dev-libs/json-parser/Manifest
new file mode 100644
index 000000000000..ac3d8c8c0ff7
--- /dev/null
+++ b/dev-libs/json-parser/Manifest
@@ -0,0 +1 @@
+DIST json-parser-1.1.0_p20211208.tar.gz 51479 BLAKE2B 31ce7929c1de829e312dfc855365d8851ad7c2ce31379d3ab4b4937291e2ec367c7692ecb11b781d0647e5dc38008e4e7bd122d9edaafd1c393a1cbf765117b9 SHA512 cbe6690a70ada1906b2c208fcbe03fe5a14651660ece9ba933a3160ea027c6dd9507189e1c63052059c3a00b2e2a59dbc65fa668a287455d438aa4453eecf22f
diff --git a/dev-libs/json-parser/files/json-parser-1.1.0-pkgconfig-libdir.patch b/dev-libs/json-parser/files/json-parser-1.1.0-pkgconfig-libdir.patch
new file mode 100644
index 000000000000..094f8f985dec
--- /dev/null
+++ b/dev-libs/json-parser/files/json-parser-1.1.0-pkgconfig-libdir.patch
@@ -0,0 +1,22 @@
+Upstream-PR: https://github.com/json-parser/json-parser/pull/164
+
+diff --git a/Makefile.in b/Makefile.in
+index 8938230..b7539f7 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -43,9 +43,9 @@ clean:
+ rm -f libjsonparser.$(SO_EXT) libjsonparser.a json.o
+
+ install-shared: libjsonparser.$(SO_EXT)
+- @echo Installing pkgconfig module: $(datadir)/pkgconfig/json-parser.pc
+- @install -d $(datadir)/pkgconfig/ || true
+- @install -m 0644 json-parser.pc $(datadir)/pkgconfig/json-parser.pc
++ @echo Installing pkgconfig module: $(libdir)/pkgconfig/json-parser.pc
++ @install -d $(libdir)/pkgconfig/ || true
++ @install -m 0644 json-parser.pc $(libdir)/pkgconfig/json-parser.pc
+ @echo Installing shared library: $(libdir)/libjsonparser.$(SO_EXT)
+ @install -d $(libdir) || true
+ @install -m 0755 libjsonparser.$(SO_EXT) $(libdir)/$(REAL_NAME)
+--
+2.35.1
+
diff --git a/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild b/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
new file mode 100644
index 000000000000..a551d83b795c
--- /dev/null
+++ b/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
@@ -0,0 +1,82 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit distutils-r1 edo toolchain-funcs
+
+COMMIT="531a49062975d6d2cd5d69b75ad5481a8c0e18c5"
+
+DESCRIPTION="Very low footprint JSON parser written in portable ANSI C"
+HOMEPAGE="https://github.com/json-parser/json-parser"
+SRC_URI="https://github.com/json-parser/json-parser/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+LICENSE="BSD-2"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+IUSE="python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ python? ( ${PYTHON_DEPS} )
+"
+BDEPEND="
+ python? (
+ ${PYTHON_DEPS}
+ ${DISTUTILS_DEPS}
+ dev-python/cython[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=( "${FILESDIR}/${PN}-1.1.0-pkgconfig-libdir.patch" )
+
+wrap_python() {
+ local phase=$1
+ shift
+
+ if use python; then
+ pushd bindings/python || die
+ distutils-r1_${phase} "${@}"
+ popd
+ fi
+}
+
+src_prepare() {
+ default
+ wrap_python ${FUNCNAME}
+}
+
+src_configure() {
+ default
+ wrap_python ${FUNCNAME}
+}
+
+src_compile() {
+ default
+ wrap_python ${FUNCNAME}
+}
+
+python_test() {
+ "${EPYTHON}" test.py || die "Tests failed with ${EPYTHON}"
+}
+
+src_test() {
+ edo $(tc-getCC) ${CFLAGS} -I. ${CPPFLAGS} ${LDFLAGS} -o tests/test tests/test.c json.o
+ pushd tests > /dev/null || die
+ edo ./test
+ use python && distutils-r1_src_test
+ popd
+}
+
+src_install() {
+ emake DESTDIR="${D}" install-shared
+ dodoc README.md AUTHORS
+ wrap_python ${FUNCNAME}
+}
diff --git a/dev-libs/json-parser/metadata.xml b/dev-libs/json-parser/metadata.xml
new file mode 100644
index 000000000000..4580bd57e5b3
--- /dev/null
+++ b/dev-libs/json-parser/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>arkamar@atlas.cz</email>
+ <name>Petr Vaněk</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">json-parser/json-parser</remote-id>
+ </upstream>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/json-parser/, dev-libs/json-parser/files/
@ 2025-05-08 11:41 Petr Vaněk
0 siblings, 0 replies; 2+ messages in thread
From: Petr Vaněk @ 2025-05-08 11:41 UTC (permalink / raw
To: gentoo-commits
commit: fb89b4e2acc3c63b7b118c168dd5d779b60f7a72
Author: Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Tue May 6 09:00:00 2025 +0000
Commit: Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Thu May 8 11:40:38 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb89b4e2
dev-libs/json-parser: fix bug 954840 and 955499
Closes: https://bugs.gentoo.org/954840
Closes: https://bugs.gentoo.org/955499
Signed-off-by: Huang Rui <vowstar <AT> gmail.com>
Upstream-PR: https://github.com/json-parser/json-parser/pull/182
Closes: https://github.com/gentoo/gentoo/pull/41956
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>
.../json-parser-1.1.0-fix-suspicious-version.patch | 31 +++++++++++++++++
.../files/json-parser-1.1.0-python3-pylong.patch | 40 ++++++++++++++++++++++
.../json-parser/json-parser-1.1.0_p20211208.ebuild | 10 ++++--
3 files changed, 78 insertions(+), 3 deletions(-)
diff --git a/dev-libs/json-parser/files/json-parser-1.1.0-fix-suspicious-version.patch b/dev-libs/json-parser/files/json-parser-1.1.0-fix-suspicious-version.patch
new file mode 100644
index 000000000000..9c65ebe66f61
--- /dev/null
+++ b/dev-libs/json-parser/files/json-parser-1.1.0-fix-suspicious-version.patch
@@ -0,0 +1,31 @@
+From f9b99a73ca108e4073b4fe501a3426dd4e21bba6 Mon Sep 17 00:00:00 2001
+From: Huang Rui <vowstar@gmail.com>
+Date: Tue, 6 May 2025 16:38:59 +0800
+Subject: [PATCH] build(python): Update package name and add version in
+ setup.py
+
+- Change package name to use hyphens instead of spaces
+- Add version 1.1.0 to setup configuration
+
+Signed-off-by: Huang Rui <vowstar@gmail.com>
+---
+ bindings/python/setup.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bindings/python/setup.py b/bindings/python/setup.py
+index 57be7d584d5a..cac13595eec9 100644
+--- a/bindings/python/setup.py
++++ b/bindings/python/setup.py
+@@ -8,7 +8,8 @@ ext_modules.append(Extension('jsonparser',
+
+
+ setup(
+- name = 'json-parser python wrapper',
++ name = 'json-parser-python-wrapper',
++ version = '1.1.0',
+ cmdclass = {'build_ext': build_ext},
+ ext_modules = ext_modules
+ )
+--
+2.49.0
+
diff --git a/dev-libs/json-parser/files/json-parser-1.1.0-python3-pylong.patch b/dev-libs/json-parser/files/json-parser-1.1.0-python3-pylong.patch
new file mode 100644
index 000000000000..858afa485a69
--- /dev/null
+++ b/dev-libs/json-parser/files/json-parser-1.1.0-python3-pylong.patch
@@ -0,0 +1,40 @@
+From 5bd7dc824bcffd867edef7ef80cc896c8c51ce38 Mon Sep 17 00:00:00 2001
+From: Huang Rui <vowstar@gmail.com>
+Date: Tue, 6 May 2025 16:17:53 +0800
+Subject: [PATCH] fix(python): Add Python 3 compatibility macros for PyInt
+ functions
+
+- Add PY_MAJOR_VERSION check to define PyInt_* macros for Python 3
+- Replace deprecated PyInt functions with PyLong equivalents in Python 3
+
+Signed-off-by: Huang Rui <vowstar@gmail.com>
+---
+ bindings/python/wrap_json.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bindings/python/wrap_json.c b/bindings/python/wrap_json.c
+index bd0360512fd3..1d42a82aad77 100644
+--- a/bindings/python/wrap_json.c
++++ b/bindings/python/wrap_json.c
+@@ -27,6 +27,18 @@
+
+ #include "../../json.c"
+
++#include <Python.h>
++
++#if PY_MAJOR_VERSION >= 3
++ /* Define PyInt_* only for Python 3, where they no longer exist */
++ #ifndef PyInt_FromLong
++ #define PyInt_FromLong PyLong_FromLong
++ #endif
++ #ifndef PyInt_AsLong
++ #define PyInt_AsLong PyLong_AsLong
++ #endif
++#endif
++
+ PyObject * json_exception = PyErr_NewException("jsonparser.JSONException",
+ NULL, NULL);
+
+--
+2.49.0
+
diff --git a/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild b/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
index 184acdce391c..f5f622296c05 100644
--- a/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
+++ b/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2024 Gentoo Authors
+# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -6,7 +6,7 @@ EAPI=8
DISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..13} )
+PYTHON_COMPAT=( python3_{11..13} )
inherit distutils-r1 edo toolchain-funcs
@@ -35,7 +35,11 @@ BDEPEND="
)
"
-PATCHES=( "${FILESDIR}/${PN}-1.1.0-pkgconfig-libdir.patch" )
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.0-pkgconfig-libdir.patch"
+ "${FILESDIR}/${PN}-1.1.0-python3-pylong.patch"
+ "${FILESDIR}/${PN}-1.1.0-fix-suspicious-version.patch"
+)
wrap_python() {
local phase=$1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-08 11:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-18 7:06 [gentoo-commits] repo/gentoo:master commit in: dev-libs/json-parser/, dev-libs/json-parser/files/ Joonas Niilola
-- strict thread matches above, loose matches on Subject: below --
2025-05-08 11:41 Petr Vaněk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox