|
From: Joe E. <jen...@fl...> - 2005-01-25 01:36:12
|
Steve Landers wrote:
> Donald G Porter wrote:
> > My preference would be an index script that looks like this:
> >
> > if {![package vsatisfies [package provide Tcl] 8.5]} {return}
> > if {[catch {package present Tk 8.5}] != 0} {return}
> > if {[tk windowingsystem] ne "x11"} {return}
> > package ifneeded Tile 0.5 [list load [file join $dir libtile.so]]
>
> Is that going to address the issue - how to selectively load the shared
> library depending on the windowing system when Tk hasn't necessarily
> been "package required" when the Tile pkgIndex.tcl runs?
If you install two copies of Tile, one built against Tk/X11
and with a pkgIndex.tcl that looks like the above, and the other
built against Tk/Aqua and with a similar pkgIndex.tcl except
that it bails out early if [tk windowingsystem] ne "aqua" instead,
that should have the desired effect, subject to the constraint that
applications must [package require Tk] before [package require tile].
But here's how I would do it:
# pkgIndex.tcl
#
package ifneeded tile 0.5 [subst {
package require Tk 8.4
if {\[tk windowingsystem\] eq "aqua"} {
load "[file join $dir tile-aqua.dylib]"
} else {
load "[file join $dir tile-x11.dylib]"
}
}]
Alternately -- and this is how I would do things if
it were my machine -- arrange things so that Tk/X11
and Tk/Aqua have different search paths, and install
the appropriate version of tile in the appropriate
place.
--Joe English
jen...@fl...
|