summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Rösner <rndxelement@protonmail.com>2023-03-29 21:47:43 +0200
committerJoonas Niilola <juippis@gentoo.org>2023-04-13 09:01:08 +0300
commit0e28ca50b4cc77ef97f975befb918a59c44d1396 (patch)
tree3d95da92180a5ac3653bfca04a56b5008ca3b945 /dev-lang/mujs
parentdev-util/librnp: add 0.16.3 (diff)
downloadgentoo-0e28ca50b4cc77ef97f975befb918a59c44d1396.tar.gz
gentoo-0e28ca50b4cc77ef97f975befb918a59c44d1396.tar.bz2
gentoo-0e28ca50b4cc77ef97f975befb918a59c44d1396.zip
dev-lang/mujs: add 1.3.3
Upstream changes to Makefile at f190f88 and 57e3f01. XCPPFLAGS aren't used in the Makefile anymore. No API changes in /usr/include/mujs.h. Signed-off-by: Philipp Rösner <rndxelement@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/30402 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-lang/mujs')
-rw-r--r--dev-lang/mujs/Manifest1
-rw-r--r--dev-lang/mujs/files/mujs-1.3.3-flags.patch12
-rw-r--r--dev-lang/mujs/mujs-1.3.3.ebuild61
3 files changed, 74 insertions, 0 deletions
diff --git a/dev-lang/mujs/Manifest b/dev-lang/mujs/Manifest
index 84a86105d508..6120ebca2ad6 100644
--- a/dev-lang/mujs/Manifest
+++ b/dev-lang/mujs/Manifest
@@ -1 +1,2 @@
DIST mujs-1.3.2.tar.gz 127899 BLAKE2B 4de5e1e60c5d6af9a20d8bb1fe2612d6c90a6b5557a66524bf81747e893a89a88b4da7e5393325923c6eb0788679da4013f25032cad23e547f15a1d49cf0a738 SHA512 ccffb04171f7ecec2cfa6f0e59859acc911836370a648e4c6703db174631ce316413a64ebf4b32eea3d3b09221ff01861cda91f4b1b9bebf495168f26f90daf5
+DIST mujs-1.3.3.tar.gz 128097 BLAKE2B 9b880dc462af8945e647994f9a42cf121461c6b295538db6cef818919a7c2418ebe1df7d36f69214279ad2414d0ce7149a541a3533e766274624b9c44b733db9 SHA512 74288484185473a813c55e08dcc2fefba46f87651d3a1fcea6ac843bb09a4150e13e0d46b348a34380a0defdeaa388cc93b6f7f569a7886091a34b4951b9461b
diff --git a/dev-lang/mujs/files/mujs-1.3.3-flags.patch b/dev-lang/mujs/files/mujs-1.3.3-flags.patch
new file mode 100644
index 000000000000..90709863015f
--- /dev/null
+++ b/dev-lang/mujs/files/mujs-1.3.3-flags.patch
@@ -0,0 +1,12 @@
+diff --git a/Makefile.oirg b/Makefile
+index 24049d3..5d5d58d 100644
+--- a/Makefile.oirg
++++ b/Makefile
+@@ -5,6 +5,7 @@
+ default: build/debug/mujs build/debug/mujs-pp
+
+ CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
++CFLAGS += $(XCFLAGS) $(XLDFLAGS)
+
+ OPTIM = -O3
+
diff --git a/dev-lang/mujs/mujs-1.3.3.ebuild b/dev-lang/mujs/mujs-1.3.3.ebuild
new file mode 100644
index 000000000000..6c8aa130e526
--- /dev/null
+++ b/dev-lang/mujs/mujs-1.3.3.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2023 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://github.com/ccxvii/mujs"
+SRC_URI="https://mujs.com/downloads/${P}.tar.gz"
+
+LICENSE="ISC"
+# The subslot matches the SONAME
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos"
+
+RDEPEND="sys-libs/readline:="
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-flags.patch
+)
+
+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=/usr \
+ release
+}
+
+src_install() {
+ emake \
+ DESTDIR="${ED}" \
+ VERSION=${PV} \
+ libdir="/usr/$(get_libdir)" \
+ prefix=/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}) /usr/$(get_libdir)/lib${PN}$(get_libname)
+ dosym lib${PN}$(get_libname ${PV}) /usr/$(get_libdir)/lib${PN}$(get_libname ${PV:0:1})
+}