A by-product of undroidwish, see it in action in http://www.ch-werner.de/LUCK.html , the available binary templates in http://www.ch-werner.de/LUCK , and the source code in https://www.androwish.org/home/dir?ci=tip&name=undroid/luck .
Web based (CGI) script to make a taylored undroidwish, vanillawish or vanillatclsh from binaries which are searched in the same directory as the tclsh or wish executing this script. Additionally, prefabricated configurations are presented. These are searched like the binaries and additionally relative to the parent directory of this script.
In the first step, the user selects a prefabricated or uploaded configuration or a binary. In the second step, a selection of packages derived from the binary's ZIP is presented plus some other options such as ZIP password and output filename. The package selection and other options can be primed by the info from a prefabricated or uploaded configuration. In the last step the user can generate a new binary and configuration with only the selected packages and other options, which is downloaded as a file.
The generation process uses memchan channels and ZIP mounts of memory buffers, i.e. no native filesystem for temporary storage is required.
The following table is a snapshot from 2022-02-11.
Platform | Machine | Remarks |
---|---|---|
FreeBSD | x86 | |
Haiku | x86, x86_64 | undroidwish only |
Illumos | x86 | |
Linux | x86, x86_64, arm, aarch64 | glibc and musl, wayland |
MacOSX | x86_64 | no builds for Catalina and newer |
OpenBSD | x86_64 | |
Windows | x86, x86_64 |
The CGI script is RESTful and can be used as a service from other Tcl scripts utilizing tcllib's rest package, e.g. to easily mass produce Tcl apps for a variety of platforms. Here is an example on how to read out information and make a binary:
# Demonstrate usage of LUCK RESTfully, requires a locally running LUCK service on port 8015 package require rest set luck(list) { url http://localhost:8015/cgi-bin/luck.tcl description {list of available templates} result raw method post static_args {api list} req_args {} opt_args {} } # req_args: # -template name of binary template, e.g. vanillawish-linux32 # opt_args: # -withtips when present send alternating lines of extension name and description set luck(extlist) { url http://localhost:8015/cgi-bin/luck.tcl description {list of extensions of given template} result raw method post static_args {api extlist} req_args {template:} opt_args {withtips} } # req_args: # -template name of binary template, e.g. vanillawish-linux32 # -include list of extensions to be embedded # opt_args: # -appfile *.tcl (for app/main.tcl) or *.zip (must have main.tcl), # content must be base64 encoded # -cmdline (undroidwish) additional startup arguments # -appicon (undroidwish) BMP (24 bit RGB) icon, # content must be base64 encoded # -winicon (Windows binaries) icon (*.ico) for executable, # content must be base64 encoded # -passwd ZIP password set luck(generate) { url http://localhost:8015/cgi-bin/luck.tcl description {generate a binary} result raw method post static_args {api generate} req_args {template: include:} opt_args {appfile: cmdline: appicon: winicon: passwd:} } # create REST interface rest::create_interface luck # list templates puts "==== Templates ====" puts -nonewline [luck::list] # list extensions of vanillawish-win32.exe puts "==== Extensions of vanillawish-win32.exe ====" puts -nonewline [luck::extlist -template vanillawish-win32.exe] # make tkbugz for win32 from a ZIP which contains main.tcl # with the single line "source [info nameofexecutable]/tkbugz/tk_bugz.tcl" set main_tcl_zip { UEsDBBQAAAAIAJVmp1I2IJT8MAAAADIAAAAIABwAbWFpbi50Y2xVVAkAA/oblWAL HJVgdXgLAAEE6AMAAAToAwAAK84vLUpOVYjOzEvLV8hLzE3NT0utSE0uLUlMykmN 1S/JTipNrwJS8SBaryQ5hwsAUEsBAh4DFAAAAAgAlWanUjYglPwwAAAAMgAAAAgA GAAAAAAAAQAAAKSBAAAAAG1haW4udGNsVVQFAAP6G5VgdXgLAAEE6AMAAAToAwAA UEsFBgAAAAABAAEATgAAAHIAAAAAAA== } set f [open tkbugz.exe wb] puts -nonewline $f \ [luck::generate -template vanillawish-win32.exe \ -include tkbugz -appfile $main_tcl_zip] close $f
Most vanillatclsh-en from the web site contain a REST based TUI (CUI) frontend called lucktui which is available in the luck package, e.g. by running vanillatclsh... builtin:luck/lucktui.tcl or vanillatclsh... builtin:lucktui for short. Here's a sample session as an ASCII screencast .
The LUCKy steps to a train application: Try it, it is fun!
aplsimple - 2022-04-02 06:35:27
Thank you, Christian, for your smart interface to construct stand-alone executables, including vanilla tclsh and wish by themselves.
I wonder why this work is so poorly announced and promoted.
LUCK is one of Tcl/Tk gems that deserves to be included in the wiki's start page, side by side with Tcl Developer Xchange link. APN I agree along with Paul's BAWT and Roy's build farm. I've tweeted a couple of times on all these but that's ephemeral, they should be somewhere front and center as development resources.
nb - 17/03/2023
I am trying to shift from starkits/packs to using this LUCK system which looks way cool... I am not able to generate an exe with my app and libraries in the correct place in the tree...
I guess what I'm asking is how to add own libraries (or libraries not in the LUCK page) under the executable under the root directory
tx
chw 2023-03-17
This is not possible. But you can have those things as subdirectories of the application folder. And address them easily from your startup script by using [file dirname [info script] plus name of subdirectory. Other alternative is rebuilding LUCK from scratch with your own things included.