diff options
Diffstat (limited to 'dev-lua/lua-cjson')
| -rw-r--r-- | dev-lua/lua-cjson/Manifest | 1 | ||||
| -rw-r--r-- | dev-lua/lua-cjson/lua-cjson-2.1.0.10-r1.ebuild | 94 | ||||
| -rw-r--r-- | dev-lua/lua-cjson/metadata.xml | 16 |
3 files changed, 111 insertions, 0 deletions
diff --git a/dev-lua/lua-cjson/Manifest b/dev-lua/lua-cjson/Manifest new file mode 100644 index 000000000000..d07c1321b4b4 --- /dev/null +++ b/dev-lua/lua-cjson/Manifest @@ -0,0 +1 @@ +DIST lua-cjson-2.1.0.10.tar.gz 78651 BLAKE2B c215f0a78ba306831a9aa147df9edcb693164a82a0b0505265425124adb40c918da826d128c2dcd048e2c3040d191e177c78b143abb28608b38b3c2b21760539 SHA512 889761b6381b2d10b7aa2e5687e5059705352c0f7fbbca9bc5f7c9d89aed8b1e283c18e217183042cc6f1ec4f19d1c4cf720e3efc6f5a06e81aa1bec8a6b93c4 diff --git a/dev-lua/lua-cjson/lua-cjson-2.1.0.10-r1.ebuild b/dev-lua/lua-cjson/lua-cjson-2.1.0.10-r1.ebuild new file mode 100644 index 000000000000..7e9a67c848cd --- /dev/null +++ b/dev-lua/lua-cjson/lua-cjson-2.1.0.10-r1.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1,3,4} luajit ) + +inherit lua toolchain-funcs + +DESCRIPTION="A fast JSON encoding/parsing module for Lua" +HOMEPAGE="https://www.kyne.com.au/~mark/software/lua-cjson.php https://github.com/openresty/lua-cjson" +SRC_URI="https://github.com/openresty/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="+internal-fpconv test +threads" +REQUIRED_USE=" + threads? ( internal-fpconv ) + ${LUA_REQUIRED_USE} +" +RESTRICT="!test? ( test )" + +RDEPEND="${LUA_DEPS}" +DEPEND="${RDEPEND}" +BDEPEND="test? ( dev-lang/perl )" + +DOCS=( "manual.txt" "NEWS" "performance.txt" "README.md" "THANKS" ) + +src_prepare() { + default + + # Don't install tests + sed -e '/cd tests/d' -i Makefile || die + + lua_copy_sources +} + +lua_src_compile() { + pushd "${BUILD_DIR}" || die + + local myemakeargs=( + "CC=$(tc-getCC)" + "CFLAGS=${CFLAGS}" + "LDFLAGS=${LDFLAGS}" + "LUA_INCLUDE_DIR=$(lua_get_include_dir)" + ) + + emake "${myemakeargs[@]}" + + popd +} + +src_compile() { + lua_foreach_impl lua_src_compile +} + +lua_src_test() { + pushd "${BUILD_DIR}" || die + cd tests || die + + ln -s "${BUILD_DIR}"/cjson.so ./ || die + ln -s "${S}"/lua/cjson ./ || die + + ./genutf8.pl || die + ./test.lua || die + + popd +} + +src_test() { + lua_foreach_impl lua_src_test +} + +lua_src_install() { + pushd "${BUILD_DIR}" || die + + local myemakeargs=( + "DESTDIR=${D}" + "LUA_CMODULE_DIR=$(lua_get_cmod_dir)" + "LUA_MODULE_DIR=$(lua_get_lmod_dir)" + "PREFIX=${EPREFIX}/usr" + ) + + emake "${myemakeargs[@]}" install install-extra + + popd +} + +src_install() { + lua_foreach_impl lua_src_install + + einstalldocs +} diff --git a/dev-lua/lua-cjson/metadata.xml b/dev-lua/lua-cjson/metadata.xml new file mode 100644 index 000000000000..d62c61b3318d --- /dev/null +++ b/dev-lua/lua-cjson/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>conikost@gentoo.org</email> + <name>Conrad Kostecki</name> + </maintainer> + <longdescription> + OpenResty fork of mpx/lua-cjson, includes a few bugfixes and improvements, + especially to facilitate the encoding of empty tables as JSON Arrays. + </longdescription> + <use> + <flag name="internal-fpconv">Enable internal number conversion routines, can increase overall performance by up to 50%</flag> + </use> + <origin>baldeagleos-repo</origin> +</pkgmetadata> |
