summaryrefslogtreecommitdiff
path: root/dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
diff options
context:
space:
mode:
authorPetr Vaněk <arkamar@atlas.cz>2022-07-29 13:54:22 +0200
committerJoonas Niilola <juippis@gentoo.org>2022-08-18 10:06:18 +0300
commit3d84addb0089529e1b6ef37cb19db59eb63a02cf (patch)
tree8e631dcc8b95b731b2b087a0897a2e30f86e3ef5 /dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild
parentc2b7dd2966a0ffa122db92865ed4b9962f4627a7 (diff)
downloadgentoo-3d84addb0089529e1b6ef37cb19db59eb63a02cf.tar.gz
gentoo-3d84addb0089529e1b6ef37cb19db59eb63a02cf.tar.bz2
gentoo-3d84addb0089529e1b6ef37cb19db59eb63a02cf.zip
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@atlas.cz> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild')
-rw-r--r--dev-libs/json-parser/json-parser-1.1.0_p20211208.ebuild82
1 files changed, 82 insertions, 0 deletions
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}
+}