goshenv provides a way to install and manage multiple versions of Gauche. It installs Gauche under ~/.goshenv/gauche directory. By making links to Gsuche binaries of the version users want to use, versions are switched. goshenv is written in bash, and uses get-gauche.sh script to install Gauche.
The following commands install goshenv using artifacts built on Github.
# Run prepare-goshenv.sh
curl -L https://github.com/niceume/goshenv/releases/latest/download/prepare-goshenv.sh -o prepare-goshenv.sh
bash ./prepare-goshenv.sh
# update PATH variable
source ~/.bashrc
# makes goshenv management commands available
goshenv init https://github.com/niceume/goshenv/releases/latest/download/goshenv-init.tgzprepare-goshenv.sh script creates ~/.goshenv and installs a specfied or the latest version of Gauche under ~/.goshenv/gauche directory. It also adds PATH environment variable setting for links under ~/.goshenv/shims to ~/.bashrc file. This script accepts the following options.
--version- default: latest
- available versions are listed at Gauche Releases
--with-tls- default: mbedtls-internal
- none/mebedtls/mbedtls-internal
--with-slib- default: latest
- none, latest, slib version or an absolute path to slib directory
- none skips slib installation
- latest installs the latest version of slib
- slib version can also be specified
- latest version and available slib versions are hardcoded.
- path should be specified by an absolute path beginning with /
--with-gdbm- default: latest
- latest, system or gdbm version can be specified.
- latest installs the latest version of gdbm.
- system does not install gdbm.
- gdbm version can specifies version of of gdbm to install
--run-tests- run tests when installing Gauche (default: tests are skipped)
--allow-skip-info- allow to skip to create info files when installing Gauche
‘goshenv init’ executed with the location of goshenv-init.tgz make goshenv management commands available.
The following installation uses artifacts generated locally. After downloading goshenv source, you can run the following commnads in the source directory to install goshenv.
# generates prepare-goshenv.sh & goshenv-init.tgz
make
# installs the latest Gauche
bash ./release/prepare-goshenv.sh
# prepare-goshenv.sh can optionally specify version and configure arguments
# The above code is equivalent to the following
# bash ./release/prepare-goshenv.sh --version latest --with-tls mbedtls-internal --with-slib latest
# update PATH variable
source ~/.bashrc
# makes goshenv management commands available
goshenv init ./release/goshenv-init.tgzGoshenv instructions are as follows. ‘goshenv <instruction> (optional arguments if accepted)’ runs goshenv instructions.
Install options for goshenv install are the same as install options in prepare-goshenv.sh script mentioned above. Gauche version can be specifed without option flags followed by intasll options.
Usage
goshenv <instruction> (optional arguments if accepted)
Instructions
installed : list installed versions
installable : list installable versions (snapshot/release)
installable-edge : list installable edge versions
install <version> <install-options>
install <install-options>
: install Gauche following <install-options>
switch <version> : switch to use <version>
remove <version> : remove <version>
update-db : update db info (installable version list)
Example
goshenv update-db
goshenv installable
goshenv install 0.9.15-p2 --with-slib 3c1goshenv works only in user’s home directory. To completely remove goshenv and installed Gauche, ‘rm -R -f ~/.goshenv’ works. Also remove lines related to PATH environment variable setting to Gauche links in ~/.bashrc file.
goshenv refers to the internal database of Gauche release and snapshot versions, which is first stored when goshenv is installed. After that, the database needs to be manually updated by “goshenv update-db”.
goshenv does not have functionality of reinstallation. To reinstall the version, it is needed to remove the version first and to install the version again. If there is only one version installed, it cannot be removed because currently used version cannot be uninstalled. In this case, another version of Gauche also needs to be installed.
Your feedback is welcome.
Maintainer: Toshihiro (Toshi) Umehara [toshi@niceume.com]