{{{
#!comment
}}}
{{{
#!div style="width:15%; float:left; clear:none; margin-right:1em; background:#ffb; border:1px solid #b00; padding-left:1em; padding-right:1em"
[wiki:WikiStart Home] [[BR]] [[BR]]
'''TOL''' [[BR]] [wiki:Software Software] [[BR]] [wiki:Download Download] [[BR]] [wiki:Installation Installation] [[BR]] [wiki:Packages Packages] [[BR]] [wiki:OTAN OTAN] [[BR]] [[BR]]
'''TOL Project''' [[BR]] [wiki:About About TOL] [[BR]] [wiki:Manuals Manuals] [[BR]] [wiki:Development Development] [[BR]] [wiki:Rprojects R-Projects] [[BR]] [[BR]]
'''Other Links''' [[BR]] [wiki:TracGuide Trac Guide] [[BR]] [wiki:WikiTree Wiki Tree] [[BR]] [https://mms.tol-prj.org MMS]
}}}
{{{
#!div style="margin-left:20%; margin-right:20%; padding-left:2em; padding-right:2em"
{{{
#!comment
}}}
= Packages =
== Introduction ==
The idea of a package comes from the concept of modularity and the possibility of loading and
distributing a whole module as a unit. A TOL package is essentially a NameBlock
distributed in an .oza file.
The package distribution is usually accompanied by other complementary resources that can be: files containing icons or images,
documentation, libraries of compiled functions (written in C++ and distributed in .dll or .so files)
and even uncompiled TOL code (.tol files) used as examples.
On a programming-focused point of view, the package is the mentioned NameBlock containing a set of classes, structures, variables, functions and definitions.
== Names and versions ==
A TOL package is identifed by its name and version.
The '''name''' of the package matches with the name of the nameblock that represents it. It generally
follows a CamelCase structure.
The '''version''' consists of integers. The first (the high version number) shows if there has been an
important change in the structure and functionality. This new version could incorporate changes that break the compatibility
with previous code in use. The second number (the low version number) however shows changes that maintain the package-use compatibility. These changes could be corrections or new functionalities.
The package identifier is created by linking the name and two version numbers
{{{..}}} with a full-stop ({{{.}}}).
For example, the identifier {{{GuiTools.3.5}}} makes reference to version 3.5 of GuiTools, which
includes utilities for TOLBase graphical integration.
Some packages (usually those that contain binary libraries) show an additional name indicating the '''platform''' for which the package is compatible. This name appears after the name concatenated a number sign ({{{#}}}). For example, {{{TclCore#Win32GNU.8.407}}} is the {{{TclCore.8.407}}} package for TOL GNU-GCC compiled for Windows 32-bits.
== Official TOL Archive Network ==
The official repository of TOL packages is called '''OTAN''' ('''O'''fficial '''T'''OL '''A'''rchive '''N'''etwork). In this link: [wiki:OTAN] you can browse the full list of public packages.
Other local or private repositories can also be available.
== TolPackage ==
The TOL kernel provides a module to manage packages: '''!TolPackage'''.
This module allow TOL users to download, update or upgrade packages. It provides also utilities for creating and uploading packages. For more details, see [wiki:TolPackage].
=== Requiring a package ===
TOL provides a preevaluation directive: {{{#Require}}} to indicate the package requeriments.
{{{
#!cpp
#Require ;
}}}
When you ''compile'' a package requirement, TolPackage try to load the package, searching into the repositories, downloading and installing it if necessary.
== Package manager in TOLBase ==
From version 3 onwards, TOLBase includes a graphic interface especially designed to make the management of packages easier.
It can be accessed from the "Tools" menu, in the "Manage Packages..." option.
'''Screenshot''': Package manager in TOLBase.
[[Image(Screenshots:tolbase_tolpkg_01.png, width=500px)]]
The interface offers a list of all available packages from all of the of the repositories to which they have access for installation, updates or upgrades.
The package states are displayed with different icons:
* [[Image(source:tolp/trunk/tolbase/lib/toltk/images/p_no.gif)]] '''New:''' the package is not installed.
* [[Image(source:tolp/trunk/tolbase/lib/toltk/images/p_upd.gif)]] '''Update required:''' a more recent package of an identical version (an update) is available.
* [[Image(source:tolp/trunk/tolbase/lib/toltk/images/p_upg.gif)]] '''Upgrade required:''' a package with a superior version (an upgrade) is available.
* [[Image(source:tolp/trunk/tolbase/lib/toltk/images/p_unu.gif)]] '''Upgrade and update required:''' both an update and an upgrade are available for this package.
* [[Image(source:tolp/trunk/tolbase/lib/toltk/images/p_ok.gif)]] '''OK:''' the package is installed and does not need an update nor an upgrade.
Various actions can be carried out on packages. These are offered in the contextual menu.