[Lazarus] Creating packages - what to include?

Bo Berglund bo.berglund at gmail.com
Mon Dec 28 16:14:09 CET 2020

I have created a number of classes that are useful in multiple
projects. Originally I have copied the source files between the
projects in order to use the classes, but it has resulted in
differences between the projects regarding the source files when I
modify the class.

So I am looking for a different approach using packages instead, but I
have never created an fpc package myself before, just used those that
I could download...

What is the best approach?
- Create one package for each class
- Create a multi-class package

I can see that if I create my-nonvisual-classes.lpk and add a number
of class files to that package then every project where I use one of
these will get *all* of them included, right?

But if I make one package for each class then I have to "install" a
number of packages every time I install Lazarus for a new version or
on a new device....

I don't want every project I do polluted with all classes I am dealing
with here but I fear that will be the case if I make a big package for
all classes.

So how to best approach this?
Specifically I am talking about non-GUI classes, since the ones with a
GUI are probably best installed into the Lazarus IDE itself.

(I am right now in a situation where I have two projects using a class
where there are different modifications in both, which I have to

I am using subversion to manage my sources and now I have dirtied that
by putting the class files as copies in several projects, not good..

Bo Berglund
Developer in Sweden

More information about the lazarus mailing list