Installing ActiveState in a virtual machine using Vagrant

Posted by rinzler on 2017-02-12 13:13

Hi!

I would like to install ActiveTcl in a few virtual machines (Vagrant boxes) managed by Vagrant. I've already installed ActiveTcl manually on my host machine, and what I tried, since apparently there's no supported way of doing this, is to create a script that would install me ActiveTcl when provisioning the Vagrant boxes. The problem is that the installer of ActiveTcl is a UI wizard, and probably I can't install ActiveTcl through a script.

Why do I want to do this? Essentially because ActiveTcl comes with teacup, through which I can install additional Tk packages, particularly I'm interested in installing TkTable on different machines (different Linux distros, Mac OS X and possibly Windows) in a more or less automated and standard way, so that all users have access to Tktable.

If you're interested, this is the script I created (based on a post I found around, and which I'm also linking to it in a comment of the same, which talked about some possible conflicts between ActiveTcl and APT, i.e. apt-get)

#!/usr/bin/env bash

# Script to download ActiveTcl for x86_64 Linux machines

clean_activetcl() {
        printf "REMOVING DOWNLOADED USELESS FILES...\n"
        rm -rf ActiveTcl8.6.4.1.299124-linux-x86_64-threaded.tar.gz
        rm -rf ActiveTcl8.6.4.1.299124-linux-x86_64-threaded
        printf "DONE.\n\n"     
}

download_activetcl() {
        printf "DOWNLOADING 'ActiveTcl8.6.4.1.299124-linux-x86_64-threaded.tar.gz'...\n"
        wget http://downloads.activestate.com/ActiveTcl/releases/8.6.4.1/ActiveTcl8.6...
        printf "DONE.\n\n"     
}

unpack_activetcl() {
        printf "UNPACKING...\n"
        tar zxvf ActiveTcl8.6.4.1.299124-linux-x86_64-threaded.tar.gz
        printf "DONE.\n\n"     
}

install_activetcl () {
        printf "ENTERING INSIDE UNPACKED FOLDER...\n"
        cd ActiveTcl8.6.4.1.299124-linux-x86_64-threaded
        printf "DONE.\n\n"

        printf "STARTING INSTALLING 'ActiveTcl8.6.4.1.299124-linux-x86_64-threaded'...\n"
        sudo ./install.sh
        printf "DONE.\n\n"
}

clean_activetcl
download_activetcl
unpack_activetcl
install_activetcl
clean_activetcl

ls /opt

# Not to fuck up the APT packager manager...?!
# Based on: https://groups.google.com/forum/#!topic/comp.lang.tcl/7c5bfUcN1RE

sudo update-alternatives --install /usr/bin/tclsh tclsh /opt/ActiveTcl-8.6/bin/tclsh8.6 90 --slave /usr/bin/wish wish /opt/ActiveTcl-8.6/bin/wish8.6 --slave /usr/bin/tkcon tkcon /opt/ActiveTcl-8.6/bin/tkcon --slave /usr/bin/teacup teacup /opt/ActiveTcl-8.6/bin/teacup
sudo update-alternatives --install /usr/bin/tclsh tclsh /usr/bin/tclsh8.6 20
sudo teacup create
sudo teacup link make "/usr/lib/teapot" /usr/bin/tclsh
sudo teacup update
sudo teacup install Tktable

The script has not problem in downloading the ActiveTcl version specified and unpacking it, the current problem (among possibly future ones) is exactly when I install ActiveTcl by calling the script install.sh, where I need to accept the license, and it keeps showing forever:

...
==> default: Transactions Act or any version thereof, adopted by any state, in any
==> default: form ("UCITA"), shall not apply to this Agreement, and to the extent
==> default: that UCITA may be applicable, the parties agree to opt out of the
==> default: applicability of UCITA pursuant to the opt-out provision(s) contained
==> default: therein.
==> default: Cancel [no] => [RET]
==> default: Accept License [yes] => 'A' >>
==> default:
==> default: Do you truly wish to cancel the installation [y/N] ?
==> default: Cancel [no] => [RET]
==> default: Accept License [yes] => 'A' >>
==> default:
==> default: Do you truly wish to cancel the installation [y/N] ?
==> default: Cancel [no] => [RET]
==> default: Accept License [yes] => 'A' >>
==> default:
==> default: Do you truly wish to cancel the installation [y/N] ?
==> default: Cancel [no] => [RET]
==> default: Accept License [yes] => 'A' >>
==> default:
==> default: Do you truly wish to cancel the installation [y/N] ?
==> default: Cancel [no] => [RET]
==> default: Accept License [yes] => 'A' >>
...

This is probably due that I'm not able to accept the license from the terminal, given that the installer is a UI wizard. If that's the case, is there a way to solve it? Is there a way in general to install ActiveTcl in a VM using Vagrant? If not, it would be a great thing to have it.

I would really appreciate some help!