A Linux source-based distribution located on very much inspired by the way they do things in *BSD.

Did have a reputation of being very bleeding edge for developers, but is not as up to date on Tcl and Tk as a developer would like.

If you have root access on your Gentoo machine you can more or less easily integrate new packages by making your own ebuild file and placing it somewhere where portage can find it, but not mess with it. Gentoo supports this through so-called overlay directories.

At the time of writing this, tcllib-1.8 was not present in the default Portage tree and I wanted to use that version. I also wanted to test out tktreectrl which was not included in Portage at all. Same applied for Tcl and Tk 8.5. These will be used as examples.

I did not want to challenge the task of having dependencies checked and so the first task is to make sure that a fairly recent version of Tcl and Tk are installed:

 $> sudo emerge dev-lang/tk

This will install the newest stable Tk and Tcl (because Tk depends on Tcl in Gentoo) depending on your settings and architecture. To install a testing or experimental package do something like:

 #> echo "dev-lang/tcl ~x86" >> /etc/portage/package.keywords
 #> echo "dev-lang/tk ~x86" >> /etc/portage/package.keywords
 #> emerge =dev-lang/tk-8.4.12

and the stable version should be replaced with a newer version. (In case the installed version is not new enough) Tcl and Tk 8.5 should be installed in parallell to the 8.4 tree, but that has to wait until we are ready.

The core packages of Tcl and Tk are located in dev-lang/tcl and dev-lang/tk. The rest is located in dev-tcltk/* in standard Portage. (Portage is the name of the package repository system used in Gentoo). It is important that the overlay directory structure follow the structure in Portage. Portage is normally located in /usr/portage. For the overlay directory structure it is suggested to use /usr/local/portage or, as I like to do, $HOME/portage.

To manage packages, Portage offers a python program called emerge. In order to tell emerge about the overlay directory edit the file /etc/make.conf and add the line:

 PORTDIR_OVERLAY="/usr/local/portage /home/myusername/portage"

We start with tcllib-1.8 and create a directory structure inside the overlay directory:

 $> mkdir -p $HOME/portage/dev-tcltk/tcllib 

Then we just copy the already existing tcllib-1.7.ebuild file from /usr/portage and rename it to tcllib-1.8.ebuild:

 $> cp /usr/portage/dev-tcltk/tcllib/tcllib-1.7.ebuild $HOME/portage/dev-tcltk/tcllib/tcllib-1.8.ebuild

We need to edit this ebuild because there are some paches applied which we want to ignore for now:

 $> vi $HOME/portage/dev-tcltk/tcllib/tcllib-1.8.ebuild

Comment out the epatch lines and save the file. Now we can finish the preparation by running

 $> ebuild $HOME/portage/dev-tcltk/tcllib/tcllib-1.8.ebuild digest

This will download tcllib-1.8 and create a md5 checksum for emerge. Now we can install tcllib-1.8:

 #> echo "dev-tcltk/tcllib ~x86" >> /etc/portage/package.keywords
 $> sudo emerge dev-tcltk/tcllib

Now tcllib-1.8 should hopefully be downloaded (from the local cache) and installed. If it doesn't work as planned then do

 $> sudo emerge =dev-tcltk/tcllib-1.7

in order to put back an official version.

Now we move on to see if we can get tktreectrl version 2.1 installed (It is a part of ActiveTCL and logically important to have available on _any_ distribution)

 $> mkdir -p $HOME/portage/dev-tcltk/tktreectrl
 $> vi $HOME/portage/dev-tcltk/tktreectrl/tktreectrl-2.1.ebuild

Insert into that file:

 inherit eutils

 DESCRIPTION="TkTreeCtrl is a flexible listbox widget for Tk"



 src_unpack() {
     unpack ${A}

 src_compile() {
    econf || die

 src_install() {
    make DESTDIR=${D} install || die
    dodoc ChangeLog PACKAGES* README STATUS *.txt

Then create the digest file

 $> ebuild $HOME/portage/dev-tcltk/tktreectrl/tktreectrl-2.1.ebuild digest

And then at the end install it:

 #> echo "dev-tcltk/tktreectrl ~x86" >> /etc/portage/package.keywords
 $> sudo emerge dev-tcltk/tktreectrl

and now the package should be compiled and installed for you. So far I have some problem with the documentation, but at least the important part is solved.

Next up is getting tkcon and then Tcl and Tk 8.5 onto the system.

2006-04-07, SB: Got frustrated that many of the packages that ActiveTcl provides do not have an ebuild for Gentoo. The uttermost frust was to face the fact that tkcon is not a part of standard Gentoo.

2006-04-09, SB: Updating. I use kuroo (emerge app-portage/kuroo) to manage my Gentoo packages, and the packages in the overlay does not show up in there, so I have to use emerge from the command line, which is not a big problem, but it has to be solved sometime.