]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fiddle build: if JQTERM is set to the dir name of a built jquery.terminal checkout...
authorstephan <stephan@noemail.net>
Fri, 28 Nov 2025 17:50:29 +0000 (17:50 +0000)
committerstephan <stephan@noemail.net>
Fri, 28 Nov 2025 17:50:29 +0000 (17:50 +0000)
FossilOrigin-Name: 9dd16f8e3b8e181ff138b4061c9dbc116cbc6f85ee867a97cd8af6e9e874c7d1

ext/wasm/GNUmakefile
ext/wasm/fiddle/index.c-pp.html [moved from ext/wasm/fiddle/index.html with 95% similarity]
manifest
manifest.uuid

index cb3f804a0fbb607e1d6dbda560d27b7227cdb686..55b7856bbaef2e2bf9d29669d960a93a2a0e2920 100644 (file)
@@ -996,14 +996,21 @@ endif
 # /shell.c
 ########################################################################
 
+#
+# Fiddle-related decls we need before .wasmbuilds is included
+#
+
+fiddle.c.in = $(dir.top)/shell.c $(sqlite3-wasm.c)
+
 EXPORTED_FUNCTIONS.fiddle = $(dir.tmp)/EXPORTED_FUNCTIONS.fiddle
 $(EXPORTED_FUNCTIONS.fiddle): $(EXPORTED_FUNCTIONS.api.in) \
  $(MAKEFILE_LIST) $(bin.c-pp)
        @$(call b.mkdir@)
