Getting Lazarus: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## Download and install Lazarus release version | |
| 2 | 2 | ||
| 3 | 3 | ### From SourceForge | |
| 4 | 4 | ||
| 5 | 5 | Binary releases for various platforms are available via the [Lazarus Sourceforge download area](<https://sourceforge.net/projects/lazarus/files/>). | |
| 6 | 6 | ||
| 7 | 7 | For people who are blocked by SF, the Lazarus releases from Sourceforge are mirrored at: | |
| 8 | 8 | ||
| 9 | 9 | * <https://download.lazarus-ide.org/> | |
| 10 | 10 | * <ftp://ftp.freepascal.org/pub/lazarus/releases/> | |
| 11 | 11 | ||
| 12 | 12 | Here are the [Checksums](<https://www.lazarus-ide.org/index.php?page=checksums>). | |
| 13 | 13 | ||
| 14 | 14 | ### Specific for platform | |
| 15 | 15 | ||
| 16 | 16 | Get Lazarus for Windows - use the Sourceforge link above. | |
| 17 | 17 | ||
| 18 | 18 | [[ReactOS|Get Lazarus for ReactOS]] | |
| 19 | 19 | ||
| 20 | 20 | [[Lazarus release version for Ubuntu|Get Lazarus for Ubuntu]] | |
| 21 | 21 | ||
| 22 | 22 | [[Install on Fedora|Get Lazarus for Fedora]] | |
| 23 | 23 | ||
| 24 | 24 | [[Lazarus release version for Suse|Get Lazarus for Suse]] | |
| 25 | 25 | ||
| 26 | 26 | [[Scientific Linux|Get Lazarus for Scientific Linux]] | |
| 27 | 27 | ||
| 28 | 28 | [[Lazarus on Raspberry Pi|Get Lazarus for Raspberry Pi (Raspbian)]] | |
| 29 | 29 | ||
| 30 | 30 | [[Installing Lazarus on macOS|Get Lazarus for Mac]] | |
| 31 | 31 | ||
| 32 | 32 | [[Lazarus on Solaris]] | |
| 33 | 33 | ||
| 34 | 34 | ## Getting a Git client | |
| 35 | 35 | ||
| 36 | 36 | ### TortoiseGit client | |
| 37 | 37 | ||
| 38 | 38 | TortoiseGit Client is for Windows only. You may download it from <https://tortoisegit.org/> | |
| 39 | 39 | ||
| 40 | 40 | ### Git for Windows | |
| 41 | 41 | ||
| 42 | 42 | Command line clients: | |
| 43 | 43 | ||
| 44 | 44 | <https://gitforwindows.org/> <https://git-scm.com/download/win> | |
| 45 | 45 | ||
| 46 | 46 | ### Other clients | |
| 47 | 47 | ||
| 48 | 48 | A GIT command line client is available from <https://git-scm.com/downloads> for many platforms. | |
| 49 | 49 | ||
| 50 | 50 | On Linux, it is recommended to install _git_ using the package management system offered by your distribution. For example: | |
| 51 | 51 | ``` | |
| 52 | 52 | sudo apt-get install git | |
| 53 | 53 | ``` | |
| 54 | 54 | ||
| 55 | 55 | ## Getting Lazarus from the GitLab server | |
| 56 | 56 | ||
| 57 | 57 | ### Development version of Lazarus | |
| 58 | 58 | ||
| 59 | 59 | To get Lazarus for the first time, using command line: | |
| 60 | 60 | ``` | |
| 61 | 61 | git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus | |
| 62 | 62 | ``` | |
| 63 | 63 | ||
| 64 | 64 | A new directory "lazarus" is then created under the current directory. | |
| 65 | 65 | ||
| 66 | + | Initially the active branch is the development branch "main". All commits are pushed there. Some bug fix commits are later merged to "fixes_x" branches. | |
| 67 | + | ||
| 66 | 68 | ### Fixes branch of latest Lazarus release | |
| 67 | 69 | ||
| 68 | - | ||
| 70 | + | Move into the directory created by the above **git clone** command and run | |
| 69 | 71 | ``` | |
| 70 | - | ||
| 72 | + | git switch fixes_4 | |
| 71 | 73 | ``` | |
| 72 | 74 | ||
| 73 | 75 | Amending the name of the branch according to what fixes version you want. Get a list with | |
| 74 | 76 | ``` | |
| 75 | 77 | git branch --all | |
| 76 | 78 | ``` | |
| 77 | 79 | ||
| 78 | 80 | The output will contain lines similar to | |
| 79 | 81 | ``` | |
| 80 | - | ||
| 82 | + | remote/origin/fixes_4 | |
| 81 | 83 | ``` | |
| 82 | 84 | ||
| 83 | 85 | The name of the branch is just the last part. | |
| 84 | 86 | ||
| 85 | - | ||
| 86 | - | ||
| 87 | 87 | ### Update the sources later | |
| 88 | 88 | ||
| 89 | 89 | Open a terminal/command prompt, change to the lazarus directory and type: | |
| 90 | 90 | ``` | |
| 91 | 91 | git switch main | |
| 92 | 92 | git pull | |
| 93 | 93 | ``` | |
| 94 | 94 | ||
| 95 | 95 | instead of main, you may want to specify a fixes branch. | |
| 96 | 96 | ||
| 97 | 97 | For compiling see this. | |
| 98 | 98 | ||
| 99 | 99 | ## Scripts | |
| 100 | 100 | ||
| 101 | 101 | There are scripts for Windows and Linux to automate downloading and building Lazarus: [[LazarusScripts|Scripts for Lazarus]] | |
| 102 | 102 | ||
| 103 | 103 | ## Compiling and running Lazarus | |
| 104 | 104 | ||
| 105 | 105 | See [[Installing Lazarus]] \- a detailed installation guide. | |
| 106 | 106 | ||
| 107 | 107 | ### Using the command-line | |
| 108 | 108 | ||
| 109 | 109 | Lazarus is shipped with an autogenerated **Makefile** (of the name "Makefile") for the gnu "**make** " utility. | |
| 110 | 110 | ||
| 111 | 111 | [](</File:Warning-icon.png>) | |
| 112 | 112 | ||
| 113 | 113 | **Warning:** If you also have Embarcadero (or Borland) tools installed, their "make" might conflict with gnu "make". In that case you can either delete or rename the conflicting Embarcadero binary, or remove its directory from Windows PATH, or set the path in the console before calling _make_ : | |
| 114 | 114 | ``` | |
| 115 | 115 | set path=c:\pascal\3.2.0\bin\i386-win32;%path% | |
| 116 | 116 | ``` | |
| 117 | 117 | ||
| 118 | 118 | [](</File:Warning-icon.png>) | |
| 119 | 119 | ||
| 120 | 120 | **Warning:** "make" may also fail, if you have a shell (such as sh.exe) in your path. It depends on how this shell interprets quotes and backslashes. | |
| 121 | 121 | ||
| 122 | 122 | **make** allows you to compile Lazarus from command-line easily. You need to have fpc and fpc-packages installed and configured first. | |
| 123 | 123 | ||
| 124 | 124 | To compile go to Lazarus directory in your terminal and type | |
| 125 | 125 | ``` | |
| 126 | 126 | **make** | |
| 127 | 127 | ``` | |
| 128 | 128 | ||
| 129 | 129 | This should rebuild LCL and Lazarus IDE with basic packages installed. | |
| 130 | 130 | ||
| 131 | 131 | Another useful command is | |
| 132 | 132 | ``` | |
| 133 | 133 | **make bigide** | |
| 134 | 134 | ``` | |
| 135 | 135 | ||
| 136 | 136 | which adds the same packages that the release version has. | |
| 137 | 137 | ||
| 138 | 138 | Then you can run Lazarus from within the same source directory with command "lazarus" (in Unix systems "./lazarus"). | |
| 139 | 139 | ||
| 140 | 140 | In case you want to run several versions, you can direct lazarus to use use specific configuration directories via the --pcp option, e.g. : | |
| 141 | 141 | ``` | |
| 142 | 142 | lazarus --pcp=/home/YOU/myLaz19 | |
| 143 | 143 | ``` | |
| 144 | 144 | ||
| 145 | 145 | ### Make targets | |
| 146 | 146 | ||
| 147 | 147 | #### make help | |
| 148 | 148 | ||
| 149 | 149 | To see a list of available targets for _**make**_ type [[make help]]. Note: "**make help** " exists since 1.0. Here is the output of "**make help** ": | |
| 150 | 150 | ||
| 151 | 151 | ||
| 152 | 152 | ||
| 153 | 153 | ``` | |
| 154 | 154 | make help | |
| 155 | 155 | ||
| 156 | - | ||
| 156 | + | Main targets | |
| 157 | 157 | Without any target, target 'all' will be invoked. | |
| 158 | 158 | all build all needed, i.e. minimal IDE, lazbuild, startlazarus. | |
| 159 | 159 | clean deletes files that 'bigide' creates. It does not clean up all possible | |
| 160 | 160 | targets. Clean other target: make clean LCL_PLATFORM=qt | |
| 161 | 161 | distclean Clean all targets and common leftovers. | |
| 162 | 162 | lazbuild build lazbuild and lcl with nogui widgetset | |
| 163 | 163 | bigide as all, except that the IDE is built with a lot of extra packages | |
| 164 | 164 | useride calls lazbuild to build an IDE with your active profile, requires lazbuild | |
| 165 | - | ||
| 165 | + | install installs Lazarus under C:\lazarus | |
| 166 | 166 | You can change the directory by appending INSTALL_PREFIX=/some/path | |
| 167 | 167 | ||
| 168 | 168 | Sub targets | |
| 169 | 169 | registration build package FCL | |
| 170 | - | ||
| 171 | - | ||
| 172 | - | ||
| 173 | - | ||
| 174 | - | ||
| 175 | - | ||
| 170 | + | basecomponents build buildintf, lazcontrols, ideintf, synedit, debuggerintf, lazdebuggergdbmi | |
| 176 | 171 | for the LCL_PLATFORM, requires lcl | |
| 177 | 172 | bigidecomponents build many extra packages for the LCL_PLATFORM, requires basecomponents | |
| 173 | + | tools build lazres, svn2revisioninc, updatepofiles, lrstolfm, | |
| 174 | + | requires LCL with nogui widgetset | |
| 178 | 175 | lhelp build lhelp, requires bigidecomponents | |
| 179 | 176 | starter build startlazarus, requires basecomponents | |
| 180 | - | ||
| 181 | - | ||
| 182 | - | ||
| 183 | - | ||
| 184 | - | ||
| 185 | - | ||
| 186 | - | ||
| 187 | - | ||
| 188 | - | ||
| 189 | - | ||
| 190 | - | ||
| 191 | - | ||
| 192 | - | ||
| 193 | - | ||
| 194 | - | ||
| 195 | - | ||
| 196 | - | ||
| 197 | - | ||
| 198 | - | ||
| 199 | - | ||
| 200 | - | ||
| 201 | - | ||
| 202 | - | ||
| 203 | - | ||
| 204 | - | ||
| 205 | - | ||
| 206 | - | ||
| 207 | - | ||
| 208 | - | ||
| 209 | - | ||
| 210 | - | ||
| 211 | - | ||
| 212 | - | ||
| 213 | - | ||
| 214 | - | ||
| 215 | - | ||
| 177 | + | ide build ide with minimum of packages | |
| 178 | + | ||
| 179 | + | Flags: | |
| 180 | + | PP=/path/to/fpc use another compiler | |
| 181 | + | USESVN2REVISIONINC=0 do not update ide/revision.inc | |
| 182 | + | INSTALL_PREFIX=/usr used by 'install' as path prefix | |
| 183 | + | FPC_DIR=/usr/share/fpcsrc/3.0.4 used by fpcmake when regenerating Makefiles | |
| 184 | + | OPT='-vwnbq -gh' append these options when calling the compiler | |
| 185 | + | ||
| 186 | + | Usage examples: | |
| 187 | + | ||
| 188 | + | Updating git and build a minimal IDE, startlazarus and lazbuild: | |
| 189 | + | make clean | |
| 190 | + | git pull | |
| 191 | + | make clean all | |
| 192 | + | ||
| 193 | + | Note: You can start lazarus with 'startlazarus' | |
| 194 | + | Note: Use the IDE or lazbuild to compile your projects/packages. | |
| 195 | + | ||
| 196 | + | Updating git and build an IDE with your last set of packages: | |
| 197 | + | make distclean | |
| 198 | + | git pull | |
| 199 | + | make clean lazbuild useride | |
| 200 | + | ||
| 201 | + | Clean up: | |
| 202 | + | git restore . | |
| 203 | + | make distclean | |
| 204 | + | ||
| 205 | + | Install: | |
| 206 | + | Note: You can use Lazarus without installing. Just start the lazarus executable. | |
| 207 | + | 1. Build Lazarus as normal user with one of the above commands. | |
| 208 | + | 2. Install as root into /usr | |
| 216 | 209 | sudo make install | |
| 217 | 210 | This installs startlazarus, lazarus-ide, lazbuild under /usr/bin | |
| 218 | 211 | and copies the whole lazarus source directory to /usr/share/lazarus | |
| 219 | 212 | ``` | |
| 220 | 213 | ||
| 221 | 214 | ### Make parameters | |
| 222 | 215 | ||
| 223 | 216 | There are additional parameters which can be used to **make** Lazarus. See a fully working example above. | |
| 224 | 217 | ||
| 225 | 218 | * **OPT** =%compiler_switches | |
| 226 | 219 | ||
| 227 | 220 | the %compiler_switches is passed to each fpc call. The option is useful for specifying defines | |
| 228 | 221 | ||
| 229 | 222 | For example: | |
| 230 | 223 | ``` | |
| 231 | 224 | make bigide OPT="-dNoGdkPixBufLib -gw2" | |
| 232 | 225 | ``` | |
| 233 | 226 | ||
| 234 | 227 | makes LCL and ide with NoGdkPixBufLib defined and dwarf2 debug info. | |
| 235 | 228 | ||
| 236 | 229 | * **LCL_PLATFORM** =%platform | |
| 237 | 230 | ||
| 238 | 231 | %platform is the target [[Widgetset|widgetset]]. It can be win32,wince,gtk,gtk2,qt,carbon,cocoa,customdrawn. | |
| 239 | 232 | ||
| 240 | 233 | For example: | |
| 241 | 234 | ``` | |
| 242 | 235 | make LCL_PLATFORM=gtk2 | |
| 243 | 236 | ``` | |
| 244 | 237 | ||
| 245 | 238 | Rebuilds LCL and IDE for gtk2 widgetset | |
| 246 | 239 | ||
| 247 | 240 | * **FPC** =%compiler_path | |
| 248 | 241 | ||
| 249 | 242 | or | |
| 250 | 243 | ||
| 251 | 244 | * **PP** =%compiler_path | |
| 252 | 245 | ||
| 253 | 246 | %compiler_path is the path+filename to a custom compiler binary you want to build the target with. | |
| 254 | 247 | ||
| 255 | 248 | such as: | |
| 256 | 249 | ``` | |
| 257 | 250 | make FPC="~/Pfad/fpc" | |
| 258 | 251 | ``` | |
| 259 | 252 | ||
| 260 | 253 | ## Browse the Source Repository with a Web Browser | |
| 261 | 254 | ||
| 262 | 255 | The contents of the GIT repro can also be browsed with your web-browser through [interface](<https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main>). | |
| 263 | 256 | ||
| 264 | 257 | ## Lazarus Distributions | |
| 265 | 258 | ||
| 266 | 259 | There are some unofficial sites where you can find Lazarus and Free Pascal too: | |
| 267 | 260 | ||
| 268 | 261 | * [NewPascal](<http://newpascal.org>) is a curated distribution for Windows, which doesn't require an installer and implements some new features. (Is very out-of-date) | |
| 269 | 262 | * The [getlazarus](<http://www.getlazarus.org>) distribution bundles cutting-edge versions of Lazarus with easy-to-use setup scripts for several platforms and additional components. | |
| 270 | 263 | * [FreeSparta](<https://freesparta.com/>) is a commercial distribution of Lazarus for Windows. | |
| 271 | 264 | * You can get a Ubuntu LiveCD from Austrian University of Applied Sciences hosting <http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso> and md5sum file is here <http://www.sigma-server.com/liveCD/Ubuntu-7.10-NTC-Lazarus.iso.md5>. | |
| 272 | 265 | * The [CodeTyphon](<http://www.pilotlogic.com>) distribution bundles Lazarus with additional packages and components. | |
| 273 | 266 | * [LiteZarus](<https://github.com/x2nie/LiteZarus>) is a Lazarus distro intended for designing creating non-LCL projects. | |
| 274 | 267 | * Lazarus is available on CDs and USB sticks from the [Blaise Pascal Magazine](<http://www.blaisepascal.eu>) store. | |
| 275 | 268 | ||
| 276 | 269 | ## See also | |
| 277 | 270 | ||
| 278 | 271 | * [Forum: Explanation of trunk installation in Windows](<http://forum.lazarus.freepascal.org/index.php/topic,36347.msg242123.html#msg242123>) | |
| 279 | 272 | ||
| 280 | 273 | --- | |
| 281 | - | ||
| 274 | + | *From the Free Pascal wiki, page "Getting Lazarus", as the Internet Archive kept it on 2025-12-28, last changed on 2025-02-21. 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).* |
