Difference between revisions of "fpcupdeluxe"

From Lazarus wiki
Jump to navigationJump to search
m
(→‎Debian, Raspbian, Mint gtk2: on some platforms gdb is not installed by default)
(26 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[File:fpcupdeluxe.JPG|300px|thumb|fpupdeluxe on Windows]]
+
{{fpcupdeluxe}}
<p>Fpcupdeluxe, a GUI installer for FPC and Lazarus. Based on [http://wiki.lazarus.freepascal.org/fpcup fpcup]</p>
 
<p>[https://github.com/newpascal/fpcupdeluxe Fpcupdeluxe source]</p>
 
<p>[https://github.com/newpascal/fpcupdeluxe/releases/latest Latest release]</p>
 
<h1>Installation of FPC and Lazarus</h1>
 
  
<p>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.</p>
+
== Overview ==
<p>In order to have the installation working '''you MUST use the generated link to start the install''' !</p>
+
 
 +
[[File:fpcupdeluxe.png|300px|thumb|FPCUPdeluxe on Linux]]
 +
 
 +
'''FPCUPdeluxe''' is a GUI installer for FPC and Lazarus. It's based on [[fpcup]].
 +
 
 +
* [https://github.com/LongDirtyAnimAlf/fpcupdeluxe GitHub repository]
 +
* [https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/latest Latest releases on GitHub]
 +
 
 +
== Installation of FPC and Lazarus ==
 +
 
 +
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.
 +
 
 +
In order to have the installation working '''you MUST use the generated link to start the install''' !
  
 
That launcher link contains a line like:  
 
That launcher link contains a line like:  
 
  Exec=/P/s/lazarus/lazarus --pcp="/P/s/config_lazarus"
 
  Exec=/P/s/lazarus/lazarus --pcp="/P/s/config_lazarus"
  
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.  
+
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.
 +
 
 +
=== Prerequisites ===
 +
 
 +
==== Debian, Raspbian, Mint gtk2 ====
 +
actual working with Debian Buster and Raspbian Buster
 +
 
 +
<syntaxhighlight lang="bash">
 +
#!/bin/bash
 +
sudo apt-get update
 +
sudo apt-get upgrade
 +
 
 +
# Missing Packages
 +
sudo apt-get install libx11-dev
 +
sudo apt-get install libgdk-pixbuf2.0-dev
 +
sudo apt-get install libpango1.0-dev
 +
sudo apt-get install libgtk2.0-dev
 +
 
 +
# if gdb is not installed (eg. Lubuntu)
 +
sudo apt-get install gdb
 +
 
 +
# GIT is the new SVN
 +
sudo apt-get install git
 +
 
 +
</syntaxhighlight>
 +
 
 +
==== Debian qt5 ====
 +
 
 +
<syntaxhighlight lang="bash">
 +
#!/bin/bash
 +
sudo apt-get update
 +
sudo apt-get upgrade
 +
 
 +
# Missing Packages
 +
sudo apt install libqt5pas-dev
 +
 
 +
# GIT is the new SVN
 +
sudo apt-get install git
 +
</syntaxhighlight>
 +
See [[Qt5_Interface#Linux]]
 +
 
 +
==== Raspbian on RPi2 ====
 +
You need to extend the swap see [[Lazarus_on_Raspberry_Pi]]
 +
 
 +
== Advanced settings ==
 +
 
 +
[[File:fpcupdeluxe_advanced.png|none|400px|thumb|left|FPCUPdeluxe advanced settings screen]]
 +
 
 +
The above screenshot (click Setup+ on mainscreen) shows the advanced settings of FPCUPdeluxe.
 +
 
 +
Some examples of advanced settings:
  
<h1>Advanced settings</h1>
+
* for debugging FPC itself, add "-g -gl -O-" into the "FPC options" field.
 +
* 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.
  
[[File:fpcupdeluxe_advanced.JPG|none|400px|thumb|left|Fpcupdeluxe advanced settings screen.]]
+
== Cross-compiling ==
<p>The above screenshot (click Setup+ on mainscreen) shows the advanced settings of fpcupdeluxe.</p>
+
 
<p>Some examples of advanced settings:</p>
+
FPCUPdeluxe makes cross-compiling easy: activate "cross" UI tab, select a CPU and an OS, and press "Install compiler".
<p>--> for debugging FPC itself, add "-g -gl -O-" into the "FPC options" field.</p>
 
<h1>Crosscompiling</h1>
 
<p>Fpcupdeluxe makes cross-compiling easy: just select a CPU and an OS, and press install crosscompiler.
 
 
If libraries and/or binary tools are needed, fpcupdeluxe will try to get them online.
 
If libraries and/or binary tools are needed, fpcupdeluxe will try to get them online.
Use the link to see what is available at the moment !</p>
+
 
<p>[https://github.com/newpascal/fpcupdeluxe/releases/tag/linuxx64crossbins_v1.0 Linux 64bit binary toolchains]</p>
+
Use the link to see what is available at the moment:
<p>[https://github.com/newpascal/fpcupdeluxe/releases/tag/linuxi386crossbins_v1.0 Linux 32bit binary toolchains]</p>
+
 
<p>[https://github.com/newpascal/fpcupdeluxe/releases/tag/wincrossbins_v1.0 Windows binary toolchains]</p>
+
* [https://github.com/newpascal/fpcupdeluxe/releases/tag/linuxx64crossbins_v1.0 Linux 64bit binary toolchains]
<p>[https://github.com/newpascal/fpcupdeluxe/releases/tag/crosslibs_v1.0 System libraries]</p>
+
* [https://github.com/newpascal/fpcupdeluxe/releases/tag/linuxi386crossbins_v1.0 Linux 32bit binary toolchains]
<h2>Crosscompiling from Windows and Linux towards Darwin: the hard way</h2>
+
* [https://github.com/newpascal/fpcupdeluxe/releases/tag/wincrossbins_v1.0 Windows binary toolchains]
<p>With the help of fpcupdeluxe, NewPascal 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)</p>
+
* [https://github.com/newpascal/fpcupdeluxe/releases/tag/crosslibs_v1.0 System libraries]
<p>First, you will need to get osxcross/cctools-port, and compile it yourself.</p>
+
 
<p>[https://github.com/tpoechtrager/osxcross osxcross original]<br />[https://github.com/LongDirtyAnimAlf/osxcross osxcross for FPC]</p>
+
=== Cross-compiling from Windows and Linux towards Darwin: the hard way ===
<p>[https://github.com/tpoechtrager/cctools-port cctools-port original]<br />[https://github.com/LongDirtyAnimAlf/cctools-port cctools-port for FPC]</p>
+
 
<p>For Mac OSX, you will need the [https://github.com/LongDirtyAnimAlf/osxcross osxcross for FPC] that has been adapted for use by FPC.</p>
+
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).
<p>For iOS/iPhone, you will need the [https://github.com/LongDirtyAnimAlf/cctools-port cctools-port for FPC] that has been adapted for use by FPC.</p>
+
 
<p>Get yourself a SDK, either from your own Mac, or from online sources: [https://github.com/phracker/MacOSX-SDKs/releases Various Mac SDK's]</p>
+
First, you will need to get osxcross/cctools-port, and compile it yourself.
<p>SDKs for iPhone can also be obtained from online sources: [https://github.com/theos/sdks Various iPhone SDK's]</p>
+
 
<p>Build osxcross/cctools-port according to the instructions. E.g. on Windows with Cygwin.</p>
+
* [https://github.com/tpoechtrager/osxcross osxcross original]<br />[https://github.com/LongDirtyAnimAlf/osxcross osxcross for FPC]
<p></p>
+
* [https://github.com/tpoechtrager/cctools-port cctools-port original]<br />[https://github.com/LongDirtyAnimAlf/cctools-port cctools-port for FPC]
<p>'''Please note: to be able to cross from Windows towards Darwin, you need to have NewPascal installed ! NewPascal is FPC trunk with some additional features.'''</p>
+
 
<p>Use fpcupdeluxe to install NewPascal.</p>
+
For macOS, you will need the [https://github.com/LongDirtyAnimAlf/osxcross osxcross for FPC] that has been adapted for use by FPC.
<p></p>
+
 
<p>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:</p>
+
For iOS/iPhone, you will need the [https://github.com/LongDirtyAnimAlf/cctools-port cctools-port for FPC] that has been adapted for use by FPC.
<p>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.</p>
+
 
 +
Get yourself a SDK, either from your own Mac, or from online sources: [https://github.com/phracker/MacOSX-SDKs/releases Various Mac SDK's]
 +
 
 +
SDKs for iPhone can also be obtained from online sources: [https://github.com/theos/sdks Various iPhone SDK's]
 +
 
 +
Build osxcross/cctools-port according to the instructions. For example, on Windows with Cygwin.
 +
 
 +
{{Note|Please note: to be able to cross from Windows towards Darwin, you need to have NewPascal or FPC trunk installed !}}
 +
 
 +
Use fpcupdeluxe to install NewPascal or FPC trunk.
 +
 
 +
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:
 +
 
 +
* 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.</p>
 
[[File:fpcupdeluxe_darwinlibs.JPG|none|200px|thumb|left|Point fpcupdeluxe towards the library location]]
 
[[File:fpcupdeluxe_darwinlibs.JPG|none|200px|thumb|left|Point fpcupdeluxe towards the library location]]
 
[[File:fpcupdeluxe_darwinbins.JPG|none|200px|thumb|left|Point fpcupdeluxe towards the binary tools location]]
 
[[File:fpcupdeluxe_darwinbins.JPG|none|200px|thumb|left|Point fpcupdeluxe towards the binary tools location]]
<p>Now, on the mainscreen, you can select your CPU and OS (Darwin) and build the cross-compiler !</p>
+
* Now, on the mainscreen, you can select your CPU and OS (Darwin) and build the cross-compiler !</p>
<p>'''Again, fpcupdeluxe also has pre-build tools for crossing towards Darwin: using the fpcupdeluxe-auto-magic will be the easiest !!!'''</p>
+
* '''Again, fpcupdeluxe also has pre-built tools for crossing towards Darwin: using the fpcupdeluxe-auto-magic will be the easiest !!!'''
<h1>External links</h1>
+
 
see in depth guide for ''BUILD / MAKE'': [http://www.stack.nl/~marcov/buildfaq.pdf Build FAQ]
+
=== Caveats, observations, troubleshooting ===
<p>[http://wiki.lazarus.freepascal.org/fpcup Fpcup by Reinier]</p>
+
 
<p>[https://github.com/newpascal/fpcupdeluxe Fpcupdeluxe source]</p>
+
* 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.
<p>[https://github.com/newpascal/fpcupdeluxe/releases/latest Latest release]</p>
+
* copy and save the logfile for reference / troubleshoot.
<p>[http://newpascal.org NewPascal]</p>
+
* adding the [[help]] system is easy: just tag it under "advanced settings", saving some manual labour.
 +
* it takes about 10 minutes to make a full new install of fpc + Laz.
 +
* 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).
 +
* 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.
 +
 
 +
== Launching an installed Lazarus and fpc instance ==
 +
 
 +
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:
 +
 
 +
  /home/user/Desktop/Lazarus_trunk.desktop (launcher)
 +
  /home/user/Lazarus_trunk  (shell script)
 +
 
 +
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"):
 +
 
 +
<syntaxhighlight lang="bash">
 +
  #!/bin/sh
 +
  # fpcupdeluxe: FPC home startlink script
 +
  export PATH="/home/user/trunk/fpc/bin/x86_64-linux:/home/user/trunk/lazarus:${PATH}"
 +
  export PPC_CONFIG_PATH="/home/user/trunk/fpc/bin/x86_64-linux"
 +
  exec /bin/bash
 +
</syntaxhighlight>
 +
 
 +
Windows equivalent batch file for setting up environment for working from command line (using example install dir of "f:\trunk"):
 +
 
 +
<syntaxhighlight lang="batch">
 +
  REM fpcupdeluxe: FPC home startlink script
 +
  SET PATH=F:\trunk\fpc\bin\x86_64-win64;F:\trunk\lazarus;%PATH%
 +
  SET PPC_CONFIG_PATH=F:\trunk\fpc\bin\x86_64-win64
 +
  cmd.exe
 +
</syntaxhighlight>
 +
 
 +
{{Note|Setting the paths this way is not global and only effects the current terminal shell and child shells.}}
  
 +
== External links ==
  
[[category:Install]]
+
* See in depth guide for ''BUILD / MAKE'': [http://www.stack.nl/~marcov/buildfaq.pdf Build FAQ]
 +
* [http://wiki.lazarus.freepascal.org/fpcup Fpcup by Reinier]
 +
* [https://github.com/newpascal/fpcupdeluxe Fpcupdeluxe source]
 +
* [https://github.com/newpascal/fpcupdeluxe/releases/latest Latest release]
 +
* [http://newpascal.org NewPascal]

Revision as of 05:08, 8 October 2021

Deutsch (de) English (en) español (es) русский (ru)

Overview

FPCUPdeluxe on Linux

FPCUPdeluxe is a GUI installer for FPC and Lazarus. It's based on fpcup.

Installation of FPC and Lazarus

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.

In order to have the installation working you MUST use the generated link to start the install !

That launcher link contains a line like:

Exec=/P/s/lazarus/lazarus --pcp="/P/s/config_lazarus"

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.

Prerequisites

Debian, Raspbian, Mint gtk2

actual working with Debian Buster and Raspbian Buster

#!/bin/bash
sudo apt-get update
sudo apt-get upgrade

# Missing Packages
sudo apt-get install libx11-dev
sudo apt-get install libgdk-pixbuf2.0-dev
sudo apt-get install libpango1.0-dev 
sudo apt-get install libgtk2.0-dev 

# if gdb is not installed (eg. Lubuntu)
sudo apt-get install gdb

# GIT is the new SVN
sudo apt-get install git

Debian qt5

#!/bin/bash
sudo apt-get update
sudo apt-get upgrade

# Missing Packages
sudo apt install libqt5pas-dev 

# GIT is the new SVN
sudo apt-get install git

See Qt5_Interface#Linux

Raspbian on RPi2

You need to extend the swap see Lazarus_on_Raspberry_Pi

Advanced settings

FPCUPdeluxe advanced settings screen

The above screenshot (click Setup+ on mainscreen) shows the advanced settings of FPCUPdeluxe.

Some examples of advanced settings:

  • for debugging FPC itself, add "-g -gl -O-" into the "FPC options" field.
  • 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.

Cross-compiling

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.

Use the link to see what is available at the moment:

Cross-compiling from Windows and Linux towards Darwin: the hard way

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).

First, you will need to get osxcross/cctools-port, and compile it yourself.

For macOS, you will need the osxcross for FPC that has been adapted for use by FPC.

For iOS/iPhone, you will need the cctools-port for FPC that has been adapted for use by FPC.

Get yourself a SDK, either from your own Mac, or from online sources: Various Mac SDK's

SDKs for iPhone can also be obtained from online sources: Various iPhone SDK's

Build osxcross/cctools-port according to the instructions. For example, on Windows with Cygwin.

Light bulb  Note: Please note: to be able to cross from Windows towards Darwin, you need to have NewPascal or FPC trunk installed !

Use fpcupdeluxe to install NewPascal or FPC trunk.

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:

  • 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.

Point fpcupdeluxe towards the library location
Point fpcupdeluxe towards the binary tools location
  • Now, on the mainscreen, you can select your CPU and OS (Darwin) and build the cross-compiler !

  • Again, fpcupdeluxe also has pre-built tools for crossing towards Darwin: using the fpcupdeluxe-auto-magic will be the easiest !!!

Caveats, observations, troubleshooting

  • 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.
  • copy and save the logfile for reference / troubleshoot.
  • adding the help system is easy: just tag it under "advanced settings", saving some manual labour.
  • it takes about 10 minutes to make a full new install of fpc + Laz.
  • 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).
  • 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.

Launching an installed Lazarus and fpc instance

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:

 /home/user/Desktop/Lazarus_trunk.desktop (launcher)
 /home/user/Lazarus_trunk  (shell script)

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"):

  #!/bin/sh
  # fpcupdeluxe: FPC home startlink script
  export PATH="/home/user/trunk/fpc/bin/x86_64-linux:/home/user/trunk/lazarus:${PATH}"
  export PPC_CONFIG_PATH="/home/user/trunk/fpc/bin/x86_64-linux"
  exec /bin/bash

Windows equivalent batch file for setting up environment for working from command line (using example install dir of "f:\trunk"):

  REM fpcupdeluxe: FPC home startlink script
  SET PATH=F:\trunk\fpc\bin\x86_64-win64;F:\trunk\lazarus;%PATH%
  SET PPC_CONFIG_PATH=F:\trunk\fpc\bin\x86_64-win64
  cmd.exe
Light bulb  Note: Setting the paths this way is not global and only effects the current terminal shell and child shells.

External links