commit:     8ea97a1b251d569402786ae981c882881c55ccdb
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Sun Sep 28 13:26:49 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct  3 00:43:27 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ea97a1b

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 <AT> 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 <AT> gentoo.org>

 dev-lang/mujs/Manifest          |  3 ++
 dev-lang/mujs/mujs-1.3.7.ebuild | 76 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/dev-lang/mujs/Manifest b/dev-lang/mujs/Manifest
index 1d19b22c9d03..0a603c2508e7 100644
--- a/dev-lang/mujs/Manifest
+++ b/dev-lang/mujs/Manifest
@@ -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

diff --git a/dev-lang/mujs/mujs-1.3.7.ebuild b/dev-lang/mujs/mujs-1.3.7.ebuild
new file mode 100644
index 000000000000..3f29d880e9d6
--- /dev/null
+++ b/dev-lang/mujs/mujs-1.3.7.ebuild
@@ -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})"
+}

Reply via email to