summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2023-10-18 17:13:28 -0400
committerSam James <sam@gentoo.org>2023-10-19 22:03:14 +0100
commitae0c81ea37d33d8d5ac629c212ec2ea57951862e (patch)
tree3a4e7b8a1ba7b5db01d9a383d18e28052f0aa603 /dev-lang/rapydscript-ng/rapydscript-ng-9999.ebuild
parentdev-libs/libclc: Add 18.0.0_pre20231019 snapshot (diff)
downloadgentoo-ae0c81ea37d33d8d5ac629c212ec2ea57951862e.tar.gz
gentoo-ae0c81ea37d33d8d5ac629c212ec2ea57951862e.tar.bz2
gentoo-ae0c81ea37d33d8d5ac629c212ec2ea57951862e.zip
dev-lang/rapydscript-ng: new package, add 0.7.22, 9999
build dependency of app-text/calibre, needed to rebuild javascript assets from source when unbundling dev-libs/mathjax-3. Because this is nodejs software, we must suffer. Upon advice, I have taken the route of making a live ebuild that not ::gentoo-quality, which is "acceptable" for a live ebuild even if maybe in an ideal world live ebuilds would not need this either. ;) The live ebuild can then be used to generate a release assets tarball that doesn't download totally random content from the internet in a stable release ebuild that wants to actually get keyworded. [sam: Update SRC_URI.] Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/33419 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/rapydscript-ng/rapydscript-ng-9999.ebuild')
-rw-r--r--dev-lang/rapydscript-ng/rapydscript-ng-9999.ebuild75
1 files changed, 75 insertions, 0 deletions
diff --git a/dev-lang/rapydscript-ng/rapydscript-ng-9999.ebuild b/dev-lang/rapydscript-ng/rapydscript-ng-9999.ebuild
new file mode 100644
index 000000000000..467e239b5828
--- /dev/null
+++ b/dev-lang/rapydscript-ng/rapydscript-ng-9999.ebuild
@@ -0,0 +1,75 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/kovidgoyal/rapydscript-ng"
+ # this is nodejs software, so possibly unfixable. I am sorry.
+ # Instead, we will have to generate this with the live ebuild and upload assets
+ # using EGIT_OVERRIDE_COMMIT for the tagged version we need.
+ BDEPEND="app-arch/libarchive"
+
+ inherit git-r3
+else
+ SRC_URI="
+ https://github.com/kovidgoyal/rapydscript-ng/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/rapydscript-ng-node_modules-${PV}.tar.xz
+ "
+ KEYWORDS="~amd64"
+fi
+
+inherit edo
+
+DESCRIPTION="Pythonic JavaScript that doesn't suck"
+HOMEPAGE="https://github.com/kovidgoyal/rapydscript-ng"
+
+LICENSE="BSD"
+SLOT="0"
+
+BDEPEND+=" net-libs/nodejs"
+RDEPEND="net-libs/nodejs"
+
+maint_pkg_create() {
+ cd "${S}" || die
+
+ edo npm install --omit=optional
+
+ local ver=$(git describe)
+ ver=${ver#v}
+ local tar="${T}/rapydscript-ng-node_modules-${ver}.tar.xz"
+
+ bsdtar -s "#\(.*\)#${PN}-node_modules-${ver}/~#S" -caf "${tar}" package-lock.json node_modules/ || die
+ einfo "Packaged tar now available:"
+ einfo "$(du -b "${tar}")"
+}
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ maint_pkg_create
+ else
+ unpack ${A}
+ cp -r "${WORKDIR}"/${PN}-node_modules-${PV}/{node_modules,package-lock.json} "${S}" || die
+ fi
+}
+
+src_compile() {
+ edo bin/rapydscript self --complete
+ rm -r release/ || die
+ mv dev/ release/ || die
+}
+
+src_test() {
+ edo bin/rapydscript test
+}
+
+src_install() {
+ local modulesdir=/usr/$(get_libdir)/node_modules/rapydscript-ng
+
+ insinto "${modulesdir}"
+ doins -r *
+
+ fperms +x "${modulesdir}"/bin/rapydscript
+ dosym -r "${modulesdir}"/bin/rapydscript /usr/bin/rapydscript
+}