pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang/mujs Add lang/mujs.
details: https://anonhg.NetBSD.org/pkgsrc/rev/a5b0869f52c0
branches: trunk
changeset: 384276:a5b0869f52c0
user: nia <nia%pkgsrc.org@localhost>
date: Tue Aug 30 12:47:02 2022 +0000
description:
Add lang/mujs.
MuJS is a lightweight Javascript interpreter designed for embedding in other
software to extend them with scripting capabilities.
MuJS was designed with a focus on small size, correctness, and simplicity.
It is written in portable C and implements ECMAScript as specified by
ECMA-262. The interface for binding with native code is designed to be as
simple as possible to use, and is very similar to Lua.
diffstat:
lang/mujs/DESCR | 8 ++
lang/mujs/Makefile | 26 +++++++++
lang/mujs/PLIST | 5 +
lang/mujs/buildlink3.mk | 12 ++++
lang/mujs/distinfo | 6 ++
lang/mujs/patches/patch-Makefile | 109 +++++++++++++++++++++++++++++++++++++++
6 files changed, 166 insertions(+), 0 deletions(-)
diffs (190 lines):
diff -r 947e6e214808 -r a5b0869f52c0 lang/mujs/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/mujs/DESCR Tue Aug 30 12:47:02 2022 +0000
@@ -0,0 +1,8 @@
+MuJS is a lightweight Javascript interpreter designed for embedding in other
+software to extend them with scripting capabilities.
+
+MuJS was designed with a focus on small size, correctness, and simplicity.
+
+It is written in portable C and implements ECMAScript as specified by
+ECMA-262. The interface for binding with native code is designed to be as
+simple as possible to use, and is very similar to Lua.
diff -r 947e6e214808 -r a5b0869f52c0 lang/mujs/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/mujs/Makefile Tue Aug 30 12:47:02 2022 +0000
@@ -0,0 +1,26 @@
+# $NetBSD: Makefile,v 1.1 2022/08/30 12:47:02 nia Exp $
+
+DISTNAME= mujs-1.2.0
+CATEGORIES= lang
+MASTER_SITES= https://mujs.com/downloads/
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://mujs.com/
+COMMENT= Lightweight embedded JavaScript interpreter
+LICENSE= isc
+
+USE_TOOLS+= gmake
+USE_LIBTOOL= yes
+
+MAKE_FLAGS+= prefix=${PREFIX}
+MAKE_FLAGS+= VERSION=${PKGVERSION_NOREV}
+MAKE_FLAGS+= HAVE_READLINE=yes
+
+BUILD_TARGET= shell shared build/release/mujs.pc
+INSTALL_TARGET= install-common install-shared
+
+PKGCONFIG_OVERRIDE_STAGE= pre-install
+PKGCONFIG_OVERRIDE+= build/release/mujs.pc
+
+.include "../../mk/readline.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 947e6e214808 -r a5b0869f52c0 lang/mujs/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/mujs/PLIST Tue Aug 30 12:47:02 2022 +0000
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1 2022/08/30 12:47:02 nia Exp $
+bin/mujs
+include/mujs.h
+lib/libmujs.la
+lib/pkgconfig/mujs.pc
diff -r 947e6e214808 -r a5b0869f52c0 lang/mujs/buildlink3.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/mujs/buildlink3.mk Tue Aug 30 12:47:02 2022 +0000
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1 2022/08/30 12:47:02 nia Exp $
+
+BUILDLINK_TREE+= mujs
+
+.if !defined(MUJS_BUILDLINK3_MK)
+MUJS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.mujs+= mujs>=1.2.0
+BUILDLINK_PKGSRCDIR.mujs?= ../../lang/mujs
+.endif # MUJS_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -mujs
diff -r 947e6e214808 -r a5b0869f52c0 lang/mujs/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/mujs/distinfo Tue Aug 30 12:47:02 2022 +0000
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2022/08/30 12:47:02 nia Exp $
+
+BLAKE2s (mujs-1.2.0.tar.gz) = abd284487d09a21a5c4c8ca48fac6710d294797bab8102dd7b43636493ea663d
+SHA512 (mujs-1.2.0.tar.gz) = dcde632f3be934653b7604a04c282fb71371cb416a13c186541d4fa6de8483091ddb77f06db1cd3b8c382f644f8c8ec83310611c5433aea3fcfba477ce9daf57
+Size (mujs-1.2.0.tar.gz) = 126792 bytes
+SHA1 (patch-Makefile) = 245ee1e81b180c0a692c63271aa4e8dbd1cd5e9d
diff -r 947e6e214808 -r a5b0869f52c0 lang/mujs/patches/patch-Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/mujs/patches/patch-Makefile Tue Aug 30 12:47:02 2022 +0000
@@ -0,0 +1,109 @@
+$NetBSD: patch-Makefile,v 1.1 2022/08/30 12:47:02 nia Exp $
+
+- Don't invoke git.
+- Honor user's CFLAGS/LDFLAGS.
+- libtoolize shared object creation.
+- The PHONY target is removed to allow PKGCONFIG_OVERRIDE to work.
+
+--- Makefile.orig 2021-12-08 11:56:12.000000000 +0000
++++ Makefile
+@@ -9,21 +9,11 @@ bindir ?= $(prefix)/bin
+ incdir ?= $(prefix)/include
+ libdir ?= $(prefix)/lib
+
+-ifeq "$(wildcard .git)" ".git"
+- VERSION := $(shell git describe --tags --always)
+-else
+- VERSION := $(shell basename $$PWD | sed -e s,^mujs-,,)
+-endif
+-
+-ifeq ($(shell uname),Darwin)
+- SO_EXT := dylib
+-else
+- SO_EXT := so
+-endif
++SO_EXT := la
+
+ # Compiler flags for various configurations:
+
+-CFLAGS := -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
++CFLAGS += -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
+
+ ifeq "$(CC)" "clang"
+ CFLAGS += -Wunreachable-code
+@@ -33,16 +23,6 @@ ifeq "$(shell uname)" "Linux"
+ HAVE_READLINE := yes
+ endif
+
+-ifeq "$(build)" "debug"
+- CFLAGS += -g
+-else ifeq "$(build)" "sanitize"
+- CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
+- LDFLAGS += -fsanitize=address
+-else ifeq "$(build)" "release"
+- CFLAGS += -O2
+- LDFLAGS += -Wl,-s
+-endif
+-
+ ifeq "$(HAVE_READLINE)" "yes"
+ CFLAGS += -DHAVE_READLINE
+ LIBREADLINE += -lreadline
+@@ -74,31 +54,30 @@ one.c: $(SRCS)
+
+ jsdump.c: astnames.h opnames.h
+
+-$(OUT)/%.o: %.c $(HDRS)
++$(OUT)/%.lo: %.c $(HDRS)
+ @ mkdir -p $(dir $@)
+- $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
++ $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
+
+-$(OUT)/libmujs.o: one.c $(HDRS)
++$(OUT)/libmujs.lo: one.c $(HDRS)
+ @ mkdir -p $(dir $@)
+- $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
++ $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
+
+-$(OUT)/libmujs.a: $(OUT)/libmujs.o
++$(OUT)/libmujs.a: $(OUT)/libmujs.lo
+ @ mkdir -p $(dir $@)
+ $(AR) cr $@ $^
+
+-$(OUT)/libmujs.$(SO_EXT): one.c $(HDRS)
++$(OUT)/libmujs.$(SO_EXT): $(OUT)/libmujs.lo $(HDRS)
+ @ mkdir -p $(dir $@)
+- $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -shared $(LDFLAGS) -o $@ $< -lm
++ $(LIBTOOL) --quiet --tag=CC --mode=link $(CC) $(LDFLAGS) -rpath $(PREFIX)/lib -o $@ $< -lm
+
+-$(OUT)/mujs: $(OUT)/libmujs.o $(OUT)/main.o
++$(OUT)/mujs: $(OUT)/libmujs.lo $(OUT)/main.lo
+ @ mkdir -p $(dir $@)
+- $(CC) $(LDFLAGS) -o $@ $^ $(LIBREADLINE) -lm
++ $(LIBTOOL) --quiet --tag=CC --mode=link $(CC) $(LDFLAGS) -o $@ $^ $(LIBREADLINE) -lm
+
+-$(OUT)/mujs-pp: $(OUT)/libmujs.o $(OUT)/pp.o
++$(OUT)/mujs-pp: $(OUT)/libmujs.lo $(OUT)/pp.lo
+ @ mkdir -p $(dir $@)
+- $(CC) $(LDFLAGS) -o $@ $^ -lm
++ $(LIBTOOL) --quiet --tag=CC --mode=link $(CC) $(LDFLAGS) -o $@ $^ -lm
+
+-.PHONY: $(OUT)/mujs.pc
+ $(OUT)/mujs.pc:
+ @ echo Creating $@
+ @ echo > $@ Name: mujs
+@@ -118,13 +97,13 @@ install-common: $(OUT)/mujs $(OUT)/mujs.
+ install -d $(DESTDIR)$(bindir)
+ install -m 644 mujs.h $(DESTDIR)$(incdir)
+ install -m 644 $(OUT)/mujs.pc $(DESTDIR)$(libdir)/pkgconfig
+- install -m 755 $(OUT)/mujs $(DESTDIR)$(bindir)
++ $(LIBTOOL) --quiet --tag=CC --mode=install install -m 755 $(OUT)/mujs $(DESTDIR)$(bindir)
+
+ install-static: install-common $(OUT)/libmujs.a
+ install -m 644 $(OUT)/libmujs.a $(DESTDIR)$(libdir)
+
+ install-shared: install-common $(OUT)/libmujs.$(SO_EXT)
+- install -m 755 $(OUT)/libmujs.$(SO_EXT) $(DESTDIR)$(libdir)
++ $(LIBTOOL) --quiet --tag=CC --mode=install install -m 755 $(OUT)/libmujs.$(SO_EXT) $(DESTDIR)$(libdir)
+
+ install: install-static
+
Home |
Main Index |
Thread Index |
Old Index