Sign in Join
Wiki copytemporary

Lazarus Packages/fr

Deutsch · English · Español · Français · Português · Slovenčina · Русский · 日本語

Vue d'ensemble du système de paquet de Lazarus

Qu'est-ce qu'un paquet de Lazarus ?

Un paquet de Lazarus est une collection d'unités et de composants, contenant de l'information sur comment ils peuvent être compilés et comment ils peuvent être employés par des projets ou d'autres paquets ou l'ide. Contrairement à Delphi, les paquets ne sont pas limités aux bibliothèques et ils peuvent être indépendant de l'OS . (Les paquets de Delphi sont des bibliothèques spécialement compilées utilisé par des applications, l'ide ou tous les deux. Les paquets Delphi exigent un support interne au compilateur, ce que FPC n'est pas capable de faire en ce moment et naturellement cette prouesse est dépendante du système d'exploitation.)

Actuellement le compilateur Free Pascal supporte seulement les paquets statiques. Par conséquent vous devez compiler puis redémarrer l'IDE, chaque fois qu'un paquet est installé ou désinstallé.

Un paquet Lazarus est identifié/distingué par son nom et sa version.

FAQ

Q: Dois-je installer un paquet ?
A: Vous devez seulement installer un paquet , s'il contient des items designtime, comme des composants pour la palette de composants de l'IDE. Si vous n'employez pas ces items, vous n'avez pas besoin d'installer le paquet. Si vous voulez seulement employer un paquet dans votre projet, ne l'installer pas.

Q: J'ai installé un paquet, mais l'IDE n'a pas trouvé les unités
A: Le fait d'installer un paquet signifie que le paquet est intégré à l'IDE, non votre projet. Ce sont des choses séparées . Pour utiliser un paquet dans votre projet, utilisez Projet -> Inspecteur de projet -> Ajouter -> Nouvelle condition. Et désinstallez le paquet s'il ne contient aucun gadget pour l'IDE.

Quick Start

To see the packagesystem in action and to get used to it, do the following:

Creating a new package:

Congratulations: You have just created your first package!

Adding a new component:

Congratulations: You have just installed your first package with your first package component.

The IDE menu items for packages:

Creates a new package.

 Here you can see, what packages are required by the currently open project.
 You can add new dependencies and remove unneeded ones.

 Here you can see what compiler options are inherited from which package.

Components ->

 - 'Open package'
   A dialog shows all open packages with their state.
   
 - 'Open package file'
   Open a .lpk file

 - 'Open package of current unit'
   Open the .lpk file, that belongs to the file in the source editor
   
 - 'Open recent package'
   Open a recently open package file (lpk file)

 - 'Add active unit to a package'
   Adds the unit in the source editor to a package
   
 - 'Package Graph'
   The package graph shows all open packages and their dependencies.

 - 'Configure installed packages'
   Edit the list of packages installed in the IDE. Install or uninstall several packages at once.

Project -> Project Inspector

 Here you can see and edit all packages used by the project.

The theory

Each Lazarus package has a .lpk file. A package is identified by its name and its version. The name must correspond to the lpk filename. For example:

Name: Package1, Version: 1.0, Filename: /home/.../package1.lpk.

For example:

This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install
the package GTKOpenGL 1.0.
 unit GTKOpenGL;
interface
uses GTKGLArea, GTKGLArea_Int, NVGL, NVGLX, LazarusPackageIntf;
implementation
procedure Register;
begin
  RegisterUnit('GTKGLArea', @GTKGLArea.Register);
end;
initialization
  RegisterPackage('GTKOpenGL', @Register)
end.

For example: gtkopengl.compiled:

<?xml version="1.0"?>
<CONFIG>
  <Compiler Value="/usr/bin/ppc386" Date="781388725"/>
  <Params Value=" -Rintel -S2cgi -CD -Ch8000000 -OG1p1
    -Tlinux -gl -vewnhi -l -Fu../../../lcl/units
    -Fu../../../lcl/units/gtk -Fu../../../packager/units
    -Fu. -FElib/ gtkopengl.pas"/>
</CONFIG>

Hints and Tips

Please add any hints, tips or gotchas here.

Example

I will use the tiOPF framework as an example  The tiOPF has the
following directory layout, due to the fact that it compiles for FPC,
Delphi 5-7, D2005 and D2006.\

Source                <= full path \Programming\3rdParty\tiOPF\Source
 \Compilers
    \Delphi7          <= Delphi 7 package files live here
    \D2005
    \FPC              <= the tiOPF.lpk lived here
 \Core                <= core unit files
 \Options             <= optional unit file for extra features
 \GUI\

Using this example, I included in the "Options - Usage - Units"
editbox the following paths:
"$(PkgOutDir);..\..\Core;..\..\Options;..\..\GUI" which will be added
to whatever project uses this package.

Contributors and Comments

This page has been converted from the epikwiki version.


From the Free Pascal wiki, page "Lazarus Packages/fr", as it stood on 2007-07-21 after a change by Paulatreides, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.