From 71ff86d1b6b3e2fd459ddf48e5cafd0b94a21970 Mon Sep 17 00:00:00 2001 From: Zurab Kvachadze Date: Fri, 31 Oct 2025 20:03:12 +0100 Subject: [PATCH] dev-libs/quickjs-ng: new package, add 0.11.0 A small and embeddable JavaScript engine. Out two existing build systems in the project, CMake and meson, I opted to use meson, because that has better supports for tests. quickjs-ng is also a dependency of www-nginx/njs. Signed-off-by: Zurab Kvachadze Part-of: https://github.com/gentoo/gentoo/pull/44669 Signed-off-by: Sam James --- dev-libs/quickjs-ng/Manifest | 1 + dev-libs/quickjs-ng/metadata.xml | 23 ++++++++++ dev-libs/quickjs-ng/quickjs-ng-0.11.0.ebuild | 46 ++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 dev-libs/quickjs-ng/Manifest create mode 100644 dev-libs/quickjs-ng/metadata.xml create mode 100644 dev-libs/quickjs-ng/quickjs-ng-0.11.0.ebuild diff --git a/dev-libs/quickjs-ng/Manifest b/dev-libs/quickjs-ng/Manifest new file mode 100644 index 0000000000000..5b35e8af074a9 --- /dev/null +++ b/dev-libs/quickjs-ng/Manifest @@ -0,0 +1 @@ +DIST quickjs-ng-0.11.0.tar.gz 784539 BLAKE2B da4151ddb0000d17196a4cdc495e1cf7a4d4d82aa8e8447e66afa2ae1e8985fb262554336263f1e7c5fe6b4db5e35a3ba4f26c4e8f32d517253b030ca2f717c0 SHA512 c8b1920bab954f5fa891956f330875478e5b17161d24f8b96db05108d61354dab0621f2a36c5ae421ffbfb9817d90c7a62fe1bd4f84ad149dd2d569c356a2788 diff --git a/dev-libs/quickjs-ng/metadata.xml b/dev-libs/quickjs-ng/metadata.xml new file mode 100644 index 0000000000000..823636bbc4bbe --- /dev/null +++ b/dev-libs/quickjs-ng/metadata.xml @@ -0,0 +1,23 @@ + + + + + zurabid2016@gmail.com + Zurab Kvachadze + + + proxy-maint@gentoo.org + Proxy Maintainers + + + QuickJS is a small and embeddable JavaScript engine. It aims to support the latest + ECMAScript specification. + + QuickJS-ng is a fork of the original QuickJS project by Fabrice Bellard and Charlie + Gordon, after it went dormant, with the intent of reigniting its development. + + + https://github.com/quickjs-ng/quickjs/issues + quickjs-ng/quickjs + + diff --git a/dev-libs/quickjs-ng/quickjs-ng-0.11.0.ebuild b/dev-libs/quickjs-ng/quickjs-ng-0.11.0.ebuild new file mode 100644 index 0000000000000..2bc9fbe28b78a --- /dev/null +++ b/dev-libs/quickjs-ng/quickjs-ng-0.11.0.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson + +DESCRIPTION="QuickJS, the Next Generation: a mighty JavaScript engine" +HOMEPAGE="https://github.com/quickjs-ng/quickjs" +SRC_URI=" + https://github.com/quickjs-ng/quickjs/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz +" + +MY_PN="quickjs" +S="${WORKDIR}/${MY_PN}-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1)" +KEYWORDS="~amd64" + +IUSE="test" +RESTRICT="!test? ( test )" + +src_prepare() { + # meson.build is a bit behind: specifies version 0.10.1 when it should be + # 0.11.0. + sed -E -i "s/^\s*version: '.*'/version: '${PV}'/" meson.build || die "sed failed" + default +} + +src_configure() { + local emesonargs=( + -Ddefault_library=shared # default_library=static hardcoded. + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" + "$(meson_feature test tests)" + -Dlibc=true + -Dexamples=disabled + ) + meson_src_configure +} + +src_install() { + # Source code files under examples. + docompress -x "/usr/share/doc/${PF}/examples" + meson_src_install +}