Skip to content

Commit 25721f7

Browse files
committed
Initial commit.
0 parents  commit 25721f7

14 files changed

+365
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
/artifacts

LICENSE.KitCreator

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
The MIT License is applied to all files in this distribution, except:
2+
kitsh/buildsrc/kitsh-0.0/boot.tcl
3+
kitsh/buildsrc/kitsh-0.0/boot.tcl.h
4+
kitsh/buildsrc/kitsh-0.0/kit.rc
5+
kitsh/buildsrc/kitsh-0.0/kit.ico
6+
kitsh/buildsrc/kitsh-0.0/kitInit.c
7+
kitsh/buildsrc/kitsh-0.0/license.terms
8+
kitsh/buildsrc/kitsh-0.0/pwb.c
9+
kitsh/buildsrc/kitsh-0.0/rechan.c
10+
kitsh/buildsrc/kitsh-0.0/zipvfs.tcl
11+
kitsh/buildsrc/kitsh-0.0/zipvfs.tcl.h
12+
kitsh/buildsrc/kitsh-0.0/zlib.c
13+
kitsh/buildsrc/kitsh-0.0/winMain.c
14+
kitsh/buildsrc/kitsh-0.0/mk4tcl.tcl
15+
kitsh/buildsrc/kitsh-0.0/mk4tcl.tcl.h
16+
kitdll/buildsrc/kitdll-0.0/rechan.c
17+
kitdll/buildsrc/kitdll-0.0/zlib.c
18+
kitdll/buildsrc/kitdll-0.0/kitInit.c
19+
kitdll/buildsrc/kitdll-0.0/boot.tcl
20+
kitdll/buildsrc/kitdll-0.0/pwb.c
21+
22+
Please see "kitsh/buildsrc/kitsh-0.0/license.terms" for licensing information
23+
regarding these files.
24+
25+
Files that are downloaded are under different licenses (grouped by project):
26+
* Tcl: Tcl/Tk License <http://www.tcl.tk/software/tcltk/license.html>
27+
* Tk: Tcl/Tk License <http://www.tcl.tk/software/tcltk/license.html>
28+
* Itcl: Tcl/Tk License <http://incrtcl.sourceforge.net/itcl/copyright.html>
29+
* Mk4tcl: MIT License <http://www.equi4.com/metakit/license.html>
30+
* TclVFS: BSD License
31+
* Thread: Tcl/Tk License <http://www.tcl.tk/software/tcltk/license.html>
32+
* ZLib: Zlib License <http://www.gzip.org/zlib/zlib_license.html>
33+
34+
The final result of this build process is a derivative work of all of these
35+
projects and is restricted by the cumulative licensing requirements of all of
36+
them.
37+
38+
All other files in this distribution are licensed under the terms of the MIT
39+
License, below:
40+
The MIT License
41+
42+
Copyright (c) 2010 Roy S. Keene
43+
44+
Permission is hereby granted, free of charge, to any person obtaining a copy
45+
of this software and associated documentation files (the "Software"), to deal
46+
in the Software without restriction, including without limitation the rights
47+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48+
copies of the Software, and to permit persons to whom the Software is
49+
furnished to do so, subject to the following conditions:
50+
51+
The above copyright notice and this permission notice shall be included in
52+
all copies or substantial portions of the Software.
53+
54+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
60+
THE SOFTWARE.

LICENSE.Packer

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015 Danyil Bohdan
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

LICENSE.TclKit

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Source: https://code.google.com/p/tclkit/.
2+
3+
LICENSE
4+
5+
The Tclkit-specific sources are license free, they just have a copyright.
6+
Hold the author(s) harmless and any lawful use is permitted.
7+
8+
This does *not* apply to any of the sources of the other major Open Source
9+
Software used in Tclkit, which each have very liberal BSD/MIT-like licenses:
10+
Tcl/Tk, Incrtcl, Metakit, TclVFS, Zlib

