Update of "toadkits"
Not logged in
Tcl 2014 Conference, Portland/OR, US, Nov 10-14
Send your abstracts to tclconference@googlegroups.com by Sep 8.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.


Artifact ID: 38e9f9d855ef526fd858b9e4ec67b7c8d6754f71
Page Name:toadkits
Date: 2017-08-30 21:43:49
Original User: hypnotoad
Parent: f2c2d9deb7e1018ce138559a78fd614abbc4d3bd

What is a toadkit?

A toadkit is a self-contained executable with a complete software application. Toadkits are an update of the Tcl as One Big Executable (TOBE) concept. (See http://www.hwaci.com/sw/tobe/). Tcl/Tk is statically compiled along with enough tools to mount the executable as a virtual file system. This virtual file system contains Tcl/Tk code, application resources. Binary packages can be either statically linked to the executable, or distributed as shared libraries in the VFS.

All of this code is packaged in a single file that the user can double-click on, or drag and drop files on top of.

Building a toadkit.

These instructions used to be a bit more involved. But the process has been integrated into the automations of ODIE.

mkdir odie
mkdir odie/download
mkdir odie/build
mkdir odie/tclconfig
fossil clone http://fossil.etoyoc.com/fossil/tclconfig tclconfig/download/tclconfig.fos
fossil clone http://fossil.etoyoc.com/fossil/odie odie/download/odie.fos
cd odie/tclconfig
fossil open ../download/tclconfig.fos practcl
cd ../build
fossil open ../download/odie.fos
tclsh make.tcl toadkit

This build process assumes the following: you have access to fossil and git in your local environment, as well as

In the process of building the basekit, odie will download the Tcl/Tk core, and sources for the included packages. Source code is downloaded to the sandbox which is the same directory that odie was unpacked to. In the build folder will by a series of pkg.* folders, on per binary package. That is where Odie compiles the binary packages. In addition is PKGROOT, which is a virtual file system where binary packages are "installed" so they can be copied into a waiting VFS.

For details on what is inside, see: Anatomy of a Toadkit project

To wrap your own program using the basekit, create a VFS directory. (Say myproduct.vfs)

cp -a ~/myproject/src myproject.vfs
tclsh ../odie/make.tcl wrap clevername myproject.vfs
This will produce an execuable named clevername. If myproject.vfs includes a file called "main.tcl" in the root, the executable will load that file instead of reverting to the standard tcl interactive shell behavior. main.tcl will be able to respond to the command line. As part of the kitbuilding process, the entire VFS is scanned, and a file packages.tcl is produced, and placed in the root of the VFS. This is the master manifest of all packages that are included in the VFS. This file will be read automatically when the process starts.

If a file named "main.tcl" is present in the root of the VFS, the process will source this file after loading the package manifest. TOBE behaves like any other tcl process, it can respond to arguments on the command line (look in the argv variable.)

If no main.tcl is present, toadkits behave as a standard Tcl shell. Tk is statically linked, but not loaded automatically. It can be accessed with a simple "package require Tk".