Sign in Join
Wiki copytemporary

Install IDE packages without the IDE: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Install with command line tool lazbuild
22
33With current Lazarus, it is possible to compile and install IDE packages using the lazbuild tool. See [[lazbuild]].
44
55## Install manually without IDE nor lazbuild
66
77For completeness/reference, the old version of this article is presented below.
88
99> **Warning:** Old information below. There is a much easier way to install packages in current Lazarus.
1010
1111To manually install a package in the IDE you need the following
1212
1313- compiled lazbuild (LCL, components, lazbuild)
1414- all required packages must be setup and compiled
1515- the .lpk file must be registered
1616- setup the \$HOME/.lazarus/staticpackages.inc file (or corresponding file in your primary config path)
1717- setup \$HOME/.lazarus/idemake.cfg (or corresponding file in your primary config path)
1818- compile the package with lazbuild
1919- execute *make idepkg*
2020
2121### Quick
2222
2323The easiest way is to install the package in the IDE, copy the needed files to the target directory/filesystem and adapt the filenames.
2424
2525### Compile lazbuild
2626
2727Install FPC and lazarus - or do a make lazbuild. See .
2828
2929### Compile and register the required packages
3030
3131Do the steps on this page recursively until only the base Lazarus packages are needed.
3232
3333### Register the .lpk file
3434
3535The IDE must find the .lpk file for a packagename. It searches the .lpk file in the following places:
3636
3737- In the \$HOME/.lazarus/packagefiles.xml file
3838- In the \<lazarus_path\>/packager/globallinks/
3939
4040### Setup the \$HOME/.lazarus/staticpackages.inc file
4141
4242Create this file if it does not exist. Add the packagename plus a comma to this file. For example this file can look like this:
4343
44-` Printer4Lazarus,`\
45-` RunTimeTypeInfoControls,`\
46-` H2PasWizard,`
44+```text
45+ Printer4Lazarus,
46+ RunTimeTypeInfoControls,
47+ H2PasWizard,
48+```
4749
4850### Setup \$HOME/.lazarus/idemake.cfg
4951
5052The idemake.cfg contains the compile parameters. The easiest way to create this file is to install the package in a IDE and then copy the file to the target machine and adapt the file paths.
5153
5254Please note that under Windows you need to place idemake.cfg into Lazarus directory (e.g. C:\Lazarus\\) instead of your user profile directory. Note: May 2012 BigChimp: is this still true? I found it in my primary config path!!
5355
5456### Compile the package with lazbuild
5557
5658``` bash
5759lazbuild path_to_package.lpk
5860```
5961
6062### Execute *make idepkg*
6163
6264``` bash
6365cd path_to_lazarus
6466make idepkg
6567```
6668
6769## Distributing an IDE with preinstalled packages
6870
6971### Third party packages
7072
7173Let's say you copied the third party package "Closy" into lazarus/components/closy. When the IDE searches for a package "closy", it searches in its recently used list and in \<lazarus\>/packager/globallinks. An installer should use the latter.
7274
7375Create an .lpl file:
7476
75-`lazarus/packager/globallinks/closy-1.lpl`
77+```text
78+lazarus/packager/globallinks/closy-1.lpl
79+```
7680
7781The file name of the lpl file consists of \<package name\>-\<short version\>.lpl. In this example the package name is the **lowercase** "closy". Closy has the version *1.0.0.0*. Trailing *0* can be omitted, creating the short version *1*. The file must contain the path to the lpk:
7882
79-`$(LazarusDir)/components/closy/closy.lpk`
83+```text
84+$(LazarusDir)/components/closy/closy.lpk
85+```
8086
8187### Compile the IDE
8288
8389- Execute **make clean all** to update lazbuild, startlazarus and other tools.
8490- Use the IDE or lazbuild to install all needed packages and compile the new IDE.
8591
8692Hint: Since 1.2 lazbuild contains the option --add-package to install packages.
8793
8894- You now have a lazarus directory with all needed .ppu files, the lazarus executable and common tools.
8995
9096### User Options
9197
9298Now you need to setup the start configuration for the user.
9399
94100When the IDE starts, it loads its configuration files from the PCP (*primary config path*). If it cannot find a configuration file it tries the SCP (*secondary config path*) and copies the file from the SCP directory to the PCP directory.
95101
96102- You can pass the PCP and SCP as command line options --pcp=\<path\> and --scp=\<path\> to lazarus and lazbuild.
97103- You can see the current values in the IDE via *Main menu \> View \> IDE Internals \> About IDE \> Global IDE Options*.
98104- The default SCP under Unix is */etc/lazarus*, under Windows it is the Lazarus directory itself.
99105- The default PCP under Unix is *~/.lazarus*.
100106
101107The list of packages to be installed into the IDE are listed in *miscellaneousoptions.xml*. Your installer should create the file *\<SCP\>/miscellaneousoptions.xml* with the following content:
102108
103109 <?xml version="1.0" encoding="UTF-8"?>
104110 <CONFIG>
105111 <MiscellaneousOptions>
106112 <Version Value="3"/>
107113 <BuildLazarusOptions>
108114 <StaticAutoInstallPackages Count="6">
109115 <Item1 Value="AnchorDocking"/>
110116 <Item2 Value="InstantFPCLaz"/>
111117 <Item3 Value="Cody"/>
112118 <Item4 Value="AnchorDockingDsgn"/>
113119 <Item5 Value="SynEditDsgn"/>
114120 <Item6 Value="TurboPowerIProDsgn"/>
115121 </StaticAutoInstallPackages>
116122 </BuildLazarusOptions>
117123 </MiscellaneousOptions>
118124 </CONFIG>
119125
120126If the user does not already have a Lazarus configuration the IDE will use the above file as a start.
121127
122128## See Also
123129
124130- [[Lazarus Packages]]
125131
126132---
127133*From the Free Pascal wiki, page "Install IDE packages without the IDE", as it stood on 2014-11-12 after a change by BigChimp, 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](/wiki-contact).*
128134Category: Lazarus
129135Category: Packages

Back to history