Check-in [e5abb0c87e]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com or submit via the online form
by Aug 20.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Worked out a mechanism to translate MSYS paths to tcl compadible paths, and thus accomdate tkimg
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e5abb0c87e6d00a4f8015e468470fe593823ec02
User & Date: hypnotoad 2016-03-04 16:48:47
Context
2016-03-07
19:15
Added handling of integrating snapshots from the local teapot into basekits check-in: 28c90d17e4 user: hypnotoad tags: trunk
2016-03-04
16:48
Worked out a mechanism to translate MSYS paths to tcl compadible paths, and thus accomdate tkimg check-in: e5abb0c87e user: hypnotoad tags: trunk
15:19
Updated practcl to 0.1.5 Eliminated the dependency on the fileutil module. Modified the build process to use a sandbox checkout of Tcl, Tk, and the core distributed packages sqlite and thread. Developed a new "fossil_sandbox" procedure to manage getting code out of fossil, and prepped for compilation. check-in: c220d36ad4 user: hypnotoad tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to build.tcl.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  set fout [open [file join $vfspath packages.tcl] w]
  puts $fout [list set dir $::KIT(PKGPREFIX)]
  set buffer [::practcl::pkgindex_path $::KIT(BASEVFS) $vfspath]
  puts $fout $buffer

  close $fout
  ::practcl::copyDir $::KIT(BASEVFS) $vfspath
  ::practcl::copyDir $::KIT(PKGROOT)$::KIT(PKGPREFIX)/lib $vfspath/boot/pkgs
  foreach arg $args {
     ::practcl::copyDir $arg $vfspath
  }
  ::zipfile::mkzip::mkzip ${name}$::KIT(EXEEXT) -runtime $::TARGET(tclkit_bare) -directory $vfspath
  if { $::KIT(platform) ne "windows" } {
    file attributes ${name}$::KIT(EXEEXT) -permissions a+x
  }







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  set fout [open [file join $vfspath packages.tcl] w]
  puts $fout [list set dir $::KIT(PKGPREFIX)]
  set buffer [::practcl::pkgindex_path $::KIT(BASEVFS) $vfspath]
  puts $fout $buffer

  close $fout
  ::practcl::copyDir $::KIT(BASEVFS) $vfspath
  #::practcl::copyDir $::KIT(PKGROOT)$::KIT(PKGPREFIX)/lib $vfspath/boot/pkgs
  foreach arg $args {
     ::practcl::copyDir $arg $vfspath
  }
  ::zipfile::mkzip::mkzip ${name}$::KIT(EXEEXT) -runtime $::TARGET(tclkit_bare) -directory $vfspath
  if { $::KIT(platform) ne "windows" } {
    file attributes ${name}$::KIT(EXEEXT) -permissions a+x
  }
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
  exec [info nameofexecutable] [file join $HERE autosetup autosetup]
  cd $PWD
}

###
# Can *almost* get it working, but the broken installer
# leads to chaos under MinGW
#
#  tkimg    {tag trunk tk 1 broken_destroot 1}
###
set ::KIT(PACKAGES) {
  thread {tag release}
  sqlite {tag release}
  udp {tag trunk}
  canvas3d {tag trunk tk 1}

}

source [file join $::HERE odieConfig.tcl]
set ::KIT(platform) $::odie(platform)
set ::KIT(ORIG_TCL_SRC_DIR) $::odie_tcl(src_dir)
set ::KIT(ORIG_TK_SRC_DIR) $::odie_tk(src_dir)
set ::KIT(TCL_BUILD_OPTS) $::odie_tcl(config_flags)







<
<






>







73
74
75
76
77
78
79


80
81
82
83
84
85
86
87
88
89
90
91
92
93
  exec [info nameofexecutable] [file join $HERE autosetup autosetup]
  cd $PWD
}

###
# Can *almost* get it working, but the broken installer
# leads to chaos under MinGW


###
set ::KIT(PACKAGES) {
  thread {tag release}
  sqlite {tag release}
  udp {tag trunk}
  canvas3d {tag trunk tk 1}
  tkimg    {tag trunk tk 1 broken_destroot 1}
}

