Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/json-parser/, dev-libs/json-parser/files/
Date: Thu, 18 Aug 2022 07:06:33
Message-Id: 1660806378.3d84addb0089529e1b6ef37cb19db59eb63a02cf.juippis@gentoo
1 commit: 3d84addb0089529e1b6ef37cb19db59eb63a02cf
2 Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz>
3 AuthorDate: Fri Jul 29 11:54:22 2022 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 18 07:06:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d84addb
7
8 dev-libs/json-parser: new package, add 1.1.0_p20211208
9
10 Original version 1.1.0 is from a year 2014, which is quite old. The
11 snapshot is from latest commit 531a49062975 ("Add author of #154 to
12 AUTHORS") in master branch, which contains (among others) two fixes
13 related to strict aliasing. New release is anticipated [1], but it is
14 not clear when it will happen, as the ticket is open for 2 years
15 already.
16
17 It was necessary to apply one patch proposed as PR [2] to upstream,
18 which changes pkgconfig file installation path from datadir to libdir.
19
20 This library is currently known to be bundled in multiple packages in
21 ::gentoo, see the corresponding bugs bellow.
22
23 [1] https://github.com/json-parser/json-parser/issues/82
24 [2] https://github.com/json-parser/json-parser/pull/164
25
26 Bug: https://bugs.gentoo.org/858524
27 Bug: https://bugs.gentoo.org/861143
28 Bug: https://bugs.gentoo.org/861371
29 Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
30 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
31
32 dev-libs/json-parser/Manifest | 1 +
33 .../files/json-parser-1.1.0-pkgconfig-libdir.patch | 22 ++++++
34 .../json-parser/json-parser-1.1.0_p20211208.ebuild | 82 ++++++++++++++++++++++
35 dev-libs/json-parser/metadata.xml | 15 ++++
36 4 files changed, 120 insertions(+)
37
38 diff --git a/dev-libs/json-parser/Manifest b/dev-libs/json-parser/Manifest
39 new file mode 100644
40 index 000000000000..ac3d8c8c0ff7
41 --- /dev/null
42 +++ b/dev-libs/json-parser/Manifest
43 @@ -0,0 +1 @@
44 +DIST json-parser-1.1.0_p20211208.tar.gz 51479 BLAKE2B 31ce7929c1de829e312dfc855365d8851ad7c2ce31379d3ab4b4937291e2ec367c7692ecb11b781d0647e5dc38008e4e7bd122d9edaafd1c393a1cbf765117b9 SHA512 cbe6690a70ada1906b2c208fcbe03fe5a14651660ece9ba933a3160ea027c6dd9507189e1c63052059c3a00b2e2a59dbc65fa668a287455d438aa4453eecf22f
45
46 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
47 new file mode 100644
48 index 000000000000..094f8f985dec
49 --- /dev/null
50 +++ b/dev-libs/json-parser/files/json-parser-1.1.0-pkgconfig-libdir.patch
51 @@ -0,0 +1,22 @@
52 +Upstream-PR: https://github.com/json-parser/json-parser/pull/164
53 +
54 +diff --git a/Makefile.in b/Makefile.in
55 +index 8938230..b7539f7 100644
56 +--- a/Makefile.in
57 ++++ b/Makefile.in
58 +@@ -43,9 +43,9 @@ clean:
59 + rm -f libjsonparser.$(SO_EXT) libjsonparser.a json.o
60 +
61 + install-shared: libjsonparser.$(SO_EXT)
62 +- @echo Installing pkgconfig module: $(datadir)/pkgconfig/json-parser.pc
63 +- @install -d $(datadir)/pkgconfig/ || true
64 +- @install -m 0644 json-parser.pc $(datadir)/pkgconfig/json-parser.pc
65 ++ @echo Installing pkgconfig module: $(libdir)/pkgconfig/json-parser.pc
66 ++ @install -d $(libdir)/pkgconfig/ || true
67 ++ @install -m 0644 json-parser.pc $(libdir)/pkgconfig/json-parser.pc
68 + @echo Installing shared library: $(libdir)/libjsonparser.$(SO_EXT)
69 + @install -d $(libdir) || true
70 + @install -m 0755 libjsonparser.$(SO_EXT) $(libdir)/$(REAL_NAME)
71 +--
72 +2.35.1
73 +
74
75 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
76 new file mode 100644
77 index 000000000000..a551d83b795c
78 --- /dev/null
79 +++ b/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
80 @@ -0,0 +1,82 @@
81 +# Copyright 2022 Gentoo Authors
82 +# Distributed under the terms of the GNU General Public License v2
83 +
84 +EAPI=8
85 +
86 +DISTUTILS_USE_PEP517=setuptools
87 +DISTUTILS_OPTIONAL=1
88 +PYTHON_COMPAT=( python3_{9..11} )
89 +
90 +inherit distutils-r1 edo toolchain-funcs
91 +
92 +COMMIT="531a49062975d6d2cd5d69b75ad5481a8c0e18c5"
93 +
94 +DESCRIPTION="Very low footprint JSON parser written in portable ANSI C"
95 +HOMEPAGE="https://github.com/json-parser/json-parser"
96 +SRC_URI="https://github.com/json-parser/json-parser/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
97 +
98 +S="${WORKDIR}/${PN}-${COMMIT}"
99 +
100 +LICENSE="BSD-2"
101 +SLOT="0/$(ver_cut 1-2)"
102 +KEYWORDS="~amd64"
103 +IUSE="python"
104 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
105 +
106 +DEPEND=""
107 +RDEPEND="${DEPEND}
108 + python? ( ${PYTHON_DEPS} )
109 +"
110 +BDEPEND="
111 + python? (
112 + ${PYTHON_DEPS}
113 + ${DISTUTILS_DEPS}
114 + dev-python/cython[${PYTHON_USEDEP}]
115 + )
116 +"
117 +
118 +PATCHES=( "${FILESDIR}/${PN}-1.1.0-pkgconfig-libdir.patch" )
119 +
120 +wrap_python() {
121 + local phase=$1
122 + shift
123 +
124 + if use python; then
125 + pushd bindings/python || die
126 + distutils-r1_${phase} "${@}"
127 + popd
128 + fi
129 +}
130 +
131 +src_prepare() {
132 + default
133 + wrap_python ${FUNCNAME}
134 +}
135 +
136 +src_configure() {
137 + default
138 + wrap_python ${FUNCNAME}
139 +}
140 +
141 +src_compile() {
142 + default
143 + wrap_python ${FUNCNAME}
144 +}
145 +
146 +python_test() {
147 + "${EPYTHON}" test.py || die "Tests failed with ${EPYTHON}"
148 +}
149 +
150 +src_test() {
151 + edo $(tc-getCC) ${CFLAGS} -I. ${CPPFLAGS} ${LDFLAGS} -o tests/test tests/test.c json.o
152 + pushd tests > /dev/null || die
153 + edo ./test
154 + use python && distutils-r1_src_test
155 + popd
156 +}
157 +
158 +src_install() {
159 + emake DESTDIR="${D}" install-shared
160 + dodoc README.md AUTHORS
161 + wrap_python ${FUNCNAME}
162 +}
163
164 diff --git a/dev-libs/json-parser/metadata.xml b/dev-libs/json-parser/metadata.xml
165 new file mode 100644
166 index 000000000000..4580bd57e5b3
167 --- /dev/null
168 +++ b/dev-libs/json-parser/metadata.xml
169 @@ -0,0 +1,15 @@
170 +<?xml version="1.0" encoding="UTF-8"?>
171 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
172 +<pkgmetadata>
173 + <maintainer type="person" proxied="yes">
174 + <email>arkamar@×××××.cz</email>
175 + <name>Petr Vaněk</name>
176 + </maintainer>
177 + <maintainer type="project" proxied="proxy">
178 + <email>proxy-maint@g.o</email>
179 + <name>Proxy Maintainers</name>
180 + </maintainer>
181 + <upstream>
182 + <remote-id type="github">json-parser/json-parser</remote-id>
183 + </upstream>
184 +</pkgmetadata>