11. The ScmPkg Package System
ScmPkg is a package distribution system for Scheme. It is currently supported by Bigloo and STklos. This package system provides new APIs to Scheme (e.g., network programming, cryptography, encoding, …) and it manages automatic package installation, deinstallation and testing.
11.1. ScmPkg "tutorial"
stklos-pkg
is the command which gives access to ScmPkg in STklos.
This is the only command necessary to manage ScmPkg packages. For
instance, this command manages a local cache of the ScmPkg server, permits
(de)installation of ScmPkg packages, the test of packages, …
To start, we can synchronize our local repository with the ScmPkg servers. This can be done by the following command:
$ stklos-pkg --sync
This will download a description of the ScmPkg packages which are available. The list of these packages can be displayed with:
$ stklos-pkg --list
_bigloo-1.0.1 (tuning)
_bigloo-regexp-0.0.1
_bigloo-stdlib-0.0.1 (tuning)
_chicken-0.0.1 (tuning)
_chicken-net-0.0.1 (tuning)
_chicken-os-0.0.1
rfc3339-0.2.0
srfi1-0.0.1 (tuning)
$
Packages whose name start by an underscore are packages needed for alien language support (e.g. the package "bigloo" is necessary to run a package written in the Bigloo Scheme dialect, or the package "_chicken-net" is necessary for the packages using the network primitives of the Chicken Scheme dialect). Some packages may offer a tuning. A tuned package is a package which has been specially tuned for _STklos (e.g. the generic "srfi1" package which implement SRFI-1 has been tuned to be more efficient in STklos)
To download a new package (and all its dependencies), one can simply issue the following command:
$ stklos-pkg --extract PKG --directory /tmp/Test
This command downloads the package PKG, its dependencies
and (eventually) its tuning. It also creates a Makefile
for compiling the package. The --directory
option
specifies where the files must be extracted in the /tmp/Test
directory (instaed of the current directory). The generated Makefile
offers the following main targets
-
all : the default target
-
test: to launch the package tests
-
install: to install the package for the user
-
system-install: to install the package system wide (privilegied access rights are probably needed)
To test a package, one can also use the following command:
\type{$} stklos-pkg --test PKG
This downloads the necessary files in a temporary directory, and launches the tests of the package PKG
To install a package, one can also use the following command:
$ stklos-pkg --install PKG
This command downloads the necessary files in a temporary directory, and installs the package PKG.
This completes the basis ScmPkg tutorial. See below for the list of all stklos-pkg options
11.2. stklos-pkg options
Here are the options supported by the stklos-pkg command
Usage: stklos-pkg [options] [parameter ...] Actions --extract=<pkg>, -e <pkg> Extract <pkg>. Don't install it --test=<pkg>, -t <pkg> Test <pkg>. --install=<pkg>, -i <pkg> Extract, compile, Install <pkg>. --uninstall=<pkg> un-install package <pkg> Repository administration --sync, -s synchronize with remote server servers --add=<sb>, -a <sb> Add <sb> pkgball to the local repository --download=<pkg> download <pkg> --fill-cache fill cache with available distant packages --clear-cache delete packages present in cache --reset reset stklos-pkg repository. USE WITH CAUTION --build-sync-file=<dir> Build a synchronization file from <dir> Informations --list, -l list available packages --depends=<pkg> Show all the dependencies of <pkg> --installed Show installed packages Misc --conf-dir=<dir>, -D <dir> Use <dir> as stklos main configuration directory --directory=<dir>, -C <dir> Change to directory <dir> (extract/download) --verbose, -v be verbose (can be cumulated) --system-wide, -S do a system wide (de)installation --version, -V print the version and exit --help, -h display this help --options display program options --cp INTERNAL USE ONLY. Do not use this option