Version 3 of kbs packages

Updated 2008-07-04 09:50:19 by RZ

kbs means Tclkit Kitgen Build System


Syntax of package definitions

Here comes the Syntax in pseudo code. Keyword start with upper letters. Comments after ;#. ====

 package: Package package-name package-script
 package-name: TEXT ;# used as dir name in build process
 package-script: {
  ?require?
  source
  configure
  ?make?
  ?install?
  ?clean?
  ?test?
 }
 require: Require ?package-name? .. ;# list of packages to build in front of current package
 source: Source type args ;# put sources in './sources/<package-name>'
  "script {..}" ;# run given script to get sources
  "link <dir>" ;# use given ./sources/<dir> as source dir
  "cvs path args" ;# get source with 'cvs' from 'path' and use additional 'args'
  "fetch http:<file>" ;# get source file with http (extensions: tgz, tar.gz, zip)
 configure: Configure script ;# run 'script' in [Makedir]
 make: Make script ;# run 'script' in [Makedir]
 install: Install script ;# run 'script' in [Makedir]
 test: Test script ;# run 'script' in [Makedir]
 clean: Clean script ;# run 'script' in [Makedir]

====


Questions

  • What is a package?

Originally it is a Tcl extension based on the TEA system. but you can use whatever you want. It needs to build in the common configure/make/make install cycle.

  • What do I need to build one?

A 'Package' definition in the "sources/kbskit-8.5/kbskit.kbs" file. The file will be sourced on startup. It contain the available package definitions.

  • What additional procedures are available?

See the documentation of 'kbs.tcl' for procedures matching '::kbs::config::*'

  • How I create the documentation of 'kbs.tcl'?
 ./kbs.tcl doc

The html documentation can then be found in the './doc' directory

  • How can a build different versions?

Use the '-builddir=..' switch. Do not mix different tcl versions in the build process!

 .kbs.tcl -r -builddir=b85 install kbskit-8.5
 .kbs.tcl -r -builddir=b86 install kbskit-8.6
  • How can I customize the build process?

Create your own *.kbs p.e. './sources/z/z.kbs' with:

 source [file join sources kbskit-8.5 kbskit.kbs]
 set ::kbs::config::_(THREADS)   {--disable-threads}
 set ::kbs::config::_(64BIT)     {--disable-64bit}
 set ::kbs::config::_(SYMBOLS)  {--enable-symbols}
 Package z-0.1 {
  Require kbskit-8.5
  Source link z
  Configure {}
  Install { Tcl z0.1 }
 }

and run it with:

 ./kbs.tcl -pkgfile=sources/z/z.kbs install z-0.1
  • How can I build starkits/starpacks?

Use the 'Kit' procedure in Make, Install, Clean and Test definitions. If you have a 'main.tcl' as startup file you can use

 Package foo-0.1 {
   Require bar-0.1
   Source link foo-0.1
   Configure {}
   Make { Kit make foo bar0.1 }
   Install { Kit install foo -gui }
 }

and without 'main.tcl' you can create one with:

   Configure { Kit configure foo {source $::starkit::topdir/foo.tcl} bar }

To create starkits just remove the '-gui' switch.


Examples

  • Provide default version for 'Require' command:
 Package tcl { Require tcl-8.5 }
  • Checkout with tag and from HEAD
 Source cvs tcllib.cvs.sourceforge.net:/cvsroot/tcllib -r tklib-0-4-1 tklib
 Source cvs tclx.cvs.sourceforge.net:/cvsroot/tclx
  • Get file with http
 Source fetch http://www.sqlite.org/sqlite-3_3_17-tea.tar.gz
  • Use sources from another Package
 Source link itcl-3.3
  • Use different directory names for windows builds
 [Builddir tcl] -- used in tcl commands ("C:/")
 [Builddir sys] -- used in system commands e.g. make ("/c/")
  • Build starpack from self running file:

See p.e. 'Package tksqlite-0.5.6 ..' in 'sources/kbskit-8.5/kbskit.kbs'

  • Build starkits:

See p.e. 'Package tksqlite-0.5.6 ..' in 'sources/kbskit-8.5/kbskit.kbs'. Just remove the '-gui switch'.


[ Category Tclkit | Category Deployment Category Development ]