Sign in Join
Wiki copytemporary

Install IDE packages without the IDE: what changed

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

Title: Install IDE packages without the IDE

OldNewLine
1+## Install with command line tool lazbuild
2+
3+With current Lazarus, it is possible to compile and install IDE packages using the lazbuild tool. See [[lazbuild]].
4+
5+## Install manually without IDE nor lazbuild
6+
7+For completeness/reference, the old version of this article is presented below.
8+
9+> **Warning:** Old information below. There is a much easier way to install packages in current Lazarus.
10+
11+To manually install a package in the IDE you need the following
12+
13+- compiled lazbuild (LCL, components, lazbuild)
14+- all required packages must be setup and compiled
15+- the .lpk file must be registered
16+- setup the \$HOME/.lazarus/staticpackages.inc file (or corresponding file in your primary config path)
17+- setup \$HOME/.lazarus/idemake.cfg (or corresponding file in your primary config path)
18+- compile the package with lazbuild
19+- execute *make idepkg*
20+
21+### Quick
22+
23+The easiest way is to install the package in the IDE, copy the needed files to the target directory/filesystem and adapt the filenames.
24+
25+### Compile lazbuild
26+
27+Install FPC and lazarus - or do a make lazbuild. See .
28+
29+### Compile and register the required packages
30+
31+Do the steps on this page recursively until only the base Lazarus packages are needed.
32+
33+### Register the .lpk file
34+
35+The IDE must find the .lpk file for a packagename. It searches the .lpk file in the following places:
36+
37+- In the \$HOME/.lazarus/packagefiles.xml file
38+- In the \<lazarus_path\>/packager/globallinks/
39+
40+### Setup the \$HOME/.lazarus/staticpackages.inc file
41+
42+Create this file if it does not exist. Add the packagename plus a comma to this file. For example this file can look like this:
43+
44+` Printer4Lazarus,`\
45+` RunTimeTypeInfoControls,`\
46+` H2PasWizard,`
47+
48+### Setup \$HOME/.lazarus/idemake.cfg
49+
50+The 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.
51+
52+Please 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!!
53+
54+### Compile the package with lazbuild
55+
56+``` bash
57+lazbuild path_to_package.lpk
58+```
59+
60+### Execute *make idepkg*
61+
62+``` bash
63+cd path_to_lazarus
64+make idepkg
65+```
66+
67+## Distributing an IDE with preinstalled packages
68+
69+### Third party packages
70+
71+Let'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.
72+
73+Create an .lpl file:
74+
75+`lazarus/packager/globallinks/closy-1.lpl`
76+
77+The 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:
78+
79+`$(LazarusDir)/components/closy/closy.lpk`
80+
81+### Compile the IDE
82+
83+- Execute **make clean all** to update lazbuild, startlazarus and other tools.
84+- Use the IDE or lazbuild to install all needed packages and compile the new IDE.
85+
86+Hint: Since 1.2 lazbuild contains the option --add-package to install packages.
87+
88+- You now have a lazarus directory with all needed .ppu files, the lazarus executable and common tools.
89+
90+### User Options
91+
92+Now you need to setup the start configuration for the user.
93+
94+When 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.
95+
96+- You can pass the PCP and SCP as command line options --pcp=\<path\> and --scp=\<path\> to lazarus and lazbuild.
97+- You can see the current values in the IDE via *Main menu \> View \> IDE Internals \> About IDE \> Global IDE Options*.
98+- The default SCP under Unix is */etc/lazarus*, under Windows it is the Lazarus directory itself.
99+- The default PCP under Unix is *~/.lazarus*.
100+
101+The 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:
102+
103+ <?xml version="1.0" encoding="UTF-8"?>
104+ <CONFIG>
105+ <MiscellaneousOptions>
106+ <Version Value="3"/>
107+ <BuildLazarusOptions>
108+ <StaticAutoInstallPackages Count="6">
109+ <Item1 Value="AnchorDocking"/>
110+ <Item2 Value="InstantFPCLaz"/>
111+ <Item3 Value="Cody"/>
112+ <Item4 Value="AnchorDockingDsgn"/>
113+ <Item5 Value="SynEditDsgn"/>
114+ <Item6 Value="TurboPowerIProDsgn"/>
115+ </StaticAutoInstallPackages>
116+ </BuildLazarusOptions>
117+ </MiscellaneousOptions>
118+ </CONFIG>
119+
120+If the user does not already have a Lazarus configuration the IDE will use the above file as a start.
121+
122+## See Also
123+
124+- [[Lazarus Packages]]
125+
126+---
127+*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).*
128+Category: Lazarus
129+Category: Packages

Back to history