Re: [MACTCL] "proper" arrangement for packages?
by Daniel A. Steffen other posts by this author
Jul 9 2007 6:19AM messages near this date
[MACTCL] "proper" arrangement for packages?
|
Re: [MACTCL] "proper" arrangement for packages?
Hi Jon,
On 08/07/2007, at 0:11, Jon Guyer wrote:
> I'm trying to provide a newer universal build of TclAE. What Apple
> ships is completely broken on Intel and I've had at least one user
> report that the ppc binary had been stripped out somehow (I'm not
> ruling out operator error), rendering it completely useless even for
> use under Rosetta.
FWIW on my 10.4.10 intel box, the system TclAE binary is universal,
maybe the user in question has run thinning software? (probably to
"optimize" his system by getting rid of all that useless ppc code...)
> TclAE has .tcl scripts that it needs, and in the past it always got
> built as a bundle by Xcode, but Daniel changed it to a TEA build
> process last year, apparently at the behest of ActiveState. make only
> produces a binary .dylib file for me now. I don't know anything about
> TEA, and as far as I can tell, there isn't any relevant documentation
> (PDFs from six years ago wouldn't seem to have much to offer when it
> comes to building a universal .dylib).
There really isn't very much you need to know to use it, it's just
standard configure & make & make install.
Building universal is purposefully exactly the same as for the tcl/tk
core, as documented e.g. in the tcl/macosx/README, c.f. below.
> I have determined that if I put libtclAE2.0.2.dylib, along with its
> pkgIndex.tcl and its required .tcl scripts into a directory
> ("tclAE2.0.2") and then move that directory into my tcl_pkgPath, then
> it gets loaded just fine by [package require]. On the other hand,
> Apple ships tclAE2.0 as a bundle in /System/Library/Tcl/. So, which
> is preferred?
TclAE is the only extension that was ever built as a bundle I think,
mainly because it was the first extension that I wrote an OSX
buildsystem for... as I'm sure you'll remember, this was in the 10.0
days, and the unix software packaging story for OSX had not really
been clarified yet. We were also handling OS9 compatibility with the
bundle (the OS9 TclAE shared lib could be copied into the Contents/
MacOSClassic dir of the bundle and the whole bundle would work on OS9).
Now that none of these issues are relevant any longer, I don't think
the bundle format makes any sense for tcl extensions going forward,
it unnecessary complicates the extension building process, and even
for OSX-only extensions like TclAE, it makes building them
unnecessarily different from the standard TEA process.
The only reason Apple ships TclAE as a bundle is that I did not have
time to move it to a TEA buildsystem before I had to complete the
TclBI submission for Tiger...
> As far as I can tell, TEA doesn't provide any help for generating
> either, is that correct?
No, TEA in fact does everything needed, I think you're just missing
the last step in the process: it is 'make install' that packages
everything up in the right arrangement at the install location (or an
alternate location if a DESTDIR arg is passed to make).
The following steps will build & install universal TclAE from the
repository (if universal tcl is installed):
$ svn co http://tclae.svn.sourceforge.net/svnroot/tclae/trunk tclae
$ mkdir -p build; cd build
$ export CFLAGS='-Wno-deprecated-declarations -mmacosx-version-
min=10.2 -arch ppc -arch i386'
$ ../tclae/configure --libdir=/Library/Tcl
$ make -j 2
$ sudo make install
or to install in an alternate directory, e.g. for packaging a
distribution
$ make install DESTDIR=`pwd`/../install/
and to run the testsuite (no failures on i386 or ppc for me)
$ make test
I have just committed an update to svn that fixes running the
testsuite from outside the source dir (as above), handles 64-bit arch
flags in CFLAGS and updates to the latest TEA files from CVS.
It would probably be good to release this as 2.0.2 (or 2.0.3 ?) in
source and universal binary form?
For testing I have built a universal binary tarball and a package
installer with the BI buildsystem against latest tcl core-8-4-branch,
we could use one of these as the binary release format, or package
things up manually if you prefer:
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/TclAE/
TclAE-2.0.2.tar.bz2
http://rutherglen.ics.mq.edu.au/~steffen/tcltk/TclAE/
TclAE-2.0.2.pkg.tar.bz2
FYI, running the tclAE testsuite with this binary against tcl HEAD
errors out immediately with 'alloc: invalid block: 0x4140f0: 0 0',
haven't looked into the cause for that (the same happens with a tclAE
binary built against tcl HEAD FWIW).
> I ran across this exchange between Kevin and Bernard a few months ago
> [Re: [MACTCL] ANN: tclAppleHelp 1.1], which may be related. In my
> case, I can load tclAppleHelp 1.1 (although the pkgIndex.tcl file
> thinks it's 1.0) into either tclsh or Alpha on a G4 Mac running
> 10.4.9, but I cannot load it into either tclsh or Alpha on an Intel
> Mini running 10.4.10:
>
> Error: no suitable image found. Did find:
> /Users/admin/Library/Tcl/tclAppleHelp/universal-macosx/
> tclAppleHelp.dylib: not a dylib
>
> Like Bernard, lipo and file both indicate that i386 binaries are
> present and I can execute the individual steps of tclAppleHelp's
> pkgIndex.tcl file without a problem, but nothing actually seems to be
> loaded. If I [load /Users/admin/Library/Tcl/tclAppleHelp/universal-
> macosx/tclAppleHelp.dylib], I get "image not found".
given Kevin's reply, I think this is a completely separate issue,
very likely this problem is due to critcl2 (by default) linking
extensions with -bundle (i.e. MH_BUNDLE binary format) rather than -
dylib, as the TEA buildsystem does by default. This has advantages
(extensions can be loaded directly from VFS, and can be unloaded),
but also the disadvantage that such extensions require tcl 8.4.10 and
later (support for MH_BUNDLE loading was added on 2005-05-24).
Cheers,
Daniel
--
** Daniel A. Steffen Dept. of Mathematics **
** Macquarie University NSW 2109 Australia **
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Tcl-mac mailing list
tcl-mac@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-mac
Thread:
Kevin Walzer
Bernard Desgraupes
Kevin Walzer
Bernard Desgraupes
Kevin Walzer
Jon Guyer
Daniel A. Steffen
Jon Guyer
Kevin Walzer
Jon Guyer
Kevin Walzer
|