LICENSE.Tcllib

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
This software is copyrighted by Ajuba Solutions and other parties.
2+
The following terms apply to all files associated with the software unless
3+
explicitly disclaimed in individual files.
4+
5+
The authors hereby grant permission to use, copy, modify, distribute,
6+
and license this software and its documentation for any purpose, provided
7+
that existing copyright notices are retained in all copies and that this
8+
notice is included verbatim in any distributions. No written agreement,
9+
license, or royalty fee is required for any of the authorized uses.
10+
Modifications to this software may be copyrighted by their authors
11+
and need not follow the licensing terms described here, provided that
12+
the new terms are clearly indicated on the first page of each file where
13+
they apply.
14+
15+
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
16+
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
17+
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
18+
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
19+
POSSIBILITY OF SUCH DAMAGE.
20+
21+
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
22+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
23+
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
24+
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
25+
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
26+
MODIFICATIONS.
27+
28+
GOVERNMENT USE: If you are acquiring this software on behalf of the
29+
U.S. government, the Government shall have only "Restricted Rights"
30+
in the software and related documentation as defined in the Federal
31+
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
32+
are acquiring the software on behalf of the Department of Defense, the
33+
software shall be classified as "Commercial Computer Software" and the
34+
Government shall have only "Restricted Rights" as defined in Clause
35+
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
36+
authors grant the U.S. Government and others acting in its behalf
37+
permission to use and distribute the software in accordance with the
38+
terms specified in this license.

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Packer
2+
3+
A tool for building Starpacks that include Tcllib.
4+
5+
## Components
6+
7+
Tclkits built using Roy Keene's [KitCreator](http://kitcreator.rkeene.org/).
8+
9+
SDX comes the [Tclkit](http://equi4.com/tclkit/).
10+
11+
[Tcllib](http://tcllib.sourceforge.net/).

Tcllib-1.16.tar.gz

7.26 MB
Binary file not shown.

build.tcl

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env tclsh
2+
# Producer, a Starpack creation script.
3+
# Copyright (C) 2015 Danyil Bohdan.
4+
# License: MIT
5+
6+
set packerPath [file dirname [file dirname [file normalize $argv0/___]]]
7+
source [file join $packerPath packer.tcl]
8+
9+
foreach targetTclkit {
10+
tclkit-8.6.3-macosx10.5-ix86+x86_64
11+
tclkit-8.6.3-rhel5-ix86
12+
tclkit-8.6.3-rhel5-x86_64
13+
tclkit-8.6.3-win32.exe
14+
} {
15+
set buildOptions $::packer::exampleBuildOptions
16+
dict set buildOptions packerPath $packerPath
17+
dict set buildOptions targetTclkit $targetTclkit
18+
dict unset buildOptions testCommand
19+
::packer::build {*}$buildOptions
20+
}

packer.tcl

+205
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
#!/usr/bin/env tclsh
2+
# Producer, a tool for creating Starpacks out of Git repositories.
3+
# Copyright (C) 2015 Danyil Bohdan.
4+
# License: MIT
5+
6+
namespace eval ::packer {}
7+
8+
proc ::packer::init {} {
9+
variable exampleBuildOptions [::packer::sl {
10+
# Where Packer's files are located.
11+
packerPath [pwd]
12+
13+
# The path to the temporary directory in which the Starpacks are built.
14+
# Can be relative (to packerPath) or absolute.
15+
buildPath build
16+
17+
# The path where to place the resulting Starpacks.
18+
# Can be relative (to packerPath) or absolute.
19+
artifactsPath artifacts
20+
21+
# The Tclkit to run SDX with.
22+
buildTclkit {tclkit-8.6.3-rhel5-x86_64}
23+
24+
# The Tclkit to use as runtime in the Starpack.
25+
targetTclkit {tclkit-8.6.3-rhel5-x86_64}
26+
27+
# SDX Starkit.
28+
sdx {sdx-20110317.kit}
29+
30+
# Tcllib archive.
31+
tcllib {Tcllib-1.16.tar.gz}
32+
33+
# The Git repository to clone. Can be local or remote.
34+
sourceRepository {https://github.com/tclssg/tclssg}
35+
36+
# The directory
37+
projectDir {tclssg}
38+
39+
#
40+
targetFilename "tclssg.kit"
41+
42+
# Whether to append the targetTclkit's file extension (e.g., ".exe")
43+
# to the file name.
44+
appendTclkitExtension 1
45+
46+
# Which file within the projectDir the Starpack should run on start.
47+
fileToRun {ssg.tcl}
48+
49+
# Command line options to give to the Starpack to . Unset to not test.
50+
# Obviously, this work across architectures.
51+
testCommand {version}
52+
53+
# The string to append to the targetFilename before the extension. If
54+
# not set everything after the first dash in the targetTclkit's rootname
55+
# is used. E.g, if targetTclkit is "tclssg-8.6.3-win32.kit.exe" the
56+
# default suffix will be "-8.6.3-win32.kit"
57+
# suffix {}
58+
}]
59+
}
60+
61+
proc ::packer::build args {
62+
# Parse command line arguments.
63+
dict for {key value} $args {
64+
puts [format {%23s: %s} $key $value]
65+
set $key $value
66+
}
67+
68+
# Defaults and mutation ahead.
69+
set buildPath [file join $packerPath $buildPath]
70+
set artifactsPath [file join $packerPath $artifactsPath]
71+
if {![info exists suffix]} {
72+
set suffix -[join [lrange [split \
73+
[file rootname $targetTclkit] -] 1 end] -]
74+
}
75+
76+
# Define procs for running external commands.
77+
foreach {procName command} [list \
78+
git git \
79+
tar tar \
80+
tclkit [file join . $buildTclkit] \
81+
] {
82+
proc ::packer::$procName args [list apply {{command} {
83+
upvar 1 args args
84+
exec -ignorestderr -- {*}$command {*}$args
85+
}} $command]
86+
}
87+
88+
# Build start.
89+
file delete -force $buildPath
90+
file mkdir $buildPath
91+
92+
with-path $buildPath {
93+
git clone $sourceRepository
94+
95+
foreach file [list $buildTclkit $targetTclkit $sdx $tcllib] {
96+
file copy -force [file join $packerPath $file] .
97+
}
98+
file attributes $buildTclkit -permissions +x
99+
100+
file rename $projectDir "${projectDir}.vfs"
101+
102+
# Create the file main.tcl to start $fileToRun.
103+
write-file [file join "${projectDir}.vfs" main.tcl] [list \
104+
apply {{fileToRun} {
105+
global argv
106+
global argv0
107+
package require starkit
108+
if {[starkit::startup] ne "sourced"} {
109+
source [file join $starkit::topdir $fileToRun]
110+
}
111+
}} $fileToRun
112+
]
113+
114+
# Unpack Tcllib and install it in lib/tcllib subdirectory of the Starkit
115+
# VFS.
116+
tar zxvf $tcllib
117+
118+
with-path [regsub {.tar.gz$} $tcllib {}] {
119+
puts [exec -- \
120+
tclsh ./installer.tcl -no-wait -no-gui -no-html -no-nroff \
121+
-no-examples -no-apps -pkgs -pkg-path \
122+
[file join $buildPath "${projectDir}.vfs" lib tcllib]]
123+
}
124+
125+
# Wrap the Starpack.
126+
file copy $targetTclkit "${targetTclkit}.temp"
127+
tclkit $sdx wrap $targetFilename -runtime "${targetTclkit}.temp"
128+
file delete "${targetTclkit}.temp"
129+
130+
# Run the test command.
131+
if {[info exists testCommand]} {
132+
file attributes $targetFilename -permissions +x
133+
puts [exec -- [file join . $targetFilename] {*}$testCommand]
134+
}
135+
136+
# Store the build artifact.
137+
file mkdir $artifactsPath
138+
set artifactFilename \
139+
[add-suffix-before-extension $targetFilename $suffix]
140+
if {[info exists appendTclkitExtension] && $appendTclkitExtension} {
141+
append artifactFilename [file extension $targetTclkit]
142+
}
143+
file copy -force $targetFilename \
144+
[file join $artifactsPath $artifactFilename]
145+
}
146+
}
147+
148+
proc ::packer::read-file {fname {binary 0}} {
149+
set fpvar [open $fname r]
150+
if {$binary} {
151+
fconfigure $fpvar -translation binary
152+
}
153+
set content [read $fpvar]
154+
close $fpvar
155+
return $content
156+
}
157+
158+
proc ::packer::write-file {fname content {binary 0}} {
159+
set fpvar [open $fname w]
160+
if {$binary} {
161+
fconfigure $fpvar -translation binary
162+
}
163+
puts -nonewline $fpvar $content
164+
close $fpvar
165+
}
166+
167+
proc ::packer::with-path {path code} {
168+
set prevPath [pwd]
169+
cd $path
170+
uplevel 1 $code
171+
cd $prevPath
172+
}
173+
174+
proc ::packer::add-suffix-before-extension {filename suffix} {
175+
return "[file rootname $filename]$suffix[file extension $filename]"
176+
}
177+
178+
proc ::packer::sl script {
179+
# By Poor Yorick. From http://wiki.tcl.tk/39972.
180+
set res {}
181+
set parts {}
182+
foreach part [split $script \n] {
183+
lappend parts $part
184+
set part [join $parts \n]
185+
#add the newline that was stripped because it can make a difference
186+
if {[info complete $part\n]} {
187+
set parts {}
188+
set part [string trim $part]
189+
if {$part eq {}} {
190+
continue
191+
}
192+
if {[string index $part 0] eq {#}} {
193+
continue
194+
}
195+
#Here, the double-substitution via uplevel is intended!
196+
lappend res {*}[uplevel list $part]
197+
}
198+
}
199+
if {$parts ne {}} {
200+
error [list {incomplete parts} [join $parts]]
201+
}
202+
return $res
203+
}
204+
205+
::packer::init

sdx-20110317.kit

117 KB
Binary file not shown.

tclkit-8.6.3-macosx10.5-ix86+x86_64

6.54 MB
Binary file not shown.

tclkit-8.6.3-rhel5-ix86

4.56 MB
Binary file not shown.

tclkit-8.6.3-rhel5-x86_64

4.22 MB
Binary file not shown.

tclkit-8.6.3-win32.exe

5.41 MB
Binary file not shown.

0 commit comments

Comments
 (0)