Difference between revisions of "Install Packages/fr"

From Lazarus wiki
Jump to navigationJump to search
Line 14: Line 14:
 
Sous Linux, Lazarus est installé par défaut à l'emplacement '''/usr/share/lazarus''', sous Windows l'installeur vous donne le choix de l'emplacement d'installation des fichiers, pourvu que le chemin d'accès ne comporte aucun espace. Sur mon PC Windows Lazarus est installé ici :  '''G:/Lazarus'''. Quel que soit votre dossier d'installation de Lazarus, vous y trouverez des sous-dossiers. Dans ce cas, le premier sous-dossier (par ordre alphabétique) semble plutôt prometteur pour notre quête puisqu'il se nomme '''components'''.
 
Sous Linux, Lazarus est installé par défaut à l'emplacement '''/usr/share/lazarus''', sous Windows l'installeur vous donne le choix de l'emplacement d'installation des fichiers, pourvu que le chemin d'accès ne comporte aucun espace. Sur mon PC Windows Lazarus est installé ici :  '''G:/Lazarus'''. Quel que soit votre dossier d'installation de Lazarus, vous y trouverez des sous-dossiers. Dans ce cas, le premier sous-dossier (par ordre alphabétique) semble plutôt prometteur pour notre quête puisqu'il se nomme '''components'''.
  
As you can see there are a few subdirectories there, which remind us of databases. One sees an '''Interbase''', a '''mysql''', a '''sqlite''' and a '''sqldb''' directory. The first three contain database connection components and TDataset descendants for the respective databases. The last one, '''sqldb''', is more generic, as it consists of TSQLQuery (a TDataset) and TSQLTransaction which are used for all types of databases and a T??Connection to make the connection to the database.
+
Comme vous pouvez le remarquer, il y a plusieurs sous-dossiers ici, qui nous rappellent les bases de données. One sees an '''Interbase''', a '''mysql''', a '''sqlite''' and a '''sqldb''' directory. The first three contain database connection components and TDataset descendants for the respective databases. The last one, '''sqldb''', is more generic, as it consists of TSQLQuery (a TDataset) and TSQLTransaction which are used for all types of databases and a T??Connection to make the connection to the database.
 
In this article we will install the sqldb-package together with the connection for Interbase.
 
In this article we will install the sqldb-package together with the connection for Interbase.
  

Revision as of 21:25, 15 October 2007

Deutsch (de) English (en) español (es) français (fr) magyar (hu) 日本語 (ja) português (pt) русский (ru) slovenčina (sk) 中文(中国大陆)‎ (zh_CN) 中文(台灣)‎ (zh_TW)

Vue d'ensemble

En raison d'une demande populaire voici une première tentative de créer un petit "Install package HOW-TO".


Après l'installation de Lazarus beaucoup de débutants se demandent où sont les composants pour la manipulation des bases de données. Vous pouvez voir un datasource et quelques composants données courants, mais où sont donc les composants permettant de se connecter à une base de données (serveur) et de récupérer les données depuis ce serveur ?

Bien, jetons un coup d'oeil pour voir si l'on peut trouver ce genre de choses.

Fichiers installés avec Lazarus

Sous Linux, Lazarus est installé par défaut à l'emplacement /usr/share/lazarus, sous Windows l'installeur vous donne le choix de l'emplacement d'installation des fichiers, pourvu que le chemin d'accès ne comporte aucun espace. Sur mon PC Windows Lazarus est installé ici : G:/Lazarus. Quel que soit votre dossier d'installation de Lazarus, vous y trouverez des sous-dossiers. Dans ce cas, le premier sous-dossier (par ordre alphabétique) semble plutôt prometteur pour notre quête puisqu'il se nomme components.

Comme vous pouvez le remarquer, il y a plusieurs sous-dossiers ici, qui nous rappellent les bases de données. One sees an Interbase, a mysql, a sqlite and a sqldb directory. The first three contain database connection components and TDataset descendants for the respective databases. The last one, sqldb, is more generic, as it consists of TSQLQuery (a TDataset) and TSQLTransaction which are used for all types of databases and a T??Connection to make the connection to the database. In this article we will install the sqldb-package together with the connection for Interbase.

The real work

First: the why

Before we start installing a package I like to discuss the why of Lazarus not installing database connection components. Database connection components need the client libraries to be available on the PC where the components are used. Because of the fact that at the moment Lazarus does not support dynamic linking, all libraries have to be compiled into the IDE. As you cannot expect every developer to have all databases installed it is not possible to install the connection components by default.

Second: But Delphi ...?

Delphi also only installs the database components which are readily available on the computer (ADO components) and components which do not need any client libraries (BDE: Paradox, DBase) to be installed.

Third: Lets install some stuff

To install a package one goes to "Components -> Open Package File (.lpk)" In the following dialog you navigate to /usr/share/lazarus/components/sqldb or the corresponding directory under Windows and choose the sqldblaz.lpk file. If everything works out as planned you will see the Package Manager. The Package Manager is showing a treeview with the files in the package and the required packages. Press now Compile if you don't want to install the component into the IDE, otherwise you should press Install. Next we get a warning about Lazarus only supporting static linked libraries and the question if you want to rebuild Lazarus. Just press Yes and sit back. Lazarus will be rebuilt, and depending on your configuration restarted.

If everything went well you'll see a new tab called SQLdb. This tab will contain two components a TSQLConnection and a TSQLQuery. What we need next is a Connection component. Once again go to Components -> Open Package File and navigate to /usr/share/lazarus/components/sqldb/interbase. Open the ibconnectionlaz.lpk file and again press Compile and Install and Yes. :)

Next time Lazarus is started the SQLdb tab also contains a component TIBConnection.

in the meantime all supported components.

Anything else?

Well that is all there is to it. You're now set to make your first program connecting to an Interbase server. See this sources to download with a small example. If you have any questions, go to the lazarus forum or post it to the lazarus mailing list.

Compile an IDE with packages at command line

There is no command line tool yet, to configure and setup the IDE config files to add/remove packages. You must setup this with an IDE, copy the configs and adapt the path. But the rest can be done on command line:

First build a normal IDE and LCL

 make clean all

Then compile the packages

The IDE can create a Makefile for a package (package editor -> compiler options -> compilation). The Makefile is updated on every compile of the package. Once you have this Makefile, go to every package directory and type 'make'.

Finally compile the IDE with the packages

 make idepkg