-       @$(call b.c-pp.shcmd,filter,$(EXPORTED_FUNCTIONS.api.in),\
+       @$(call b.c-pp.shcmd,fiddle,$(EXPORTED_FUNCTIONS.api.in),\
       $@,$(EXPORTED_FUNCTIONS.c-pp.flags) -Dfiddle)
        @echo $(logtag.@) $(emo.disk)
 
+
 emcc.flags.fiddle = \
   $(emcc.cflags) $(emcc_opt_full) \
   --minify 0 \
@@ -1028,21 +1035,23 @@ emcc.flags.fiddle = \
   -USQLITE_WASM_BARE_BONES \
   -DSQLITE_SHELL_FIDDLE
 
-clean: clean-fiddle
-clean-fiddle:
-       rm -f $(dir.fiddle)/fiddle-module.js \
-        $(dir.fiddle)/*.wasm \
-        $(dir.fiddle)/sqlite3-opfs-*.js \
-        $(dir.fiddle)/*.gz \
-        $(EXPORTED_FUNCTIONS.fiddle)
-       rm -fr $(dir.fiddle-debug)
-
 emcc.flags.fiddle.debug = $(emcc.flags.fiddle) \
   -DSQLITE_DEBUG \
   -DSQLITE_ENABLE_SELECTTRACE \
   -DSQLITE_ENABLE_WHERETRACE
 
-fiddle.c.in = $(dir.top)/shell.c $(sqlite3-wasm.c)
+clean: clean-fiddle
+clean-fiddle:
+       rm -f $(dir.fiddle)/fiddle-module.js \
+  $(dir.fiddle)/*.wasm \
+  $(dir.fiddle)/sqlite3-opfs-*.js \
+  $(dir.fiddle)/*.gz \
+  $(dir.fiddle)/index.html \
+  $(EXPORTED_FUNCTIONS.fiddle)
+       rm -fr $(dir.fiddle-debug)
+distclean: distclean-fiddle
+distclean-fiddle:
+       rm -fr $(dir.fiddle)/jqterm
 
 #
 # WASMFS build - unsupported and untested. We used WASMFS
@@ -1371,6 +1380,54 @@ all: tester1
 # end tester1
 #
 
+#
+# jquery.terminal support for fiddle:
+#
+# If a _built_ checkout of https://github.com/jcubic/jquery.terminal
+# is found in $(JQTERM), defaulting to $(HOME)/src/jquery.terminal
+# then add jquery.terminal support to fiddle.
+#
+# To build that package, from its checkout dir:
+#
+#   npm install
+#   make
+#
+c-pp.D.fiddle ?=
+JQTERM ?= $(HOME)/src/jquery.terminal
+dir.jqtermExt = $(firstword $(wildcard $(JQTERM)))
+#$(info dir.jqtermExt=$(dir.jqtermExt))
+ifeq (0,$(MAKING_CLEAN))
+ifeq (,$(wildcard $(dir.jqtermExt)/js/jquery.terminal.min.js))
+$(info $(emo.magic) To add jquery.terminal support to fiddle, set JQTERM=/path/to/its/built/checkout)
+else
+$(info $(emo.magic) jquery.terminal found in $(dir.jqtermExt) - adding it to fiddle. Make sure it is built!)
+
+dir.jqterm = $(dir.fiddle)/jqterm
+$(dir.fiddle)/jqterm/jquery.terminal.bundle.min.js:
+       @$(call b.mkdir@)
+       cat $(dir.jqtermExt)/js/jquery-1*.min.js \
+       $(dir.jqtermExt)/js/jquery.terminal.min.js > $@
+
+$(dir.fiddle)/jqterm/jquery.terminal.min.css: $(dir.jqtermExt)/css/jquery.terminal.min.css
+       @$(call b.mkdir@)
+       @$(call b.cp,fiddle,$<,$(dir $@))
+
+$(dir.fiddle)/index.html: $(dir.fiddle)/jqterm/jquery.terminal.bundle.min.js \
+  $(dir.fiddle)/jqterm/jquery.terminal.min.css
+c-pp.D.fiddle += -Djqterm
+endif
+endif
+# ^^^ JQTERM/MAKING_CLEAN
+
+#
+# Generate fiddle/index.html. Must come after JQTERM is handled.
+#
+$(dir.fiddle)/index.html: $(dir.fiddle)/index.c-pp.html
+$(eval $(call b.c-pp.target,fiddle,\
+  $(dir.fiddle)/index.c-pp.html,$(dir.fiddle)/index.html,$(c-pp.D.fiddle)))
+$(out.fiddle.wasm): $(dir.fiddle)/index.html
+
+
 #
 # Convenience rules to rebuild with various -Ox levels. Much
 # experimentation shows -O2 to be the clear winner in terms of speed.
similarity index 95%
rename from ext/wasm/fiddle/index.html
rename to ext/wasm/fiddle/index.c-pp.html
index 378cb39027ac9c547c3ba520a93eb1b53d0ca8fd..0130de8272f9616a50a00e09d293fcec1956f3e9 100644 (file)
@@ -5,20 +5,29 @@
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <title>SQLite3 Fiddle</title>
     <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
+//#if jqterm
     <!--
         To add a terminal-style view using jquery.terminal[^1],
         uncomment the following two HTML lines and ensure that these
         files are on the web server.
 
-        jquery-bundle.min.js is a concatenation of jquery.min.js from
+        jquery.terminal.bundle.min.js is a concatenation of jquery.min.js from
         [^2] and jquery.terminal.min.js from [^1].
-        jquery.terminal.min.css is from [^1].
+        jquery.terminal.min.css is from [^1]. Alterntely, jquery-VERSION.min.js
+        can be found in jquery.terminal's source tree.
+
+        Fiddle automatically enables support for this if it's installed.
+
+        In the canonical build process, if the JQTERM env var is set to
+        a dir containing a _built_ checkout of [^1] then this block
+        gets enabled and a copy of [^1] is integrated automatically.
 
         [^1]: https://github.com/jcubic/jquery.terminal
         [^2]: https://jquery.com
     -->
-    <!--script src="jqterm/jqterm-bundle.min.js"></script>
-    <link rel="stylesheet" href="jqterm/jquery.terminal.min.css"-->
+    <script src="jqterm/jquery.terminal.bundle.min.js"></script>
+    <link rel="stylesheet" href="jqterm/jquery.terminal.min.css">
+//#endif
     <style>
       /* The following styles are for app-level use. */
       :root {
index 77f07ed0cb72ebdbe49067ba0affe9a9b90039d7..323ef5ed9bd8c0998e9d78650c6cb33cca77723c 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Minor\sdoc\supdates.
-D 2025-11-28T16:23:24.108
+C Fiddle\sbuild:\sif\sJQTERM\sis\sset\sto\sthe\sdir\sname\sof\sa\sbuilt\sjquery.terminal\scheckout\sthen\scopy\sthe\spieces\sfiddle\sneeds\sto\senable\sthat\sinput\smode.\sBy\sdefault\sit\slooks\sin\s~/src/jquery.terminal.
+D 2025-11-28T17:50:29.304
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -578,7 +578,7 @@ F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009e
 F ext/session/sqlite3session.c b3de195ce668cace9b324599bf6255a70290cbfb5451e826e946f3aee6e64c54
 F ext/session/sqlite3session.h 7404723606074fcb2afdc6b72c206072cdb2b7d8ba097ca1559174a80bc26f7a
 F ext/session/test_session.c 8766b5973a6323934cb51248f621c3dc87ad2a98f023c3cc280d79e7d78d36fb
-F ext/wasm/GNUmakefile 33af0c92458eaf28552c0f055fbc1924570cee9573fff6def0d348b7dc03763a
+F ext/wasm/GNUmakefile b71231b6cef21c1fb62cee8150652977f8a193aca2ad12d721c8a4bf902868a3
 F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a
 F ext/wasm/README.md 2e87804e12c98f1d194b7a06162a88441d33bb443efcfe00dc6565a780d2f259
 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
@@ -625,7 +625,7 @@ F ext/wasm/demo-worker1.js 08720227e98fa5b44761cf6e219269cee3e9dd0421d8d91459535
 F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
 F ext/wasm/fiddle/fiddle-worker.js 7798af02e672e088ff192716f80626c8895e19301a65b8af6d5d12b2d13d2451
 F ext/wasm/fiddle/fiddle.js 84fd75967e0af8b69d3dd849818342227d0f81d13db92e0dcbc63649b31a4893
-F ext/wasm/fiddle/index.html a27b8127ef9ecf19612da93b2a6a73bdb3777b5c56b5450bb7200a94bc108ff9
+F ext/wasm/fiddle/index.c-pp.html a399c570139b22724f6c21e52bc1edfe60a6afd30ad3ae697dabbdc18b8d7b2e w ext/wasm/fiddle/index.html
 F ext/wasm/index-dist.html db23748044e286773f2768eec287669501703b5d5f72755e8db73607dc54d290
 F ext/wasm/index.html 54e27db740695ab2cb296e02d42c4c66b3f11b65797340d19fa6590f5b287da1
 F ext/wasm/jaccwabyt/jaccwabyt.js 4e2b797dc170851c9c530c3567679f4aa509eec0fab73b466d945b00b356574b
@@ -2180,8 +2180,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 6c99e81e6c49c078f1b00952774a7007c60dc1b4ba8a8fc11357efe9c9233212
-R 2a18e52af3ae3f73476c7706e3c43e17
+P 66b0f28958311204270053ef1d5e66c0ad04e3a52f2570c543b6d319d75798fa
+R 3cac43e518d3e1631d4258c0e68ca05c
 U stephan
-Z 496e6914d5db05972a944b9f01cceaf3
+Z a990725a920469769ecdbe7fd119b7b9
 # Remove this line to create a well-formed Fossil manifest.
index a026477438ce186e906b0a02b2651421440831cc..53e466309fe8161ca47d46e7cbf62d4747512f79 100644 (file)
@@ -1 +1 @@
-66b0f28958311204270053ef1d5e66c0ad04e3a52f2570c543b6d319d75798fa
+9dd16f8e3b8e181ff138b4061c9dbc116cbc6f85ee867a97cd8af6e9e874c7d1