[lazarus] Package System, Test, Alpha, Unstable

Mattias Gaertner nc-gaertnma at netcologne.de
Mon May 12 15:38:40 EDT 2003


I have started the lazarus package system. (only cvs version).

This is the biggest change of the lazarus IDE since the codetools. So, it
has *alpha* state and there are probably a lot of bugs. So, it is nothing
for newbies.

See /your/lazarus/directory/docs/Packages.txt for details of the lazarus
package system and a quickstart.

Some notes:
- A lazarus package is a collection of units and components, containing
information how they can be compiled and how they can be used by projects or
other packages or the IDE. In contrary to Delphi, packages are not limited
to libraries and they can be OS independent.
(Delphi: a package is a specially compiled library used by applications, the
IDE or both. Delphi packages require compiler magic, which fpc is not
capable of at the moment and of course this magic is OS dependent.)

- Because a lazarus package is not neccessarily a library, you don't need to
install a package to use it. Your projects can use an arbitrary number of
packages of all kind. For example you can now put your favourite units in a
package and use them easily in all your projects without bothering about
search paths. The only advantage of an installed package is, that it can add
components and other extensions to the IDE. See the new project -> project

- Freepascal does not yet supports dynamic libs, and so you can't create
libs at the moment. But you can easily create unit collections and install
them into the IDE. Installation means, recompilation of the IDE and restart
it. This means to install packages your lazarus sources must be writable.
So, you can't install packages with a lazarus installed via rpm/deb a the
moment. Eventually there will be a lazarus loader, that will allow using
rpms/debs and installing packages.

Those familiar with the Delphi package system will find a lot of similar
dialogs and properties. But there are also some important differences:

- Delphi compiles everything into a few directories. There is an unit output
directory and a bpl output directory. Theoretically you can distribute your
bpl files and dcu files anywhere on your disk, but then you must edit a lot
of searchpaths manually. The paths become crowdy.
Under Lazarus it is 'normal' to have one output directory for each package.
All search paths are automatically collected and maintained by the IDE. This
keeps search paths short and your files sorted. 

- A Lazarus package is mainly the .lpk file (Lazarus Package File). The lpk
file is an xml file.

- The IDE tools and dialogs to edit packages differ from Delphi. Lazarus has
a package graph and inherited compiler options. The 'project explorer' is
called 'project inspector'. 
Under Delphi menu items like 'save' or 'save as', can save the project OR a
package, depending on the window in front. Under Lazarus these menu items
always belong to the project. The functions for 'save as' or 'uninstall' can
be found in the popupmenu of the package editor.


More information about the Lazarus mailing list