dev-lang/mujs: add 1.3.7

- Use ${EPREFIX} when appropriate to make ebuild
  viable for custom prefixes
- Makefile tries to download certain files through curl,
  therefore add these files to SRC_URI to prevent breaking
  network-sandbox feature

Signed-off-by: Philipp Rösner <rndxelement@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43972
Closes: https://github.com/gentoo/gentoo/pull/43972
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Philipp Rösner
2025-09-28 15:26:49 +02:00
committed by Sam James
parent 0a03f757b7
commit 8ea97a1b25
2 changed files with 79 additions and 0 deletions

View File

@@ -1 +1,4 @@
DIST mujs-1.3.6.tar.gz 129253 BLAKE2B f4567823481be4c4a6f0e7dd21543031392b3ab9f2b115401070228b0f44e09de5aa0199a907a38aaa2da4502e68412b47d83ac16f8eb1a28830fc9f0372b19c SHA512 63df9155182a2744860a92603c492f744efd30170b0d60b860dfd75c10190123b07c04626ce2e38af9febe4b5982f09ed04ca3dd59a4b99ccb9a0e179b13acc6
DIST mujs-1.3.7-SpecialCasing.txt 16809 BLAKE2B 0d6d359d4ab416d1a96318c7059566df36c0c948b6307b74fba708ca3cd553698e99a68041dc96389064ff8ab46eb489e61aee4f97dacf2ae147a4fee6972166 SHA512 1befbe562f2a68d53168b3ef849f7c2b0f692b4d0c6de5996fc66407fbb91a0415abc6f57c26474a58a90def5fab58bc124de7b36e8ec1521e83527aab33bbf1
DIST mujs-1.3.7-UnicodeData.txt 2175362 BLAKE2B b3decd8cb8d3aa8a31789904e92e10291ad03d33363cd29a4d20f63fbaa8806013cf441eec314eac5c089042b2fd9d955ae282fbf4df7c17e0dd938cc542d66d SHA512 963e5a1e7a480873c6e66d53e9288232b5029942477a694a0bfafa7e994c55189cb9c2f8d00255de84b82b72ff6066932e5531e3664fb422eeef9c69ea25d80e
DIST mujs-1.3.7.tar.gz 130597 BLAKE2B 075213192d70cb67c2735c503f34ea789dce2f34a169b04c50db94bd2603a15f6a0dd41f69ac8a6f8ebdf4af947371824863277bb2adc1304ea657ffbdf00669 SHA512 e89a273173f7620247718687cc26f7541478972b3ac35f02ff6f72ff1ab6edbb24caeaad55eb431fad8bc39e2c5884a64197c64b69ee2596ab826670202eba2b

View File

@@ -0,0 +1,76 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multilib toolchain-funcs
DESCRIPTION="An embeddable JavaScript interpreter written in C"
HOMEPAGE="https://mujs.com/ https://codeberg.org/ccxvii/mujs"
SRC_URI="
https://mujs.com/downloads/${P}.tar.gz
https://www.unicode.org/Public/16.0.0/ucd/UnicodeData.txt -> ${P}-UnicodeData.txt
https://www.unicode.org/Public/16.0.0/ucd/SpecialCasing.txt -> ${P}-SpecialCasing.txt
"
LICENSE="ISC"
# The subslot matches the SONAME
SLOT="0/${PV}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos"
RDEPEND="sys-libs/readline:="
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-1.3.3-flags.patch
)
src_unpack() {
default
# Copy these files to ${S} because otherwise the Makefile would
# try to download them via curl, breaking the network-sandbox portage feature
cp "${DISTDIR}/${P}-UnicodeData.txt" "${S}/UnicodeData.txt" || die "Failed moving UnicodeData.txt"
cp "${DISTDIR}/${P}-SpecialCasing.txt" "${S}/SpecialCasing.txt" || die "Failed moving SpecialCasing.txt"
}
src_prepare() {
default
tc-export AR CC
append-cflags -fPIC
# The library's ABI (and API) might change in new releases
# Diff 'usr/include/mujs.h' across releases to validate
if [[ ${CHOST} == *-darwin* ]] ; then
append-cflags -Wl,-install_name,"${EPREFIX}"/usr/$(get_libdir)/lib${PN}.${PV}.dylib
else
append-cflags -Wl,-soname=lib${PN}.so.${PV}
fi
}
src_compile() {
# We need to use ${PV} for the pkgconfig file, see: #784461
emake \
VERSION=${PV} \
XCFLAGS="${CFLAGS}" \
XLDFLAGS="${LDFLAGS}" \
prefix="${EPREFIX}/usr" \
release
}
src_install() {
emake \
DESTDIR="${ED}" \
VERSION=${PV} \
libdir="${EPREFIX}/usr/$(get_libdir)" \
prefix="${EPREFIX}/usr" \
install-shared
mv -v "${ED}"/usr/$(get_libdir)/lib${PN}$(get_libname) \
"${ED}"/usr/$(get_libdir)/lib${PN}$(get_libname ${PV}) \
|| die "Failed adding version suffix to mujs shared library"
dosym lib${PN}$(get_libname ${PV}) "${EPREFIX}/usr/$(get_libdir)/lib${PN}$(get_libname)"
dosym lib${PN}$(get_libname ${PV}) "${EPREFIX}/usr/$(get_libdir)/lib${PN}$(get_libname ${PV:0:1})"
}