Difference between revisions of "Install Packages"

From Lazarus wiki
Jump to navigationJump to search
 
(20 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
{{Install Packages}}
 
{{Install Packages}}
  
== Visão geral ==
+
== Adding packages using the IDE ==
 +
=== Adding known packages ===
 +
Open "Package -> Install/Uninstall Packages".
 +
The list on the left shows already installed packages or packages marked for installation (which have a green plus sign in their icon). The list to the right shows packages that you can install.
 +
Simply double-click on a package in either list to move them to the other - and mark them for installation/uninstall.
  
Graças à demanda popular aqui está uma primeira tentativa de criar um pequeno pacote "Install package HOW-TO".
+
Finally, click "Save and Rebuild" to rebuild the IDE and the packages.
  
 +
You can also compile and install packages the IDE knows nothing about. See below.
  
Após a instalação do Lazarus uma série de iniciadores ficam onde os componentes para manipulação de bases de dados estão. Você pode ver um datasource e alguns componentes de acesso a dados, mas onde estão os componentes para conectar a uma base de dados (servidor) e para manipular os dados deste servidor?
+
=== Adding new packages ===
 +
The package should have come with a number of source files, especially one with a .lpk extension.  To install this package one goes to "Package -> Open Package File (.lpk)".
 +
Navigate to the folder containing the .lpk file and open it.  If everything works out as planned you will see the Package Manager. The Package Manager shows a treeview with the files in the package and the required packages.
  
Bem, vamos ver se conseguimos alguns deles.
+
If you don't want to install the component into the IDE, e.g. because it is a non graphical component, press '''Compile'''.
 +
Otherwise you should press '''Use >>''' and then choose '''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.
  
== Files installed with Lazarus ==
+
If the package was a graphical component, and you selected the '''Use >>''' option, you should now have a new tab in your IDE by which you can add that component to your project.
  
Under Linux Lazarus gets installed by default in '''/usr/share/lazarus''', in Windows the installer gives you a choice where to install the files, as long as there are no spaces in its path. On my Windows PC Lazarus got installed in '''G:/Lazarus'''. Whatever the base path of your Lazarus installation is, there you will find some subdirectories. In this case the first (alphabetically) sub directory looks rather promising to our goal as it is called '''components'''.
+
=== New versions ===
 +
When receiving a new source version of an already installed package, you must
 +
#overwrite the previous source version with the new version
 +
#either open the new .lpk and press '''Use >>''' and then choose '''Install''' as above,<br>or rebuild the IDE using the menu "Tools" -> "Build Lazarus with Profile [...]" if you want more control on how the package is compiled.
  
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.
+
== Compile an IDE with packages at command line ==
In this article we will install the sqldb-package together with the connection for Interbase.
+
You can use [[lazbuild]] to compile and install your package, and add --build-ide to rebuild the IDE.
 
 
== O trabalho realmente ==
 
=== Primeiro: o porquê ===
 
Antes de iniciarmos a instalação de um pacote, eu gostaria de discutir o porquê do Lazarus não instalar componentes de conexão à bases de dados. Esses componentes precisam das bibliotecas cliente para estarem disponíveis no PC enquanto os componentes são utilizados. Pelo fato de que no momento o Lazarus não suportar ligação dinâmica, todas as bibliotecas devem ser compiladas dentro da IDE. Como não se espera que todo desenvolvedor tenha todas as bases de dados instaladas, não é possível instalar os componentes de conexão por padrão.
 
 
 
=== Segundo: Mas e o Delphi ...? ===
 
O Delphi também instala apenas os componentes de acesso a bases de dados que realmente estão disponíveis no computador (componentes ADO) e os componentes que não precisam de bibliotecas cliente (BDE: Paradox, DBase) para serem instalados.
 
=== Terceiro: Vamos instalar alguma coisa ===
 
Para instalar um package, vá a "Components -> Open Package File (.lpk)"
 
No diálogo seguinte, navegue para '''/usr/share/lazarus/components/sqldb''' ou para o diretório correspondente no Windows e escolha o arquivo '''sqldblaz.lpk'''. Se tudo ocorrer como planejado, você verá o Gerenciador de Pacotes. Ele mostra um treeview com os arquivos no pacote e os pacotes necessários. Pressione '''Compile''' se você não quiser instalar o componente dentro da IDE, caso contrário pressione '''Install'''. Em seguida você receberá uma mensagem de alerta dizendo que o Lazarus suporta apenas bibliotecas ligação estática e pergunta se você quer reconstruir o Lazarus. Apenas pressione Yes. O Lazarus será reconstruído, e dependendo de sua configuração, reiniciará.
 
  
Se tudo ocorrer de modo satisfatório, você verá uma nova aba chamada '''SQLdb'''. Esta aba irá conter <strike>os componentes TSQLConnection e TSQLQuery. A seguir, o que precisaremos é de um componente de conexão. Mais uma vez vá a Components -> Open Package File e navegue para '''/usr/share/lazarus/components/sqldb/interbase'''. Abra o arquivo ibconnectionlaz.lpk e novamente pressione Compile e Install e Yes. :)
+
== Questions ==
 +
If you have any questions, go to the lazarus [http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=index forum] or post it to the Lazarus mailing list.
  
Na próxima vez que o Lazarus for inicializado, a aba SQLdb também conterá um componente TIBConnection. </strike>
+
==See also==
 
 
em pouco tempo todos os componentes suportados.
 
 
 
== 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 [http://prdownloads.sourceforge.net/lazarus-ccr/IBdemo-20050328.zip?download sources] to download with a small example. If you have any questions, go to the lazarus [http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=index 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 ===
+
* [[Lazarus Packages]]
  make clean all
+
* [[Install IDE packages without the IDE]]
=== 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 ===
+
[[Category:Lazarus]]
  make idepkg
+
[[Category:Tutorials]]

Latest revision as of 18:08, 13 April 2017

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

Adding packages using the IDE

Adding known packages

Open "Package -> Install/Uninstall Packages". The list on the left shows already installed packages or packages marked for installation (which have a green plus sign in their icon). The list to the right shows packages that you can install. Simply double-click on a package in either list to move them to the other - and mark them for installation/uninstall.

Finally, click "Save and Rebuild" to rebuild the IDE and the packages.

You can also compile and install packages the IDE knows nothing about. See below.

Adding new packages

The package should have come with a number of source files, especially one with a .lpk extension. To install this package one goes to "Package -> Open Package File (.lpk)". Navigate to the folder containing the .lpk file and open it. If everything works out as planned you will see the Package Manager. The Package Manager shows a treeview with the files in the package and the required packages.

If you don't want to install the component into the IDE, e.g. because it is a non graphical component, press Compile. Otherwise you should press Use >> and then choose 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 the package was a graphical component, and you selected the Use >> option, you should now have a new tab in your IDE by which you can add that component to your project.

New versions

When receiving a new source version of an already installed package, you must

  1. overwrite the previous source version with the new version
  2. either open the new .lpk and press Use >> and then choose Install as above,
    or rebuild the IDE using the menu "Tools" -> "Build Lazarus with Profile [...]" if you want more control on how the package is compiled.

Compile an IDE with packages at command line

You can use lazbuild to compile and install your package, and add --build-ide to rebuild the IDE.

Questions

If you have any questions, go to the lazarus forum or post it to the Lazarus mailing list.

See also