source [file join $::HERE odieConfig.tcl]
set ::KIT(platform) $::odie(platform)
set ::KIT(ORIG_TCL_SRC_DIR) $::odie_tcl(src_dir)
set ::KIT(ORIG_TK_SRC_DIR) $::odie_tk(src_dir)
set ::KIT(TCL_BUILD_OPTS) $::odie_tcl(config_flags)
137
138
139
140
141
142
143

144
145
146
147
148
149
150
  toadkit {
    set build(toadkit) 1
  }
  basekit {
    set build(toadkit) 1
  }
  packages {

    set build(packages) 1
  }
  wrap {
    
  }
  clean {
  }







>







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  toadkit {
    set build(toadkit) 1
  }
  basekit {
    set build(toadkit) 1
  }
  packages {
    set build(packages) 1
    set build(packages) 1
  }
  wrap {
    
  }
  clean {
  }
207
208
209
210
211
212
213



214
215
216
217
218
219
220
}
if {![file exists $::KIT(PKGROOT)]} {
  set build(packages) 1
}
if {![file exists $::KIT(BASEVFS)]} {
  set build(basekitvfs) 1
}



if {$build(tcl) || $build(tk) || $build(toadkit)} {
  set build(packages) 1
  set build(basekitvfs) 1
  set build(toadkit.rc) 1
  set build(tclkit_bare) 1
  set build(libtoadkit.a) 1
}







>
>
>







207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
}
if {![file exists $::KIT(PKGROOT)]} {
  set build(packages) 1
}
if {![file exists $::KIT(BASEVFS)]} {
  set build(basekitvfs) 1
}
if {$build(packages)} {
  set build(basekitvfs) 1
}
if {$build(tcl) || $build(tk) || $build(toadkit)} {
  set build(packages) 1
  set build(basekitvfs) 1
  set build(toadkit.rc) 1
  set build(tclkit_bare) 1
  set build(libtoadkit.a) 1
}
456
457
458
459
460
461
462






463









464
465
466

467
468
469
470
471
472
473
  # Link together our executable
  ###
  doexec ar cr $::TARGET(libtoadkit.a) {*}$::KIT(LIBTOADKIT_OBJS)
  doexec ranlib $::TARGET(libtoadkit.a)
}

if {$build(packages)} {






  cd $PWD









  if {[file exists $::KIT(PKGROOT)]} {
    file delete -force $::KIT(PKGROOT)
  }

  set fossilinfo [list download $::KIT(DOWNLOAD) sandbox $::KIT(SANDBOX)]
  set tclconfiginfo [::practcl::fossil_sandbox tclconfig [dict merge $fossilinfo {}]]
  set tclconfig_path [dict get $tclconfiginfo srcroot]
  foreach {pkg info} $::KIT(PACKAGES) {
    set pkginfo [::practcl::fossil_sandbox $pkg [dict merge $fossilinfo $info]]
    set pkgpath [dict get $pkginfo srcroot]
    puts [list BUILDING $pkg in $pkgpath]







>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>



>







459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
  # Link together our executable
  ###
  doexec ar cr $::TARGET(libtoadkit.a) {*}$::KIT(LIBTOADKIT_OBJS)
  doexec ranlib $::TARGET(libtoadkit.a)
}

if {$build(packages)} {
  ###
  # Clean out any packages stuffed in the path where packages that
  # don't handle DESTROOT properly
  ###
  if {$::KIT(PKGPREFIX) in {/usr / /usr/local /opt /opt/local /tcl}} {
    set BROKENROOT {}
  } else {
    catch {
    set BROKENROOT [::practcl::msys_to_tclpath $::KIT(PKGPREFIX)]
    puts "BROKENROOT $BROKENROOT"
    file delete $BROKENROOT
    }
  }
  ###
  # Clean out our installed package file system
  ###
  if {[file exists $::KIT(PKGROOT)]} {
    file delete -force $::KIT(PKGROOT)
  }
  cd $PWD
  set fossilinfo [list download $::KIT(DOWNLOAD) sandbox $::KIT(SANDBOX)]
  set tclconfiginfo [::practcl::fossil_sandbox tclconfig [dict merge $fossilinfo {}]]
  set tclconfig_path [dict get $tclconfiginfo srcroot]
  foreach {pkg info} $::KIT(PACKAGES) {
    set pkginfo [::practcl::fossil_sandbox $pkg [dict merge $fossilinfo $info]]
    set pkgpath [dict get $pkginfo srcroot]
    puts [list BUILDING $pkg in $pkgpath]
488
489
490
491
492
493
494











495
496
497
498
499
500
501
502
503
504
505
506
507
508

509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
      } else {
        continue
      }
    }
    puts "INSTALLING to VFS [file tail $pkgpath]"
    domake install DESTDIR=$::KIT(PKGROOT)
  }











}

