How top create starpack with multiple tcl files and other packages

209 views
Skip to first unread message

John Doe

unread,
Jul 14, 2010, 12:36:17 PM7/14/10
to
Hi,

I am using ActiveTcl8.5 on Linux machine. My application contains
multiple .tcl files. I also use smtp, mime packages. Everything
works fine in my home directory. However when I try to create a
starpack nothing works. I have "package require smtp 1.4.5" on top of
my script. When I try to run the starpack I get an error: "can't find
package smtp 1.4.5". Here's the structure of myapp.vfs directory:

myapp.vfs/:
lib/
app-myapp/
Compress.tcl
Email.tcl
myapp.tcl
mime/
mime-1.5.4.tm
smtp/
smtp-1.4.5.tm
main.tcl

Could you please guide me what I am doing wrong? If you have a
similar sample that works too. Thanks

APN

unread,
Jul 14, 2010, 1:12:00 PM7/14/10
to

Most likely, you have not added the vfs lib directory to the tm search
path. Your main.tcl should have a line that looks something like -

::tcl::tm::path add [file join $starkit::topdir lib]

If it does have such a line and still does not work, please post your
main.tcl

/Ashok

Robert Heller

unread,
Jul 14, 2010, 1:35:42 PM7/14/10
to
At Wed, 14 Jul 2010 09:36:17 -0700 (PDT) John Doe <bba...@gmail.com> wrote:

>
> Hi,
>
> I am using ActiveTcl8.5 on Linux machine. My application contains
> multiple .tcl files. I also use smtp, mime packages. Everything
> works fine in my home directory. However when I try to create a
> starpack nothing works. I have "package require smtp 1.4.5" on top of
> my script. When I try to run the starpack I get an error: "can't find
> package smtp 1.4.5". Here's the structure of myapp.vfs directory:
>
> myapp.vfs/:
> lib/
> app-myapp/
> Compress.tcl
> Email.tcl
> myapp.tcl
> mime/
> mime-1.5.4.tm

What is a '.tm' file?

What should be here is just what is in the mime directory under
tcllib-xxx under the tcl8.5 directory. I have Tcl 8.4 installed on my
CentOS 5.5 system (installed from CentOS's tcl-<mumble>.rpms), so in my
case it would be:

mime.tcl
pkgIndex.tcl
smtp.tcl

> smtp/
> smtp-1.4.5.tm
> main.tcl
>
> Could you please guide me what I am doing wrong? If you have a
> similar sample that works too. Thanks

Have a look at my Model Railroad System package (URL in my sig). I
build a whole slew of starpacks, some pure Tcl (with libraries of Tcl
code) and some with C/C++ extension libraries and most with stuff from
Tcllib (BWidget, snit, etc.). I use a set of tclkits as 'helper'
programs during the build process. All of that is included in the
source archive.

(Yes, it is Tcl/Tk 8.4 based at present, but the principle is much the
same.)

>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
hel...@deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/

John Doe

unread,
Jul 14, 2010, 1:39:23 PM7/14/10
to
> /Ashok- Hide quoted text -
>
> - Show quoted text -

Isn't main.tcl created automatically (on the fly) when you do "sdx
qwrap myapp.tcl"? Are you suggesting editing it when I do "sdx unwrap
myapp.kit"? Here's the content of the main.tcl created by sdx
command:

package require starkit
starkit::startup
package require app-OEVLetters

stevel

unread,
Jul 14, 2010, 8:34:35 PM7/14/10
to

I believe Ashok is on to the problem. The Starkit package doesn't (by
default) add the application VFS to the Tcl Module path - it only adds
it to the auto_path. Now that ActiveState are distributing packages
as TMs it would probably make sense to do that as well, but you should
be able to follow Ashok's suggestion and achieve the same result.

Steve

APN

unread,
Jul 15, 2010, 12:14:28 AM7/15/10
to
Here's a sample I use
------

package require starkit
starkit::startup
if {[package vcompare [package require Tcl] 8.4]} {

::tcl::tm::path add [file join $starkit::topdir lib]
}
starkit::autoextend [file join $starkit::topdir lib tcllib]
starkit::autoextend [file join $starkit::topdir lib tklib]
package require appwits

-----

/Ashok

APN

unread,
Jul 15, 2010, 12:19:25 AM7/15/10
to

By the way, if you are intending to package your application in
8.5 .tm format in the future, do not use '-' in the package name. Make
it appOEVLetters. From what I recall, the '-' confuses the tm loader
which parses it as a separator. Not sure if that problem still exists.

/Ashok

Kroc

unread,
Jul 15, 2010, 3:20:42 AM7/15/10
to
On 14 juil, 19:35, Robert Heller <hel...@deepsoft.com> wrote:
>
> What is a '.tm' file?

That's the wheel ... re-invented.

--
David Zolli

Schelte Bron

unread,
Jul 15, 2010, 7:27:47 AM7/15/10
to
APN wrote:
> if {[package vcompare [package require Tcl] 8.4]} {
> ::tcl::tm::path add [file join $starkit::topdir lib]
> }
I don't think that's the check you intended to perform. This will
execute the ::tcl::tm::path add command for all Tcl versions, except
8.4. So also for Tcl 8.3. A better method would probably be to use
vsatisfies instead of vcompare:

if {[package vsatisfies [package require Tcl] 8.5]} {


::tcl::tm::path add [file join $starkit::topdir lib]
}


Schelte.

APN

unread,
Jul 15, 2010, 8:45:06 AM7/15/10
to

True, but in my case, the app will not even build if version is < 8.4.
The makefile verifies the tclkit versions. You're right in general
though.

/Ashok

Kroc

unread,
Jul 15, 2010, 9:00:27 AM7/15/10
to
BTW I don't think tclkit 8.3 exists.

--
David Zolli

Pat Thoyts

unread,
Jul 25, 2010, 5:38:34 PM7/25/10
to
Kroc <kr...@kroc.tk> writes:

No. 8.3 did not have a virtual filesystem therefore no tclkit.

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD

Reply all
Reply to author
Forward
0 new messages