aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlecoanet2004-09-24 12:53:11 +0000
committerlecoanet2004-09-24 12:53:11 +0000
commitb1522f7551ad6f1a989770b144109ea90bd0d99b (patch)
tree5972f530a1e1a5b07fa091e17d58d97d0c4eb5d0
parent80777ed88356f0cd83be72a6f696868935753e48 (diff)
downloadtkzinc-b1522f7551ad6f1a989770b144109ea90bd0d99b.zip
tkzinc-b1522f7551ad6f1a989770b144109ea90bd0d99b.tar.gz
tkzinc-b1522f7551ad6f1a989770b144109ea90bd0d99b.tar.bz2
tkzinc-b1522f7551ad6f1a989770b144109ea90bd0d99b.tar.xz
*** empty log message ***
-rw-r--r--buildperl.tcl40
-rw-r--r--starkit.tcl.in140
2 files changed, 180 insertions, 0 deletions
diff --git a/buildperl.tcl b/buildperl.tcl
new file mode 100644
index 0000000..3b01864
--- /dev/null
+++ b/buildperl.tcl
@@ -0,0 +1,40 @@
+#
+# This script is intended to be run in the top directory
+# with: tclsh84 buildperl.tcl
+#
+
+#
+# Create a perl build directory and copy the relevant
+# files in it.
+#
+set wd [pwd]
+set files {t Zinc.xs Zinc.pm Makefile.PL demos README Zinc}
+set buildDir buildperl
+
+puts "Creating temporary build structure for Tkzinc perl variant"
+
+if { [file exists $buildDir] } {
+ file delete -force $buildDir
+}
+file mkdir $buildDir
+foreach f $files {
+ file copy -force Perl/$f $buildDir
+}
+foreach f [glob -nocomplain libtess/*.c libtess/*.h generic/*.c generic/*.h win/*.c debian/changelog debian/copyright] {
+ file copy -force $f $buildDir
+}
+
+puts "Compiling the perl variant"
+
+set make make
+if { [lindex $tcl_platform(os) 0] eq "Windows" } {
+ set make nmake
+}
+
+cd buildperl
+catch {exec perl Makefile.PL} result
+puts $result
+catch {exec $make} result
+puts $result
+
+cd $wd
diff --git a/starkit.tcl.in b/starkit.tcl.in
new file mode 100644
index 0000000..dac4a63
--- /dev/null
+++ b/starkit.tcl.in
@@ -0,0 +1,140 @@
+#
+# This script is intended to be run in the top directory
+# with: tclsh starkit.tcl.
+# It needs a tclkit and the sdx command as a starkit in the path.
+#
+
+set MAJOR_VERSION @MAJOR_VERSION@
+set MINOR_VERSION @MINOR_VERSION@
+set PATCHLEVEL @PATCHLEVEL@
+
+
+#
+# Starkit structure
+#
+# demo.tcl
+# lib
+# tkimg1.3
+# files from the Tkimg starkit
+# TkzincX.Y
+# Copyright
+# demos
+# demos files and sub-directories
+# Linux-x86
+# Tkzinc.so
+# pkgIndex.tcl
+# Windows-x86
+# Tkzinc.dll
+# zincGraphics.tcl
+# zincLogo.tcl
+# zincText.tcl
+# main.tcl
+#
+
+proc updateKit {} {
+ global MAJOR_VERSION MINOR_VERSION PATCHLEVEL
+
+ set zincPath [file join Tkzinc.vfs lib Tkzinc$MAJOR_VERSION.$MINOR_VERSION]
+ set version $MAJOR_VERSION.$MINOR_VERSION.$PATCHLEVEL
+ set winVersion $MAJOR_VERSION$MINOR_VERSION$PATCHLEVEL
+
+ file copy -force [file join starkit demo.tcl] [file join starkit main.tcl] Tkzinc.vfs
+
+ set zincPath [file join Tkzinc.vfs lib Tkzinc$MAJOR_VERSION.$MINOR_VERSION]
+ file mkdir $zincPath
+ file copy -force Copyright \
+ [file join library zincGraphics.tcl] \
+ [file join library zincLogo.tcl] \
+ [file join library zincText.tcl] \
+ $zincPath
+
+ set demosPath [file join $zincPath demos]
+ file mkdir $demosPath
+ foreach f [glob -directory demos *.tcl] {
+ file copy -force $f $demosPath
+ }
+ file delete -force [file join $demosPath data] [file join $demosPath images]
+ file copy -force [file join demos zinc-widget] [file join demos data] [file join demos images] $demosPath
+
+ #
+ # Emit a merged pkgIndex.tcl
+ #
+ set fOut [open [file join $zincPath pkgIndex.tcl] w]
+ puts $fOut "proc Platform {} {"
+ puts -nonewline $fOut [info body Platform]
+ puts $fOut "}"
+ set fIn [open [file join library pkgIndex.tcl]]
+ foreach line [split [read $fIn] \n] {
+ if {![regexp {^\s*$|^#} $line]} {
+ puts $fOut $line
+ }
+ }
+ close $fIn
+ puts -nonewline $fOut "package ifneeded Tkzinc $version "
+ puts $fOut {[list load [file join $dir [Platform] Tkzinc[info sharedlibext]]]}
+ close $fOut
+
+ #
+ # Copy the platform dependent libraries
+ #
+ if { [file exists libTkzinc$version.so] } {
+ set platformPath [file join $zincPath Linux-x86]
+ file mkdir $platformPath
+ file copy -force libTkzinc$version.so [file join $platformPath Tkzinc.so]
+ }
+ if { [file exists Tkzinc$winVersion.dll] } {
+ set platformPath [file join $zincPath Windows-x86]
+ file mkdir $platformPath
+ file copy -force Tkzinc330.dll [file join $platformPath Tkzinc.dll]
+ }
+
+ exec sdx wrap Tkzinc.kit
+}
+
+
+proc Platform {} {
+ global tcl_platform
+ set plat [lindex $tcl_platform(os) 0]
+ set mach $tcl_platform(machine)
+ switch -glob -- $mach {
+ sun4* { set mach sparc }
+ intel -
+ i*86* { set mach x86 }
+ "Power Macintosh" { set mach ppc }
+ }
+ switch -- $plat {
+ AIX { set mach ppc }
+ HP-UX { set mach hppa }
+ }
+ return "$plat-$mach"
+}
+
+#
+# If the starkit Tkzinc.kit already exist in the top directory
+# simply update it else build a new one according to the layout
+# above. In this later case one need to make sure there is a
+# valid Tkimg.kit in the top directory's parent.
+#
+if { [file exists Tkzinc.kit] } {
+ if { [file exists Tkzinc.vfs] } {
+ file delete -force Tkzinc.vfs
+ }
+ exec sdx unwrap Tkzinc.kit
+ updateKit
+} {
+ if { [file exists Tkzinc.vfs] } {
+ file delete -force Tkzinc.vfs
+ }
+ file mkdir Tkzinc.vfs
+
+ if { [file exists Tkimg.vfs] } {
+ file delete -force Tkimg.vfs
+ }
+ exec sdx unwrap [file join .. Tkimg.kit]
+ file copy [file join Tkimg.vfs lib] Tkzinc.vfs
+
+ updateKit
+}
+
+file delete -force Tkimg.vfs
+#file delete -force Tkzinc.vfs