What is actually happening “under the hood” when GSRC installs a package is slightly more complicated than what has been described so far.
When you install a package, it is first actually installed to the /gnu/packages directory in a sub-directory with the name <package>-<version> (i.e. /gnu/packages/hello-2.7). In the example of the package hello, the executable hello is installed to /gnu/packages/hello-2.7/bin/hello instead of /gnu/bin/hello. All other files installed by the package are installed in a similar manner. Next, GSRC makes symbolic links to those files inside the parent /gnu directory. Thus, /gnu/bin/hello is ultimately a symlink to /gnu/packages/hello-2.7/bin/hello. This is referred to as “stowing”; a package with symlinks to its files installed in the system is said to be “stowed”.
When a new version of a package is released, you do not have to uninstall the previous version first. When hello 2.8 is built and installed, it is put into its own package directory, /gnu/packages/hello-2.8 and the directory of hello 2.7 is left untouched. When GSRC finalizes the installation, the old symlinks are removed and new ones are created to the latest version’s files. Thus, while there would then actually be two versions of the package installed, only the latest one would be stowed.
If you want to stow a particular version of the package, you may pass
GARVERSION variable to
make install. Be sure to
update the checksums when you do so, otherwise the process will fail!
$ make -C gnu/hello makesum install GARVERSION=2.7
If you had previously built version 2.7, then GSRC will merely re-stow
those files. Of course, if you have not previously built it, or if
you have previously run
make clean, the package will be built
Note: this method may fail if the package naming format or
compression algorithm has changed between versions (i.e. a change from
tar.gz to tar.xz); in this case you must also modify
Users wishing to maintain different configurations of a package may
take advantage of the
GARPROFILE variable. Its value is merely
appended to the package directory name, allowing you to have multiple
configurations of the same package version installed. For example:
$ make -C gnu/hello install CONFIGURE_OPTS="--disable-nls" GARPROFILE="-no-nls"
This would install the newly configured package to /gnu/packages/hello-2.8-no-nls.