sdx

Artifact Content
Login

Artifact ff14c05dd823b06ceb3a98dc582b68a9510099fa:

Wiki page [howto] by aspect 2017-03-20 00:22:33.
D 2017-03-20T00:22:33.964
L howto
N text/x-markdown
P 4d4fc1c576d6cc0c60622985f18c564a690442bd
U aspect
W 1947
<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 http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-fossil_trunk-linux-amd64

# 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 http://www.rkeene.org/devel/kitcreator/kitbuild/nightly/tclkit-fossil_trunk-linux-amd64

# 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 href="http://teaparty.rkeene.org/fossil/index"><tt>teapot-client</tt></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 <tt>$PATH</tt></li>
<li>.. (almost) anything you can imagine!</li>
</ul>
Z 6e0a7b9bd73e622c9052a7a64b09df70