From b5379b4166a550f9737d32a6985161ed60ce6237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schr=C3=B6der?= Date: Tue, 15 Mar 2022 12:47:21 +0100 Subject: [PATCH] [doc] Update ECMAScript documentation elinks supports SpiderMonkey 78 (from 2020) and not only 1.5 (from 2000). This is not documented yet. Removed `js-1.5-rc6a+elinks.patch` because the Meson build script expect SpiderMonkey 78 for which this patch is irrelevant. Also, you can build elinks with the vanilla SpiderMonkey 78, that is without needing to apply any patch. Removed the documentation on building SpiderMonkey 1.5 because this is not relevant anymore. Updated the documentation to use `meson build` instead of `autogen.sh`. I think the autogen.sh doesn't yet support new SpiderMonkey versions. --- contrib/js-1.5-rc6a+elinks.patch | 61 ----------------------- doc/ecmascript.txt | 83 +++----------------------------- 2 files changed, 8 insertions(+), 136 deletions(-) delete mode 100644 contrib/js-1.5-rc6a+elinks.patch diff --git a/contrib/js-1.5-rc6a+elinks.patch b/contrib/js-1.5-rc6a+elinks.patch deleted file mode 100644 index fe8c06a5..00000000 --- a/contrib/js-1.5-rc6a+elinks.patch +++ /dev/null @@ -1,61 +0,0 @@ -This quick'n'dirty patch enables relatively painless SpiderMonkey installation. -See doc/ecmascript.txt for details. - -diff -ru js-1.5-rc6a/src/config.mk js-1.5-rc6a+elinks/src/config.mk ---- js-1.5-rc6a/src/config.mk Sat Nov 15 01:10:55 2003 -+++ js-1.5-rc6a+elinks/src/config.mk Wed Sep 22 16:32:12 2004 -@@ -37,10 +37,15 @@ - # - # ***** END LICENSE BLOCK ***** - -+BUILD_OPT=1 -+ifndef PREFIX -+PREFIX = /opt/spidermonkey -+endif -+ - ifdef JS_DIST - DIST = $(JS_DIST) - else --DIST = $(DEPTH)/../../dist/$(OBJDIR) -+DIST = dist/ - endif - - # Set os+release dependent make variables -diff -ru js-1.5-rc6a/src/jsconfig.mk js-1.5-rc6a+elinks/src/jsconfig.mk ---- js-1.5-rc6a/src/jsconfig.mk Sat Nov 15 01:10:56 2003 -+++ js-1.5-rc6a+elinks/src/jsconfig.mk Wed Sep 22 16:34:28 2004 -@@ -104,8 +104,8 @@ - echo $(NSPR_VERSION) > $(NSPR_VERSIONFILE) - endif - --SHIP_DIST = $(MOZ_DEPTH)/dist/$(OBJDIR) --SHIP_DIR = $(SHIP_DIST)/SHIP -+SHIP_DIST = $(DIST) -+SHIP_DIR = $(PREFIX) - - SHIP_LIBS = libjs.$(SO_SUFFIX) libjs.a - ifdef JS_LIVECONNECT -@@ -117,7 +117,7 @@ - SHIP_LIBS += jsj.dll jsj.lib - endif - endif --SHIP_LIBS += $(LCJAR) -+#SHIP_LIBS += $(LCJAR) - SHIP_LIBS := $(addprefix $(SHIP_DIST)/lib/, $(SHIP_LIBS)) - - SHIP_INCS = js*.h prmjtime.h resource.h *.msg *.tbl -@@ -144,6 +144,14 @@ - JSREFJAR = jsref_dbg.jar - endif - endif -+ -+install: -+ mkdir -p $(SHIP_DIR)/$(LIBDIR) -+ mkdir -p $(SHIP_DIR)/include -+ mkdir -p $(SHIP_DIR)/bin -+ cp $(SHIP_LIBS) $(SHIP_DIR)/$(LIBDIR) -+ cp $(SHIP_INCS) $(SHIP_DIR)/include -+ cp $(SHIP_BINS) $(SHIP_DIR)/bin - - ship: - mkdir -p $(SHIP_DIR)/$(LIBDIR) diff --git a/doc/ecmascript.txt b/doc/ecmascript.txt index 7070abac..8f7e4a04 100644 --- a/doc/ecmascript.txt +++ b/doc/ecmascript.txt @@ -21,12 +21,6 @@ acceptable documentation, is actively developed and ought to work. Ok, so how to get the ECMAScript support working? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Some systems come with either the SpiderMonkey installed or as an option. It -would be good to test if you can take the easy path and let the system take -care of installation through a package system. Below are listed instructions -on what package you need to install on various systems (please help improve -the list). If all goes well you can proceed to rebuilding ELinks. - On Debian testing (Etch) or unstable (SID), run the following: $ apt-get install libmozjs-dev @@ -35,84 +29,23 @@ On Debian stable (Sarge), run the following: $ apt-get install libsmjs-dev -Installing the -dev package will automatically pull in the library package. +On Arch Linux, run the following: -Once this is done, rebuild ELinks. The configure script should detect -the SpiderMonkey library--check for this line in the features summary: + $ pacman -S js78 - ECMAScript (JavaScript) ......... SpiderMonkey document scripting +SpiderMonkey is disabled by default, enable it like this: -After following these instructions on a Debian system, you are done and should -ignore the following directions. - -The rest is only for non-Debian system. - -Note that this procedure enables you to install SpiderMonkey, but in such a -way that it might not work with anything else but ELinks. It is unlikely that -anything else is ever going to use SpiderMonkey on your system, but if you -want to take the safe way, get SM and follow the instructions in -`src/README.html` instead. You will probably need to do some checkouting of -bits of the Mozilla CVS tree and so, have fun. - -To get SpiderMonkey source, go at -link:ftp://ftp.mozilla.org/pub/mozilla.org/js/[] and fetch the newest `js-` -tarball there (`js-1.5-rc6a.tar.gz` at the time of writing this; you may try -the RPMs, but we didn't test them). - - $ cd elinks - $ wget ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.5-rc6a.tar.gz - $ tar xvzf js-1.5-rc6a.tar.gz - -Next, you need to patch it so that you will have any chance to install it as -you fetched it. Grab it in ELinks at `contrib/js-1.5-rc6a+elinks.patch` (if -you have a different version, still try to go ahead, you might have some -success), then go to the SpiderMonkey directory (called js) and apply it as - - $ cd js - $ patch -p1 <../contrib/js-1.5-rc6a+elinks.patch - $ cd src - -Now, edit config.mk and adjust the `$PREFIX` variable - you probably won't -like the default value - ELinks will find it there, but your dynamic linker -likely won't. - -E.g., for /usr/local installation: - - $ sed 's#^PREFIX = /opt/spidermonkey#PREFIX = /usr/local#' < config.mk > config.mk.t - $ mv -f config.mk.t config.mk - -Now you can finally go for it: - - $ make -f Makefile.ref - $ make -f Makefile.ref export - -Now install it: - - $ su -c 'make -f Makefile.ref install && (ldconfig -v | grep libjs)' - -Check for: - - libjs.so -> libjs.so - -If you don't get such result, check that the library's installation path -(e.g. /usr/local/lib) is present in /etc/ld.so.conf (man 8 ldconfig). - -If all went well, you can proceed to rebuild ELinks now. If something broke, -see you on #elinks @ FreeNode or in the mailing list. -You may add your options to `./configure` as usual; SpiderMonkey should be -autodetected. - - $ cd ../.. - $ ./configure + $ meson build -Dspidermonkey=true Check for the following line in the features summary: - ECMAScript (JavaScript) ......... SpiderMonkey document scripting + Run-time dependency mozjs-78 found: YES 78.15.0 Then run: - $ make - $ su -c 'make install' + $ cd build/ + $ ninja + $ sudo ninja install Enjoy.