if {$build(tclkit_bare)} {
  cd $PWD
  # Build a Tcl-only shell
  set cmd [list $::KIT(cc)  {*}$::KIT(cflags_optimize) {*}$::KIT(shlib_cflags)]
  lappend cmd {*}$::KIT(TCLSHELL_OBJS)
  foreach item [glob ${_TclSrcDir}/*.a] {
    lappend cmd $item
  }
  lappend cmd $::TARGET(libtoadkit.a) {*}$::TCL(libs)
  lappend cmd -o $::TARGET(tclkit_bare) {*}$::KIT(LDFLAGS_CONSOLE)
  doexec {*}$cmd
}

if {$build(basekitvfs)} {
  cd $PWD
  if {[file exists $::KIT(BASEVFS)]} {
    file delete -force $::KIT(BASEVFS)
  }
  puts "***
*** BASE KIT VFS PACKAGES
***"
  puts [list COPY [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib]]
  ::practcl::copyDir [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib] [file join $::KIT(BASEVFS) pkgs]
  ::practcl::copyDir [file join $::KIT(TCLSRCDIR) library] [file join $::KIT(BASEVFS) boot tcl]
  if { $::KIT(platform) eq "windows" } {
    set ddedll [glob -nocomplain [file join $_TclSrcDir tcldde*.dll]]
    if {$ddedll != {}} {
      file copy $ddedll [file join $::KIT(BASEVFS) boot tcl dde]
    }
    set regdll [glob -nocomplain [file join $_TclSrcDir tclreg*.dll]]







>
>
>
>
>
>
>
>
>
>
>














>









|







507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
      } else {
        continue
      }
    }
    puts "INSTALLING to VFS [file tail $pkgpath]"
    domake install DESTDIR=$::KIT(PKGROOT)
  }

  if {$::KIT(PKGPREFIX) in {/usr / /usr/local /opt /opt/local /tcl}} {
    set BROKENROOT {}
  } else {
    catch {
    set BROKENROOT [::practcl::msys_to_tclpath $::KIT(PKGPREFIX)]
    puts [list COPY $BROKENROOT -> $::KIT(PKGROOT)$::KIT(PKGPREFIX)]
    ::practcl::copyDir $BROKENROOT $::KIT(PKGROOT)$::KIT(PKGPREFIX)
    file delete -force $BROKENROOT
    }
  }
}

if {$build(tclkit_bare)} {
  cd $PWD
  # Build a Tcl-only shell
  set cmd [list $::KIT(cc)  {*}$::KIT(cflags_optimize) {*}$::KIT(shlib_cflags)]
  lappend cmd {*}$::KIT(TCLSHELL_OBJS)
  foreach item [glob ${_TclSrcDir}/*.a] {
    lappend cmd $item
  }
  lappend cmd $::TARGET(libtoadkit.a) {*}$::TCL(libs)
  lappend cmd -o $::TARGET(tclkit_bare) {*}$::KIT(LDFLAGS_CONSOLE)
  doexec {*}$cmd
}

if {$build(basekitvfs)} {
  cd $PWD
  if {[file exists $::KIT(BASEVFS)]} {
    file delete -force $::KIT(BASEVFS)
  }
  puts "***
*** BASE KIT VFS PACKAGES
***"
  puts [list COPY [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib]]
  ::practcl::copyDir [file join $::KIT(PKGROOT) [string trimleft $::KIT(PKGPREFIX) /] lib] [file join $::KIT(BASEVFS) boot pkgs]
  ::practcl::copyDir [file join $::KIT(TCLSRCDIR) library] [file join $::KIT(BASEVFS) boot tcl]
  if { $::KIT(platform) eq "windows" } {
    set ddedll [glob -nocomplain [file join $_TclSrcDir tcldde*.dll]]
    if {$ddedll != {}} {
      file copy $ddedll [file join $::KIT(BASEVFS) boot tcl dde]
    }
    set regdll [glob -nocomplain [file join $_TclSrcDir tclreg*.dll]]