Skip to content

Instantly share code, notes, and snippets.

@jimmckeeth
Last active November 28, 2023 14:28
  • Star 20 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
This script automates the setup of Ubuntu 22.04 LTS for Delphi 11.3 Alexandria

Settings up Ubuntu LTS for Delphi 11.3 Alexandria

Short link for this GIST https://embt.co/Ubuntu4Delphi22

The below Bash script works with Ubuntu 20.04 LTS and 22.04 LTS, on WSL2, VM, or hardware install.

Installing WSL2 on Windows 11

Microsoft has a full article with all the details. This is a summary for quick reference.

On Windows you need to do this from an elevated (administrator) command prompt or PowerShell window. Easiest way is Win+X,A.

wsl --install -d Ubuntu

Once your machine has finished rebooting, installation will continue and you will be asked to enter a username and password. This will be your Linux credential for the Ubuntu distribution.

Start Ubuntu from the start menu, or from the terminal by typing ubuntu

Then run the following script

curl -L https://embt.co/SetupUbuntu4Delphi22 | bash

If you don't have curl installed then run sudo apt install curl -y first

#!/bin/bash
#
# Download and execute with the following:
# curl -L https://embt.co/SetupUbuntu4Delphi22 | bash
#
echo "Updating the local package directory"
sudo apt update
echo "Upgrading any outdated pacakges"
sudo apt full-upgrade -y
echo "Install new packages necessary for Delphi & FMXLinux"
sudo apt install joe python3 libpython3-dev wget p7zip-full curl libgtk-3-dev openssh-server build-essential zlib1g-dev libgtk-3-dev libcurl4-gnutls-dev libncurses5 xorg libgl1-mesa-dev libosmesa-dev libgtk-3-bin -y
echo "Clean-up unused packages"
sudo apt autoremove -y
cd ~
echo "Downloading Linux PAServer for Alexandria 11.3 (22.0)"
wget https://altd.embarcadero.com/releases/studio/22.0/113/LinuxPAServer22.0.tar.gz
echo "Setting up directories to extract PA Server into"
mkdir PAServer
mkdir PAServer/22.0
rm PAServer/22.0/*
tar xvf LinuxPAServer22.0.tar.gz -C PAServer/22.0 --strip-components=1
# This fixes the Python 3.6 dependency
ln -sf `ls -1 /usr/lib/x86_64-linux-gnu/libpython3.*.so.1.0 | tail -1` ~/PAServer/22.0/lldb/lib/libpython3.so
rm LinuxPAServer22.0.tar.gz
echo \#\!\/bin\/bash >pa22.sh
echo # https://docwiki.embarcadero.com/RADStudio/en/Setting_Options_for_the_Platform_Assistant >>pa22.sh
echo ~/PAServer/22.0/paserver >>pa22.sh
chmod +x pa22.sh
echo "-----------------------------------"
echo " To launch PAServer type ~/pa22.sh"
echo "-----------------------------------"
# ~/pa22.sh
exit
@MassimoFa
Copy link

Awesome script. Tested on Ubuntu 22.04 LTS. It works perfectly!

@Jedt3D
Copy link

Jedt3D commented May 7, 2023

Thanks! Test on Elementary OS 7 (based on Ubuntu 22.04) it is working too.

Notes

  • Embarcadero's URL for PA Server
  • I've managed to install some dependencies for TMS FNC to use with FMX Linux too. According to their installation guide, we should install this packages.
sudo apt install joe wget p7zip-full curl openssh-server build-essential zlib1g-dev libcurl4-gnutls-dev libncurses5
sudo apt-get install zlib1g-dev
sudo apt install libgl1-mesa-glx libglu1-mesa libgtk-3-common libgstreamer1.0-0 libgstreamer-plugins-base1.0-0
sudo apt install libwebkit2gtk-4.0-dev

@Jedt3D
Copy link

Jedt3D commented Jun 29, 2023

@jimmckeeth I've tested on LinuxMint 21.1 cinnamon today (June 29, 2023).
It's working well also.
Small typos in the scripts

  1. libgtk-3-dev appears two times in line 11
  2. echo # https://do... should be echo \# https://do...

Thank you for your Linux support!

@Vizit0r
Copy link

Vizit0r commented Jul 14, 2023

after updating to latest Delphi (28.0.48361.3236) PAServer also was updated to version 13.3.12.7, but script downloads from server the old version (13.3.12.6), which is incompatible with newest.
So, i have to use script, than manually change all paserver files, and use chmod +x (recursively).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment