<h2>Customising a Tclkit</h2>

<p>You will need <tt>sdx.kit</tt> from the front page of this repo.  See <a href="tclkits">tclkits</a> for sources of pre-built kits</p>

<pre>
# grab a tclkit
curl -O

# make a copy of tclkit to run sdx with
cp tclkit-fossil_trunk-linux-amd64 tclkit
chmod +x tclkit

# extract the vfs
./tclkit sdx.kit extract tclkit-fossil_trunk-linux-amd64

# add some code
echo 'puts "Hello, Tclkit"' >> tclkit-fossil_trunk-linux-amd64.vfs/boot.tcl

# sync changes back to tclkit
./tclkit sdx.kit sync tclkit-fossil_trunk-linux-amd64 tclkit-fossil_trunk-linux-amd64.vfs
</pre>

<p><tt>boot.tcl</tt> is run on tclkit startup.  Since there is no <tt>main.tcl</tt>, the tclkit will give you a Tcl shell.</p>


<h2>Wrapping an Application</h2>

Tclkits look for <tt>main.tcl</tt> to launch an application on startup.

<pre>
# grab a tclkit
curl -O

# make a copy of tclkit to run sdx with
cp tclkit-fossil_trunk-linux-amd64 tclkit
chmod +x tclkit

# create your application
mkdir myapp.vfs
echo 'puts "Hello, Starkit!"' > myapp/main.tcl

# wrap it!
./tclkit sdx.kit wrap myapp -runtime tclkit-fossil_trunk-linux-amd64
</pre>

<p>Share the new executable <tt>myapp</tt> with your friends!</p>

<h2>More!</h2>

<p>The above steps are easily elaborated to ...</p>

<ul>
<li>wrap for different architectures</li>
<li>add further libraries (including native ones) (protip: use <a to fetch them)</li>
<li>include custom assets in your kits</li>
<li>wrap <tt>sdx.kit</tt> to make it a standalone executable</li>
<li>put <tt>tclkit<tt> and <tt>sdx</tt> in your
<li>.. (almost) anything you can imagine!</li>
</ul>