pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/mujs



Module Name:    pkgsrc
Committed By:   nia
Date:           Tue Aug 30 12:47:02 UTC 2022

Added Files:
        pkgsrc/lang/mujs: DESCR Makefile PLIST buildlink3.mk distinfo
        pkgsrc/lang/mujs/patches: patch-Makefile

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/mujs/DESCR pkgsrc/lang/mujs/Makefile \
    pkgsrc/lang/mujs/PLIST pkgsrc/lang/mujs/buildlink3.mk \
    pkgsrc/lang/mujs/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/mujs/patches/patch-Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/lang/mujs/DESCR
diff -u /dev/null pkgsrc/lang/mujs/DESCR:1.1
--- /dev/null   Tue Aug 30 12:47:02 2022
+++ pkgsrc/lang/mujs/DESCR      Tue Aug 30 12:47:02 2022
@@ -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.
Index: pkgsrc/lang/mujs/Makefile
diff -u /dev/null pkgsrc/lang/mujs/Makefile:1.1
--- /dev/null   Tue Aug 30 12:47:02 2022
+++ pkgsrc/lang/mujs/Makefile   Tue Aug 30 12:47:02 2022
@@ -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"
Index: pkgsrc/lang/mujs/PLIST
diff -u /dev/null pkgsrc/lang/mujs/PLIST:1.1
--- /dev/null   Tue Aug 30 12:47:02 2022
+++ pkgsrc/lang/mujs/PLIST      Tue Aug 30 12:47:02 2022
@@ -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
Index: pkgsrc/lang/mujs/buildlink3.mk
diff -u /dev/null pkgsrc/lang/mujs/buildlink3.mk:1.1
--- /dev/null   Tue Aug 30 12:47:02 2022
+++ pkgsrc/lang/mujs/buildlink3.mk      Tue Aug 30 12:47:02 2022
@@ -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
Index: pkgsrc/lang/mujs/distinfo
diff -u /dev/null pkgsrc/lang/mujs/distinfo:1.1
--- /dev/null   Tue Aug 30 12:47:02 2022
+++ pkgsrc/lang/mujs/distinfo   Tue Aug 30 12:47:02 2022
@@ -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

Index: pkgsrc/lang/mujs/patches/patch-Makefile
diff -u /dev/null pkgsrc/lang/mujs/patches/patch-Makefile:1.1
--- /dev/null   Tue Aug 30 12:47:02 2022
+++ pkgsrc/lang/mujs/patches/patch-Makefile     Tue Aug 30 12:47:02 2022
@@ -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