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