Packages

This is an old revision of Packages, edited by Marcov at . The current revision is 38366.

FPC/Lazarus unfortunately are a bit ambiguous with respect to the term packages. In general it is a collection of units, but the precise way they are related varies. The most common definitions:

  1. A set of units in FPC that are treated together. Both in the fpcmake as the newer fppkg packagemanager contexts.
  2. A set of units in Lazarus (with designtime parts that require registration into the DLL). See Lazarus Packages
  3. A set of units compiled into a DLL with some extra features that make the package a logical part of the main program, instead of an "external" part. Also called Delphi package. I call this Library package from now on.

This article is meant as a brainstorm session about the latter, one of the missing pieces of the Delphi compability. Most created from browsing an hour on the web, looking at articles about fixes and modding the packages system

Note that in time Lazarus packages might be implemented as Delphi packages.

Delphi packages

Maybe Delphi packages is a bad name btw. Library package would be better? I'll at least use it for this article till something better comes up.

A Library-package is essentially a DLL with some extra's.

References

What needs to be done

The following points are very roughly the steps to be taken.

  1. RTL into a DLL
  2. mainprogram uses RTL, and can access all symbols it could without. (properties, vars, typed constants, functions, RTTI)
  3. Add another package to the mix. (and multiple in general)
  4. Try to dynload package.
  5. anything else
    1. (more delphi compat, but will probably happen evolutionary)
    2. Meta data to better automated manage packages. (iow, being able to read the dependancies of a package, what units are in it, timestamps etc)

This might require PPU changes to list what package an unit is in, _OR_ a kind of library PPU that lists the units in a package as well as some timestamping CRCs etc.

Lazarus and Library packages

Well, first there needs to be a base package system, but then Delphi packages could be loaded too.