The standard method to create a starpack
tclkit-win64-tcl.exe sdx.kit qwrap myMk.tcl
# C:\runtime\bawtTcl\9.0.1\bin\tclkit-win64-tcl.exe C:\runtime\bawtTcl\9.0.1\bin\sdx.kit qwrap myMk.tcl
03.05.2025 21:40 648 myMk.kittclkit-win64-tcl.exe sdx.kit unwrap myMk.kit
# C:\runtime\bawtTcl\9.0.1\bin\tclkit-win64-tcl.exe C:\runtime\bawtTcl\9.0.1\bin\sdx.kit unwrap myMk.kit
03.05.2025 21:36 5 myMk.tcl
03.05.2025 21:47 <DIR> myMk.vfs ...\myMk.vfs
│
├───lib
│ └───app-myMk
│ ├───myMk.tcl
│ └───pkgIndex.tcl
│
└───main.tcl ...\myMk.vfs
│
├───lib
│ └───app-myMk 03.05.2025 21:47
│ ├───a
│ │ └───a-a
│ ├───b
│ │
│ ├───myMk.tcl
│ └───pkgIndex.tcl
│
└───main.tcltclkit-win64-tcl.exe sdx.kit wrap myMk.kit
# C:\runtime\bawtTcl\9.0.1\bin\tclkit-win64-tcl.exe C:\runtime\bawtTcl\9.0.1\bin\sdx.kit wrap myMk.kit
8 updates applied# readMk.tcl
# Load the VFS Metakit package
package require vfs::mk4
# Create a temporary mount point
set mountpoint [file join [file dirname [file normalize [info script]]] myMount]
puts " -> \$mountpoint $mountpoint"
file mkdir $mountpoint
# Mount the .kit file as a virtual filesystem
vfs::mk4::Mount myMk.kit $mountpoint
# List the files inside
puts "Contents of VFS in myMk.kit:"
foreach f [glob -directory $mountpoint *] {
puts " $f"
foreach ff [glob -directory $f *] {
puts " $ff"
foreach fff [glob -directory $ff *] {
puts " $fff"
foreach ffff [glob -directory $fff *] {
puts " $ffff"
}
}
}
}
# unmount the virtual filesystem
vfs::unmount $mountpointtclkit-win64-tcl.exe readMk.tcl
# C:\runtime\bawtTcl\9.0.1\bin\tclkit-win64-tcl.exe readMk.tcl
-> $mountpoint C:/Dateien/TMP/202505/Tcl-mk-fs/myMount
Contents of VFS in myMk.kit:
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/main.tcl
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/lib
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/lib/app-myMk
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/lib/app-myMk/myMk.tcl
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/lib/app-myMk/pkgIndex.tcl
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/lib/app-myMk/a
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/lib/app-myMk/a/a-a
C:/Dateien/TMP/202505/Tcl-mk-fs/myMount/lib/app-myMk/bWhen running this script out of tclsh instead of tclkit, tclsh fails on
vfs::mk4::Mount
tclsh.exe readMk.tcl
# C:\runtime\bawtTcl\9.0.1\bin\tclsh.exe readMk.tcl
can't find package vfs::mkcl
while executing
"package require vfs::mkcl"
(procedure "vfs::mk4::Mount" line 4)
invoked from within
"vfs::mk4::Mount myMk.kit $mountpoint"
(file "readMk.tcl" line 14)aplsimple - 2025-05-04 08:28:04
>> or something else?
Of course, there is something else: Single file applications in Tcl 9. No creating main.tcl file which may be so weird depending on the app's needs.
The technology works in Windows and Linux and is in Tcl/Tk 9 trend. Alas, it's still underestimated, while being one of Tcl's most attractive features.
Though, if your workflow suggests tclkit technology only, then the above link wouldn't fit it.
ManfredR - 2025-05-04 12:48:54
aplsimple Thanks for this link!
For some legacy code, the build process belongs to the metakit-starpack concept.
... and I do not want to invest resources to also update the build process ...
... , but shouldn't be there be a solution to mount metakit-starpacks also from tclsh, like it is for other file-systems, e.g. zip, ...
reg2s - 2025-05-07 09:40:19
It is possible to mount metakit with tclsh by adding vqtcl and tclvfs packages.
I've successfully build them in MSYS2, taking from these repositories:
https://github.com/ISalzman/vqtcl
https://github.com/tcl-mirror/tclvfs