Re: [new] lang/mujs
On 2024/04/23 22:09, Pascal Stumpf wrote: > On Tue, 23 Apr 2024 20:51:59 +0100, Stuart Henderson wrote: > > On 2024/04/23 21:10, Pascal Stumpf wrote: > > > 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. There is no need to interact with byzantine C++ > > > template mechanisms, or worry about marking and unmarking garbage > > > collection roots, or wrestle with obscure build systems. > > > > > > > > > Useful for js in an upcoming port of the new elinks codebase. > > > > > > textproc/mupdf,js needs a small fix to cope with an external libmujs. > > > > Any reason not to use the shared library? > > Not really, other than upstream apparently preferring the static one. That's normal for them :) If it's static, you'll need to bump any ports that depend on it after any update. > Updated tarball with shared library. OK > > --- Makefile.orig Tue Apr 23 18:49:24 2024 > > +++ MakefileTue Apr 23 20:51:10 2024 > > @@ -1,5 +1,7 @@ > > COMMENT = lightweight Javascript interpreter > > > > +SHARED_LIBS = mujs 0.0 > > + > > V =1.3.4 > > DISTNAME = mujs-$V > > > > @@ -16,12 +18,13 @@ WANTLIB += c m readline > > > > SITES =https://mujs.com/downloads/ > > > > -MAKE_FLAGS = OPTIM="${CFLAGS}" > > +MAKE_FLAGS = OPTIM="${CFLAGS}" SO="so.${LIBmujs_VERSION}" > > > > USE_GMAKE =Yes > > > > NO_TEST = Yes > > > > ALL_TARGET = release > > +INSTALL_TARGET = install-shared > > > > .include
Re: [new] lang/mujs
On Tue, 23 Apr 2024 20:51:59 +0100, Stuart Henderson wrote: > On 2024/04/23 21:10, Pascal Stumpf wrote: > > 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. There is no need to interact with byzantine C++ > > template mechanisms, or worry about marking and unmarking garbage > > collection roots, or wrestle with obscure build systems. > > > > > > Useful for js in an upcoming port of the new elinks codebase. > > > > textproc/mupdf,js needs a small fix to cope with an external libmujs. > > Any reason not to use the shared library? Not really, other than upstream apparently preferring the static one. Updated tarball with shared library. > --- Makefile.orig Tue Apr 23 18:49:24 2024 > +++ Makefile Tue Apr 23 20:51:10 2024 > @@ -1,5 +1,7 @@ > COMMENT =lightweight Javascript interpreter > > +SHARED_LIBS =mujs 0.0 > + > V = 1.3.4 > DISTNAME = mujs-$V > > @@ -16,12 +18,13 @@ WANTLIB += c m readline > > SITES = https://mujs.com/downloads/ > > -MAKE_FLAGS = OPTIM="${CFLAGS}" > +MAKE_FLAGS = OPTIM="${CFLAGS}" SO="so.${LIBmujs_VERSION}" > > USE_GMAKE = Yes > > NO_TEST =Yes > > ALL_TARGET = release > +INSTALL_TARGET = install-shared > > .include mujs.tar.gz Description: mujs.tar.gz
Re: [new] lang/mujs
On 2024/04/23 21:10, Pascal Stumpf wrote: > 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. There is no need to interact with byzantine C++ > template mechanisms, or worry about marking and unmarking garbage > collection roots, or wrestle with obscure build systems. > > > Useful for js in an upcoming port of the new elinks codebase. > > textproc/mupdf,js needs a small fix to cope with an external libmujs. Any reason not to use the shared library? --- Makefile.orig Tue Apr 23 18:49:24 2024 +++ MakefileTue Apr 23 20:51:10 2024 @@ -1,5 +1,7 @@ COMMENT = lightweight Javascript interpreter +SHARED_LIBS = mujs 0.0 + V =1.3.4 DISTNAME = mujs-$V @@ -16,12 +18,13 @@ WANTLIB += c m readline SITES =https://mujs.com/downloads/ -MAKE_FLAGS = OPTIM="${CFLAGS}" +MAKE_FLAGS = OPTIM="${CFLAGS}" SO="so.${LIBmujs_VERSION}" USE_GMAKE =Yes NO_TEST = Yes ALL_TARGET = release +INSTALL_TARGET = install-shared .include
[new] 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. There is no need to interact with byzantine C++ template mechanisms, or worry about marking and unmarking garbage collection roots, or wrestle with obscure build systems. Useful for js in an upcoming port of the new elinks codebase. textproc/mupdf,js needs a small fix to cope with an external libmujs. mujs.tar.gz Description: mujs.tar.gz
Re: NEW: lang/mujs
Hi Stuart -- On 07/24/18 12:05, Stuart Henderson wrote: For the header, you can temporarily add a #error to the /usr/local one and know whether it gets picked up or not. Right, of course. Don't know why that slipped my mind. Anyhow, here is a small diff to MuPDF to ensure that the correct header gets picked up. ~Brian -- Sent from a phone, apologies for poor formatting. On 24 July 2018 16:48:33 Brian Callahan wrote: Hi Stuart -- On 7/24/2018 9:16 AM, Stuart Henderson wrote: On 2018/07/24 15:11, Charlène wrote: On Mon, 23 Jul 2018 17:05:34 -0400 Brian Callahan wrote: Hi ports -- Attached is a new port, lang/mujs. MuJS is a lightweight, embeddable Javascript interpreter. Works for me on amd64, armv7, and macppc. OK? Did you check it doesn't affect the mupdf build? That has an internal libmujs.a file, need to make sure that it picks up its own one in preference to any installed /usr/local/lib/libmujs. I did check this. MuPDF doesn't check for any installed MuJS. Instead, what it does is unconditionally build the one.o object file that is MuJS, archives that into a libmupdfthird.a with all the other third party code, then links libmupdfthird.a into libmupdf.so. However, because it doesn't bother checking, I can't rule out that mupdf isn't picking up the mujs.h header file from an installed mujs during build time, instead of the mujs.h header file included in mupdf. The tweaks to mupdf to ensure this doesn't happen are minimal and I can send something along if that's desirable. As I understand the way package builds are done, this would not affect them. Hi! I've successfully tried some examples found in the html docs - by the way the port doesn't install them - and also tested the standalone interpreter: it's OK here on amd64. Charlène. The HTML in the docs/ folder is just a reproduction of the port's HOMEPAGE. I'm not sure that's something we necessarily want to install. ~Brian While testing is always welcome, when a developer is asking for an "OK" for a commit, it is because they need approval from another developer, it isn't something that somebody else can give. Index: Makefile === RCS file: /cvs/ports/textproc/mupdf/Makefile,v retrieving revision 1.80 diff -u -p -r1.80 Makefile --- Makefile 27 Jun 2018 21:04:04 - 1.80 +++ Makefile 24 Jul 2018 17:01:48 - @@ -5,7 +5,7 @@ SHARED_LIBS += mupdf 7.0 COMMENT = graphic library, pdf parser, viewer and utilities V = 1.13.0 -REVISION = 1 +REVISION = 2 DISTNAME = mupdf-$V-source PKGNAME = mupdf-$V Index: patches/patch-Makefile === RCS file: /cvs/ports/textproc/mupdf/patches/patch-Makefile,v retrieving revision 1.14 diff -u -p -r1.14 patch-Makefile --- patches/patch-Makefile 23 Apr 2018 11:55:54 - 1.14 +++ patches/patch-Makefile 24 Jul 2018 17:01:48 - @@ -1,8 +1,26 @@ $OpenBSD: patch-Makefile,v 1.14 2018/04/23 11:55:54 sthen Exp $ +Make sure -Ithirdparty/mujs comes before -I/usr/local/lib! + Index: Makefile --- Makefile.orig +++ Makefile +@@ -29,6 +29,7 @@ LIBS += $(MUJS_LIBS) + LIBS += $(OPENJPEG_LIBS) + LIBS += $(ZLIB_LIBS) + ++CFLAGS += $(MUJS_CFLAGS) + CFLAGS += $(FREETYPE_CFLAGS) + CFLAGS += $(HARFBUZZ_CFLAGS) + CFLAGS += $(JBIG2DEC_CFLAGS) +@@ -37,7 +38,6 @@ CFLAGS += $(LCMS2_CFLAGS) + CFLAGS += $(LIBCRYPTO_CFLAGS) + CFLAGS += $(LIBJPEG_CFLAGS) + CFLAGS += $(LURATECH_CFLAGS) +-CFLAGS += $(MUJS_CFLAGS) + CFLAGS += $(OPENJPEG_CFLAGS) + CFLAGS += $(ZLIB_CFLAGS) + @@ -325,7 +325,7 @@ generate: $(JAVASCRIPT_GEN) # --- Library ---
Re: NEW: lang/mujs
For the header, you can temporarily add a #error to the /usr/local one and know whether it gets picked up or not. -- Sent from a phone, apologies for poor formatting. On 24 July 2018 16:48:33 Brian Callahan wrote: Hi Stuart -- On 7/24/2018 9:16 AM, Stuart Henderson wrote: On 2018/07/24 15:11, Charlène wrote: On Mon, 23 Jul 2018 17:05:34 -0400 Brian Callahan wrote: Hi ports -- Attached is a new port, lang/mujs. MuJS is a lightweight, embeddable Javascript interpreter. Works for me on amd64, armv7, and macppc. OK? Did you check it doesn't affect the mupdf build? That has an internal libmujs.a file, need to make sure that it picks up its own one in preference to any installed /usr/local/lib/libmujs. I did check this. MuPDF doesn't check for any installed MuJS. Instead, what it does is unconditionally build the one.o object file that is MuJS, archives that into a libmupdfthird.a with all the other third party code, then links libmupdfthird.a into libmupdf.so. However, because it doesn't bother checking, I can't rule out that mupdf isn't picking up the mujs.h header file from an installed mujs during build time, instead of the mujs.h header file included in mupdf. The tweaks to mupdf to ensure this doesn't happen are minimal and I can send something along if that's desirable. As I understand the way package builds are done, this would not affect them. Hi! I've successfully tried some examples found in the html docs - by the way the port doesn't install them - and also tested the standalone interpreter: it's OK here on amd64. Charlène. The HTML in the docs/ folder is just a reproduction of the port's HOMEPAGE. I'm not sure that's something we necessarily want to install. ~Brian While testing is always welcome, when a developer is asking for an "OK" for a commit, it is because they need approval from another developer, it isn't something that somebody else can give.
Re: NEW: lang/mujs
Hi Stuart -- On 7/24/2018 9:16 AM, Stuart Henderson wrote: > On 2018/07/24 15:11, Charlène wrote: >> On Mon, 23 Jul 2018 17:05:34 -0400 >> Brian Callahan wrote: >> >>> Hi ports -- >>> >>> Attached is a new port, lang/mujs. MuJS is a lightweight, embeddable >>> Javascript interpreter. >>> >> >>> Works for me on amd64, armv7, and macppc. >>> >>> OK? > Did you check it doesn't affect the mupdf build? That has an internal > libmujs.a file, need to make sure that it picks up its own one in preference > to any installed /usr/local/lib/libmujs. I did check this. MuPDF doesn't check for any installed MuJS. Instead, what it does is unconditionally build the one.o object file that is MuJS, archives that into a libmupdfthird.a with all the other third party code, then links libmupdfthird.a into libmupdf.so. However, because it doesn't bother checking, I can't rule out that mupdf isn't picking up the mujs.h header file from an installed mujs during build time, instead of the mujs.h header file included in mupdf. The tweaks to mupdf to ensure this doesn't happen are minimal and I can send something along if that's desirable. As I understand the way package builds are done, this would not affect them. >> Hi! >> >> I've successfully tried some examples found in the html docs - by >> the way the port doesn't install them - and also tested the >> standalone interpreter: it's OK here on amd64. >> >> Charlène. >> The HTML in the docs/ folder is just a reproduction of the port's HOMEPAGE. I'm not sure that's something we necessarily want to install. ~Brian > While testing is always welcome, when a developer is asking for an "OK" > for a commit, it is because they need approval from another developer, > it isn't something that somebody else can give. >
Re: NEW: lang/mujs
On 2018/07/24 15:11, Charlène wrote: > On Mon, 23 Jul 2018 17:05:34 -0400 > Brian Callahan wrote: > > > Hi ports -- > > > > Attached is a new port, lang/mujs. MuJS is a lightweight, embeddable > > Javascript interpreter. > > > > > Works for me on amd64, armv7, and macppc. > > > > OK? Did you check it doesn't affect the mupdf build? That has an internal libmujs.a file, need to make sure that it picks up its own one in preference to any installed /usr/local/lib/libmujs. > Hi! > > I've successfully tried some examples found in the html docs - by > the way the port doesn't install them - and also tested the > standalone interpreter: it's OK here on amd64. > > Charlène. > While testing is always welcome, when a developer is asking for an "OK" for a commit, it is because they need approval from another developer, it isn't something that somebody else can give.
Re: NEW: lang/mujs
On Mon, 23 Jul 2018 17:05:34 -0400 Brian Callahan wrote: > Hi ports -- > > Attached is a new port, lang/mujs. MuJS is a lightweight, embeddable > Javascript interpreter. > > Works for me on amd64, armv7, and macppc. > > OK? > Hi! I've successfully tried some examples found in the html docs - by the way the port doesn't install them - and also tested the standalone interpreter: it's OK here on amd64. Charlène.
NEW: lang/mujs
Hi ports -- Attached is a new port, lang/mujs. MuJS is a lightweight, embeddable Javascript interpreter. --- pkg/DESCR: 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. --- MuJS is the Javascript engine embedded into MuPDF if you choose the -js FLAVOR. This standalone version gives you an interpreter binary that you can feed your scripts to, as well as a library to embed into your own programs. Works for me on amd64, armv7, and macppc. OK? ~Brian mujs.tgz Description: Binary data