fpcupdeluxe: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## Overview | |
| 2 | 2 | ||
| 3 | 3 |  | |
| 4 | 4 | ||
| 5 | 5 | **FPCUPdeluxe** is a GUI installer for FPC and Lazarus. It's based on [[fpcup]]. | |
| 6 | 6 | ||
| 7 | 7 | - [GitHub repository](https://github.com/LongDirtyAnimAlf/fpcupdeluxe) | |
| 8 | 8 | - [Latest releases on GitHub](https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/latest) | |
| 9 | 9 | - [Lazarus Forum Topic](https://forum.lazarus.freepascal.org/index.php/topic,34645.0.html) | |
| 10 | 10 | ||
| 11 | 11 | ## Installation of FPC and Lazarus | |
| 12 | 12 | ||
| 13 | 13 | The main purpose of fpcdeluxe is to provide a means for installing and updating multiple versions of FPC and Lazarus in a self-contained manner. Self-contained meaning that an install by fpcupdeluxe will have no influence on (interference with) your system: Hence you can install multiple versions of FPC and Lazarus. | |
| 14 | 14 | ||
| 15 | 15 | In order to have the installation working **you MUST use the generated link to start the install** ! | |
| 16 | 16 | ||
| 17 | 17 | That launcher link contains a line like: | |
| 18 | 18 | ||
| 19 | - | ||
| 19 | + | ```text | |
| 20 | + | Exec=/P/s/lazarus/lazarus --pcp="/P/s/config_lazarus" | |
| 21 | + | ``` | |
| 20 | 22 | ||
| 21 | 23 | directing Lazarus to use the [[pcp]] , i.e. **primary configuration** setting **path** of "/P/s/config_lazarus" or a similar subdir under /home/ depending on you choice made from the GUI. No fpc or anything is required in the searchpath. | |
| 22 | 24 | ||
| 23 | 25 | ### Prerequisites | |
| 24 | 26 | ||
| 25 | 27 | #### Debian, Raspbian, Mint gtk2 | |
| 26 | 28 | ||
| 27 | 29 | actual working with Debian Buster and Raspbian Buster | |
| 28 | 30 | ||
| 29 | 31 | ``` bash | |
| 30 | 32 | #!/bin/bash | |
| 31 | 33 | sudo apt-get update | |
| 32 | 34 | sudo apt-get upgrade | |
| 33 | 35 | ||
| 34 | 36 | # Missing Packages | |
| 35 | 37 | sudo apt-get install libx11-dev | |
| 36 | 38 | sudo apt-get install libgdk-pixbuf2.0-dev | |
| 37 | 39 | sudo apt-get install libpango1.0-dev | |
| 38 | 40 | sudo apt-get install libgtk2.0-dev | |
| 39 | 41 | ||
| 40 | 42 | # if gdb is not installed (eg. Lubuntu) | |
| 41 | 43 | sudo apt-get install gdb | |
| 42 | 44 | ||
| 43 | 45 | # GIT is the new SVN | |
| 44 | 46 | sudo apt-get install git | |
| 45 | 47 | ``` | |
| 46 | 48 | ||
| 47 | 49 | #### Debian qt5 | |
| 48 | 50 | ||
| 49 | 51 | ``` bash | |
| 50 | 52 | #!/bin/bash | |
| 51 | 53 | sudo apt-get update | |
| 52 | 54 | sudo apt-get upgrade | |
| 53 | 55 | ||
| 54 | 56 | # Missing Packages | |
| 55 | 57 | sudo apt install libqt5pas-dev | |
| 56 | 58 | ||
| 57 | 59 | # GIT is the new SVN | |
| 58 | 60 | sudo apt-get install git | |
| 59 | 61 | ``` | |
| 60 | 62 | ||
| 61 | 63 | See [[Qt5 Interface|Qt5_Interface#Linux]] | |
| 62 | 64 | ||
| 63 | 65 | #### Raspbian on RPi2 | |
| 64 | 66 | ||
| 65 | 67 | You need to extend the swap see [[Lazarus on Raspberry Pi]] | |
| 66 | 68 | ||
| 67 | 69 | ## Advanced settings | |
| 68 | 70 | ||
| 69 | 71 |  | |
| 70 | 72 | ||
| 71 | 73 | The above screenshot (click Setup+ on mainscreen) shows the advanced settings of FPCUPdeluxe. | |
| 72 | 74 | ||
| 73 | 75 | Some examples of advanced settings: | |
| 74 | 76 | ||
| 75 | 77 | - for debugging FPC itself, add "-g -gl -O-" into the "FPC options" field. | |
| 76 | 78 | - to apply a fix for FreeBSD x64 cross-compiler (which fixes FileExists/DirectoryExists functions on FreeBSD 12), press "Add FPC patch" and browse for relevant patch file. | |
| 77 | 79 | ||
| 78 | 80 | ## Cross-compiling | |
| 79 | 81 | ||
| 80 | 82 | FPCUPdeluxe makes cross-compiling easy: activate "cross" UI tab, select a CPU and an OS, and press "Install compiler". If libraries and/or binary tools are needed, fpcupdeluxe will try to get them online. | |
| 81 | 83 | ||
| 82 | 84 | Use the link to see what is available at the moment: | |
| 83 | 85 | ||
| 84 | 86 | - [Linux 64bit binary toolchains](https://github.com/newpascal/fpcupdeluxe/releases/tag/linuxx64crossbins_v1.0) | |
| 85 | 87 | - [Linux 32bit binary toolchains](https://github.com/newpascal/fpcupdeluxe/releases/tag/linuxi386crossbins_v1.0) | |
| 86 | 88 | - [Windows binary toolchains](https://github.com/newpascal/fpcupdeluxe/releases/tag/wincrossbins_v1.0) | |
| 87 | 89 | - [System libraries](https://github.com/newpascal/fpcupdeluxe/releases/tag/crosslibs_v1.0) | |
| 88 | 90 | ||
| 89 | 91 | ### Cross-compiling from Windows and Linux towards Darwin: the hard way | |
| 90 | 92 | ||
| 91 | 93 | With the help of fpcupdeluxe, NewPascal or FPC trunk, and a toolset called osxcross/cctools-port, you can crosscompile towards Darwin. This help will concentrate on manually setting up crossing from Windows/Linux towards Darwin (fpcupdeluxe can also do all the auto-magic for you for crossing towards Darwin; see above). | |
| 92 | 94 | ||
| 93 | 95 | First, you will need to get osxcross/cctools-port, and compile it yourself. | |
| 94 | 96 | ||
| 95 | 97 | - [osxcross original](https://github.com/tpoechtrager/osxcross)\ | |
| 96 | 98 | [osxcross for FPC](https://github.com/LongDirtyAnimAlf/osxcross) | |
| 97 | 99 | - [cctools-port original](https://github.com/tpoechtrager/cctools-port)\ | |
| 98 | 100 | [cctools-port for FPC](https://github.com/LongDirtyAnimAlf/cctools-port) | |
| 99 | 101 | ||
| 100 | 102 | For macOS, you will need the [osxcross for FPC](https://github.com/LongDirtyAnimAlf/osxcross) that has been adapted for use by FPC. | |
| 101 | 103 | ||
| 102 | 104 | For iOS/iPhone, you will need the [cctools-port for FPC](https://github.com/LongDirtyAnimAlf/cctools-port) that has been adapted for use by FPC. | |
| 103 | 105 | ||
| 104 | 106 | Get yourself a SDK, either from your own Mac, or from online sources: [Various Mac SDK's](https://github.com/phracker/MacOSX-SDKs/releases) | |
| 105 | 107 | ||
| 106 | 108 | SDKs for iPhone can also be obtained from online sources: [Various iPhone SDK's](https://github.com/theos/sdks) | |
| 107 | 109 | ||
| 108 | 110 | Build osxcross/cctools-port according to the instructions. For example, on Windows with Cygwin. | |
| 109 | 111 | ||
| 110 | 112 | > **Note:** Please note: to be able to cross from Windows towards Darwin, you need to have NewPascal or FPC trunk installed ! | |
| 111 | 113 | ||
| 112 | 114 | Use fpcupdeluxe to install NewPascal or FPC trunk. | |
| 113 | 115 | ||
| 114 | 116 | Before building the cross-compiler, you need to inform fpcupdeluxe where to find the Darwin libs (SDK) and the binary tools (build by osxcross/cctools-port). The two screenshot below show how to proceed: | |
| 115 | 117 | ||
| 116 | 118 | - Choose a CPU-type and an OS (Darwin). Select custom. You should now be able to use the buttons and point fpcupdeluxe to the right locations. | |
| 117 | 119 | ||
| 118 | 120 |   | |
| 119 | 121 | ||
| 120 | 122 | - Now, on the mainscreen, you can select your CPU and OS (Darwin) and build the cross-compiler ! | |
| 121 | 123 | - **Again, fpcupdeluxe also has pre-built tools for crossing towards Darwin: using the fpcupdeluxe-auto-magic will be the easiest !!!** | |
| 122 | 124 | ||
| 123 | 125 | ### Caveats, observations, troubleshooting | |
| 124 | 126 | ||
| 125 | 127 | - It was observed, that **f.** often times works on first run on an empty install dir, but subsequents runs, i.e. in order to add controls to the pallette, add the .chm [[help]] system asf., often times fail. In case of failure to recompile / [[make]] the IDE, the Lazarus binary may be gone, so unless you made a file backup earlier, you cannot start Lazarus anymore. | |
| 126 | 128 | - copy and save the logfile for reference / troubleshoot. | |
| 127 | 129 | - adding the [[help]] system is easy: just tag it under "advanced settings", saving some manual labour. | |
| 128 | 130 | - it takes about 10 minutes to make a full new install of fpc + Laz. | |
| 129 | 131 | - try out new --pcp settings to get a feeling for it, you can always delete the config and start anew (save the pristine fresh content of the --pcp dir right after install). | |
| 130 | 132 | - Sometimes, fpcupdeluxe hangs when it cannot download OpenSSL library. It's chicken-egg problem - OpenSSL is needed to download from https, so fpcupdeluxe cannot download OpenSSL without OpenSSL. Fpcupdeluxe has its strategy to overcome this, but sometimes it fails. Then, try this workaround - in fpcupdeluxe go to "Extras" tab and click on "get OpenSSL by browser", then unpack the downloaded file to fpcupdeluxe folder (where fpcupdeluxe.exe is located). Now, try again. | |
| 131 | 133 | ||
| 132 | 134 | ## Launching an installed Lazarus and fpc instance | |
| 133 | 135 | ||
| 134 | 136 | For launching the Lazarus GUI, a script is created (in the users home directory) and a launcher (on the desktop) which opens Lazarus with the correct config path & environment. Example, on Linux if installing to a folder named "/home/user/trunk", fpcupdeluxe creates: | |
| 135 | 137 | ||
| 136 | - | ||
| 137 | - | ||
| 138 | + | ```text | |
| 139 | + | /home/user/Desktop/Lazarus_trunk.desktop (launcher) | |
| 140 | + | /home/user/Lazarus_trunk (shell script) | |
| 141 | + | ``` | |
| 138 | 142 | ||
| 139 | 143 | For Linux FPC/lazbuild command line work the following shell script can be used (assumes a bash shell and using example install dir of "/home/user/trunk"): | |
| 140 | 144 | ||
| 141 | 145 | ``` bash | |
| 142 | 146 | #!/bin/sh | |
| 143 | 147 | # fpcupdeluxe: FPC home startlink script | |
| 144 | 148 | export PATH="/home/user/trunk/fpc/bin/x86_64-linux:/home/user/trunk/lazarus:${PATH}" | |
| 145 | 149 | export PPC_CONFIG_PATH="/home/user/trunk/fpc/bin/x86_64-linux" | |
| 146 | 150 | exec /bin/bash | |
| 147 | 151 | ``` | |
| 148 | 152 | ||
| 149 | 153 | Windows equivalent batch file for setting up environment for working from command line (using example install dir of "f:\trunk"): | |
| 150 | 154 | ||
| 151 | 155 | ```batch | |
| 152 | 156 | REM fpcupdeluxe: FPC home startlink script | |
| 153 | 157 | SET PATH=F:\trunk\fpc\bin\x86_64-win64;F:\trunk\lazarus;%PATH% | |
| 154 | 158 | SET PPC_CONFIG_PATH=F:\trunk\fpc\bin\x86_64-win64 | |
| 155 | 159 | cmd.exe | |
| 156 | 160 | ``` | |
| 157 | 161 | ||
| 158 | 162 | > **Note:** Setting the paths this way is not global and only effects the current terminal shell and child shells. | |
| 159 | 163 | ||
| 160 | 164 | ## clang compilation error | |
| 161 | 165 | ||
| 162 | 166 | On compiling for macOS target on Linux, you can see this error: | |
| 163 | 167 | ||
| 164 | - | ||
| 168 | + | ```text | |
| 169 | + | clang: error: invalid version number in '-target arm64-apple-macosx11.0.0' | |
| 170 | + | ``` | |
| 165 | 171 | ||
| 166 | 172 | Usually it happens on old systems, e.g. Ubuntu 20.04. This is fixable. | |
| 167 | 173 | ||
| 168 | 174 | - Install package "clang-12" in package manager | |
| 169 | 175 | - Go to /usr/bin and see all clang* symlinks. "clang" is symlink to Clang-10, and "clang-12" is symlink to Clang-12. Adjust symlinks so that "clang" points to Clang-12. | |
| 170 | 176 | ||
| 171 | 177 | user@PC:~$ ls -l /usr/bin/clang* | |
| 172 | 178 | lrwxrwxrwx 1 root root 24 ноя 7 22:00 /usr/bin/clang -> ../lib/llvm-12/bin/clang | |
| 173 | 179 | lrwxrwxrwx 1 root root 26 мар 20 2020 /usr/bin/clang++ -> ../lib/llvm-10/bin/clang++ | |
| 174 | 180 | lrwxrwxrwx 1 root root 26 апр 20 2020 /usr/bin/clang++-10 -> ../lib/llvm-10/bin/clang++ | |
| 175 | 181 | lrwxrwxrwx 1 root root 24 апр 20 2020 /usr/bin/clang-10 -> ../lib/llvm-10/bin/clang | |
| 176 | 182 | lrwxrwxrwx 1 root root 26 мар 8 2022 /usr/bin/clang++-12 -> ../lib/llvm-12/bin/clang++ | |
| 177 | 183 | lrwxrwxrwx 1 root root 24 мар 8 2022 /usr/bin/clang-12 -> ../lib/llvm-12/bin/clang | |
| 178 | 184 | lrwxrwxrwx 1 root root 28 апр 20 2020 /usr/bin/clang-cpp-10 -> ../lib/llvm-10/bin/clang-cpp | |
| 179 | 185 | lrwxrwxrwx 1 root root 28 мар 8 2022 /usr/bin/clang-cpp-12 -> ../lib/llvm-12/bin/clang-cpp | |
| 180 | 186 | ||
| 181 | 187 | ## External links | |
| 182 | 188 | ||
| 183 | 189 | - See in depth guide for *BUILD / MAKE*: [Build FAQ](http://www.stack.nl/~marcov/buildfaq.pdf) | |
| 184 | 190 | - [Fpcup by Reinier](http://wiki.lazarus.freepascal.org/fpcup) | |
| 185 | 191 | - [Fpcupdeluxe source](https://github.com/newpascal/fpcupdeluxe) | |
| 186 | 192 | - [Latest release](https://github.com/newpascal/fpcupdeluxe/releases/latest) | |
| 187 | 193 | - [NewPascal](http://newpascal.org) | |
| 188 | 194 | ||
| 189 | 195 | --- | |
| 190 | 196 | *From the Free Pascal wiki, page "fpcupdeluxe", as it stood on 2023-11-08 after a change by Alextpp, 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).* |
