Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/commit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,24 @@ jobs:
severity: error

ubuntu_test:
name: Ubuntu 24.04
runs-on: ubuntu-24.04
name: Ubuntu 26.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run Setup
- name: Run Setup and Verify PAServer in Ubuntu 26.04
run: |
chmod +x ./scripts/SetupLinux4Delphi.sh
sudo ./scripts/SetupLinux4Delphi.sh 13.0
- name: Verify PAServer
run: |
/usr/local/bin/pa13.0.sh &
sleep 10
pgrep paserver
docker run --rm --privileged \
-e DEBIAN_FRONTEND=noninteractive \
-v "$PWD:/workspace" \
ubuntu:26.04 \
bash -c "
set -e
chmod +x /workspace/scripts/SetupLinux4Delphi.sh
/workspace/scripts/SetupLinux4Delphi.sh 13.1
/usr/local/bin/pa13.1.sh &
sleep 15
pgrep paserver
"

rhel_test:
name: RHEL 10
Expand All @@ -43,9 +48,9 @@ jobs:
- name: Run Setup
run: |
chmod +x ./scripts/SetupLinux4Delphi.sh
./scripts/SetupLinux4Delphi.sh 13.0
./scripts/SetupLinux4Delphi.sh 13.1
- name: Verify PAServer
run: |
/usr/local/bin/pa13.0.sh &
/usr/local/bin/pa13.1.sh &
sleep 15
pgrep paserver
pgrep paserver
52 changes: 52 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Repository Guidelines

## Project Structure & Module Organization

This repository centers on one maintained Bash installer: `scripts/SetupLinux4Delphi.sh`. It installs PAServer and Linux dependencies for Delphi development across supported distributions. The `legacy/` directory contains superseded historical scripts and should be used only for reference. Images and README assets live in `images/`. GitHub Actions configuration is in `.github/workflows/commit_test.yml`. Local helper files such as `test-local.ps1` may exist, but production changes should stay focused on the maintained script and documentation.

## Build, Test, and Development Commands

- `shellcheck scripts/SetupLinux4Delphi.sh` checks the main script; CI treats ShellCheck findings at error severity.
- `bash -n scripts/SetupLinux4Delphi.sh` performs a fast Bash syntax check.
- `shfmt -d scripts/SetupLinux4Delphi.sh` previews formatting differences without rewriting the file.
- `powershell -ExecutionPolicy Bypass -File .\test-local.ps1` runs local validation when available.

GitHub Actions also runs live install tests for Ubuntu 26.04 and RHEL 10. Push to a `test**` branch to exercise CI before sending changes to `main`.

## Coding Style & Naming Conventions

Keep the main script POSIX-aware where practical, but preserve existing Bash conventions. Use uppercase variable names for installer state such as `COMPILER`, `PRODUCT`, `RELEASE`, and `PASERVER_URL`. Keep version alias handling in the `case "$PARAM"` block and maintain clear package-manager branches for `apt`, `dnf`, `yum`, and `pacman`. Prefer small, readable conditionals over dense one-liners because this script is intended to be reviewed before running with `sudo`.

## Testing Guidelines

Run ShellCheck and `bash -n` before committing script changes. When adding Delphi releases or package-manager behavior, update help text and CI version references in the same change. For risky install logic, test in WSL, a VM, or a container rather than on a production host.

## Commit & Pull Request Guidelines

Recent commits use short, direct, mostly lowercase subjects, for example `add 13.1 support for issue #5`. Keep commits scoped to one behavior or documentation update. Pull requests should describe the affected distro or Delphi version, list local checks run, link related issues, and include relevant CI results. Add screenshots only for README or asset changes.

## Agent-Specific Instructions

Do not modify `legacy/` unless the task explicitly targets historical scripts. Avoid reverting local user changes. When changing supported versions, verify the PAServer URL from the Embarcadero DocWiki rather than inferring it from nearby entries.

## Script Architecture

`scripts/SetupLinux4Delphi.sh` has three main phases:

1. Argument parsing: `PARAM` defaults to the latest supported compiler version. The argument loop handles `--help` and optional package-manager overrides.
2. Version resolution: `case "$PARAM"` maps accepted aliases to `COMPILER`, `PRODUCT`, `RELEASE`, and `PASERVER_URL`; `ARCHIVE` is derived from the URL basename.
3. Distro detection and install: the script reads `/etc/os-release`, selects `apt`, `dnf`, `yum`, or `pacman`, installs packages, downloads PAServer, extracts it, and writes `/usr/local/bin/pa$PRODUCT.sh`.

## Adding Delphi Versions

When adding a point release, add the specific version case before the broader compiler-version case. Update the canonical compiler alias to point at the latest point release, adjust the default `PARAM` if it is the newest release overall, and update both help-text blocks. Also update `.github/workflows/commit_test.yml` when CI should test the new version.

The compiler version, such as `37.0` or `23.0`, is the canonical alias and should map to the latest point release for that compiler. Specific product versions, such as `13.0` or `12.2`, should keep exact entries.

## PAServer URLs

PAServer download URLs are not fully predictable. Use the Embarcadero DocWiki page for the authoritative current URL:

`https://docwiki.embarcadero.com/RADStudio/en/Installing_the_Platform_Assistant_on_Linux`

For older releases, compare existing `case` entries before making a change.
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CLAUDE.md

@AGENTS.md
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Linux4Delphi Setup

[![ShellCheck](https://img.shields.io/github/actions/workflow/status/jimmckeeth/linux4delphi/commit_test.yml?job=ShellCheck&label=ShellCheck&logo=shell)](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml)
[![Ubuntu 24.04 with Delphi 13](https://img.shields.io/github/actions/workflow/status/jimmckeeth/linux4delphi/commit_test.yml?job=ubuntu_test&label=Ubuntu%2024.04%20with%20Delphi%2013&logo=ubuntu)](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml)
[![Ubuntu 26.04 with Delphi 13](https://img.shields.io/github/actions/workflow/status/jimmckeeth/linux4delphi/commit_test.yml?job=ubuntu_test&label=Ubuntu%2026.04%20with%20Delphi%2013&logo=ubuntu)](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml)
[![RHEL 10 with Delphi 13](https://img.shields.io/github/actions/workflow/status/jimmckeeth/linux4delphi/commit_test.yml?job=rhel_test&label=RHEL%2010%20with%20Delphi%2013&logo=redhat&logoColor=red)](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml)

**Update**: This project was formerly known as *Delphi-on-Linux-Setup*, but it has been renamed to *Linux4Delphi* to better reflect the scope of the project. Update your bookmarks and references accordingly.

Scripts and resources to simplify the setup and development with Delphi on Linux. It should work with all x86 64-bit Linux distros that Delphi suports in WSL, Virtual Machines, or running on hardware native.
Scripts and resources to simplify the setup and development with Delphi on Linux. It should work with all x86 64-bit Linux distros that Delphi supports in WSL, Virtual Machines, or running on hardware native.

Supporting Delphi 10.2 *Tokyo* (19.0) through Delphi 13 *Florence* (37.0), from one script. The installation location changed now, so it isn't user specific.

Expand All @@ -28,7 +28,7 @@ If you don't have curl you can use wget instead (Debian usually excludes curl by
wget -qO - https://tinyurl.com/SetupLinux4Delphi | sudo bash
```

⚠️*Warning*: Is is recommended to [locally review the script](scripts/SetupLinux4Delphi.sh) before running it in a *production* envorment.
⚠️*Warning*: It is recommended to [locally review the script](scripts/SetupLinux4Delphi.sh) before running it in a *production* environment.

✅*Update*: To improve performance, especially if testing in a containerized environment, calls to `apt`, `yum`, & `dnf` use `--no-install-recommends` or `--setopt=install_weak_deps=False` respectively, which prevents the installation of *recommended packages*, that are not essential for the core functionality. It also makes the script less likely to change unrelated packages you might need.

Expand All @@ -40,7 +40,8 @@ Usage: `sudo SetupLinux4Delphi.sh [version] [pkgmgr]`

Where [version] is one of the following:

* Florence 13.0 = `Florence`, `37.0`, `13.0` or *blank*
* Florence 13.1 = `Florence`, `37.0`, `13.1` or *blank*
* Florence 13.0 = `13.0`
* Athens 12.3 = `Athens`, `23.0`, `12.3`, or `12`
* Athens 12.2 = `12.2`
* Athens 12.1 = `12.1`
Expand Down Expand Up @@ -78,10 +79,11 @@ I tested Delphi 13 Florence against the following distros with this script:
* Ubuntu 20.04
* Ubuntu 22.04
* Ubuntu 24.04
* Ubuntu 26.04
* Kali Linux Rolling 2.6.3.0
* Debian 13 (trixie)
* Pengwin (WSL)
* Fedora bassed
* Fedora based
* Fedora Linux 42
* Fedora Remix for WSL
* Rocky Linux 9.6 (Blue Onyx)
Expand All @@ -102,17 +104,17 @@ The old version of the script installed it based on the compiler version number,

It defaults to a **blank password**. You should *probably* change that.

The instalation locations are as follows:
The installation locations are as follows:

* `INSTALL_DIR="/opt/PAServer/$PRODUCT"`
* `SCRIPT_PATH="/usr/local/bin/pa$PRODUCT.sh"`
* `SCRATCH_DIR="/var/tmp/paserver-$PRODUCT"`
* `SCRATCH_DIR="$REAL_HOME/.PAServer/$PRODUCT-scratch"`

Where `$PRODUCT` is 13.0, 12.2, etc. So you launch the *Florence* PAServer with `pa13.0.sh`.
Where `$PRODUCT` is 13.1, 13.0, 12.2, etc. So you launch the latest *Florence* PAServer with `pa13.1.sh`.

## More information

The installation of packages is based on the [DocWiki](https://docwiki.embarcadero.com/RADStudio/en/Linux_Application_Development), but with a few changes to address neuances of different distros & installs. If the script doesn't work on your distro of choice then see if the original DocWiki instructions do, and if that still doesn't work, then you distro or installation might not be supported.
The installation of packages is based on the [DocWiki](https://docwiki.embarcadero.com/RADStudio/en/Linux_Application_Development), but with a few changes to address nuances of different distros & installs. If the script doesn't work on your distro of choice then see if the original DocWiki instructions do, and if that still doesn't work, then your distro or installation might not be supported.

DocWiki Links:

Expand Down Expand Up @@ -148,4 +150,5 @@ Start Ubuntu from the start menu, or from the terminal by typing `ubuntu`
### Then run the following script

```bash
curl -fsSL https://tinyurl.com/SetupLinux4Delphi | sudo bash```
curl -fsSL https://tinyurl.com/SetupLinux4Delphi | sudo bash
```
63 changes: 18 additions & 45 deletions scripts/SetupLinux4Delphi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,49 +80,25 @@ while [[ $# -gt 0 ]]; do
done

case "$PARAM" in
"help"|"--help"|"h"|"--h"|"-h")
echo "Usage: sudo SetupUbuntu4Delphi.sh [version]"
echo ""
echo "Where [version] is one of the following:"
echo " 37.0, 13.1 = Florence 13.1 [DEFAULT]"
echo " 13.0 = Florence 13.0"
echo " 23.0, 12.3, 12 = Athens 12.3"
echo " 12.2 = Athens 12.2"
echo " 12.1 = Athens 12.1"
echo " 12.0 = Athens 12.0"
echo " 22.0, 11.3, 11 = Alexandria 11.3"
echo " 11.2 = Alexandria 11.2"
echo " 11.1 = Alexandria 11.1"
echo " 11.0 = Alexandria 11.0"
echo " 21.0, 10.4.1 = Sydney 10.4.1"
echo " 10.4.0 = Sydney 10.4.0"
echo " 20.0, 10.3, 10.3.3 = Rio 10.3.3"
echo " 10.3.2 = Rio 10.3.2"
echo " 10.3.1 = Rio 10.3.1"
echo " 10.3.0 = Rio 10.3.0"
echo " 19.0, 10.2, 10.2.3 = Tokyo 10.2.3"
echo " 10.2 = Tokyo 10.2.0"
exit 0
;;
# Florence
"37.0"|"13.1"|"florence")
COMPILER="37.0"
PRODUCT="13.1"
RELEASE="Florence"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/37.0/131/LinuxPAServer37.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/37.0/131/LinuxPAServer37.0.tar.gz"
;;
"13.0")
COMPILER="37.0"
PRODUCT="13.0"
RELEASE="Florence"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/37.0/130/LinuxPAServer37.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/37.0/130/LinuxPAServer37.0.tar.gz"
;;
# Athens
"23.0"|"12.3"|"12"|"athens")
COMPILER="23.0"
RELEASE="Athens"
PRODUCT="12.3"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/23.0/123/LinuxPAServer23.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/23.0/123/LinuxPAServer23.0.tar.gz"
;;
"12.2")
COMPILER="23.0"
Expand All @@ -140,14 +116,14 @@ case "$PARAM" in
COMPILER="23.0"
PRODUCT="12.0"
RELEASE="Athens"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/23.0/120/LinuxPAServer23.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/23.0/120/LinuxPAServer23.0.tar.gz"
;;
# Alexandria
"22.0"|"11"|"11.3"|"alexandria")
COMPILER="22.0"
PRODUCT="11.3"
RELEASE="Alexandria"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/22.0/113/LinuxPAServer22.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/22.0/113/LinuxPAServer22.0.tar.gz"
;;
"11.0")
COMPILER="22.0"
Expand Down Expand Up @@ -178,45 +154,45 @@ case "$PARAM" in
COMPILER="21.0"
PRODUCT="10.4.0"
RELEASE="Sydney"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/21.0/PAServer/LinuxPAServer21.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/21.0/PAServer/LinuxPAServer21.0.tar.gz"
;;
# Rio
"10.3"|"rio"|"10.3.3")
COMPILER="20.0"
PRODUCT="10.3.3"
RELEASE="Rio"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/20.0/PAServer/Release3/LinuxPAServer20.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/20.0/PAServer/Release3/LinuxPAServer20.0.tar.gz"
;;
"10.3.2")
COMPILER="20.0"
PRODUCT="10.3.2"
RELEASE="Rio"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/20.0/PAServer/Release2/LinuxPAServer20.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/20.0/PAServer/Release2/LinuxPAServer20.0.tar.gz"
;;
"10.3.1")
COMPILER="20.0"
PRODUCT="10.3.1"
RELEASE="Rio"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/20.0/PAServer/Release1/LinuxPAServer20.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/20.0/PAServer/Release1/LinuxPAServer20.0.tar.gz"
;;
"10.3.0")
COMPILER="20.0"
PRODUCT="10.3.0"
RELEASE="Rio"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/20.0/PAServer/LinuxPAServer20.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/20.0/PAServer/LinuxPAServer20.0.tar.gz"
;;
# Tokyo
"10.2")
COMPILER="19.0"
PRODUCT="10.2.0"
RELEASE="Tokyo"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/19.0/PAServer/LinuxPAServer19.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/19.0/PAServer/LinuxPAServer19.0.tar.gz"
;;
"tokyo"|"10.2.3")
COMPILER="19.0"
PRODUCT="10.2.3"
RELEASE="Tokyo"
PASERVER_URL="http://altd.embarcadero.com/releases/studio/19.0/PAServer/Release3/LinuxPAServer19.0.tar.gz"
PASERVER_URL="https://altd.embarcadero.com/releases/studio/19.0/PAServer/Release3/LinuxPAServer19.0.tar.gz"
;;
esac

Expand Down Expand Up @@ -336,7 +312,10 @@ if [[ "$PKG" == "apt" ]]; then
apt purge openssh-server -y
fi
# Removed libosmesa-dev from strict requirements
apt install joe wget p7zip-full curl build-essential zlib1g-dev libcurl4-gnutls-dev python3 libpython3-dev libgtk-3-dev $NCURSES_PKG xorg libgl1-mesa-dev libgtk-3-bin libc6-dev -y --no-install-recommends
if ! apt install joe wget p7zip-full curl build-essential zlib1g-dev libcurl4-gnutls-dev python3 libpython3-dev libgtk-3-dev $NCURSES_PKG xorg libgl1-mesa-dev libgtk-3-bin libc6-dev -y --no-install-recommends; then
echo "Required package installation failed. Aborting."
exit 1
fi
# Optional installation of OSMesa (handles missing package errors gracefully)
echo "Attempting to install optional libosmesa-dev..."
if apt install libosmesa-dev -y --no-install-recommends 2>/dev/null; then
Expand All @@ -355,6 +334,7 @@ elif [[ "$PKG" == "pacman" ]]; then
if command -v steamos-readonly &> /dev/null; then
echo "Temporarily disabling SteamOS read-only filesystem..."
steamos-readonly disable
trap 'if [ -f /etc/pacman.conf.bak ]; then mv /etc/pacman.conf.bak /etc/pacman.conf; fi; steamos-readonly enable' EXIT
fi

echo "Initializing pacman keyring and updating packages..."
Expand Down Expand Up @@ -396,6 +376,7 @@ else
fi

echo "Setting up directories for PAServer"
# Clear contents but keep the directory; mkdir -p always follows to recreate it if rm somehow removed it
rm -rf "${INSTALL_DIR:?}"/*
if ! mkdir -p "$INSTALL_DIR"; then
echo "Failed to create installation directory. Aborting."
Expand Down Expand Up @@ -460,14 +441,6 @@ if [ ! -f "$SCRIPT_PATH" ]; then
exit 1
fi

if [[ "$ID" == "steamos" ]]; then
# Re-enable SteamOS read-only filesystem
if command -v steamos-readonly &> /dev/null; then
echo "Re-enabling SteamOS read-only filesystem..."
steamos-readonly enable
fi
fi

if [[ -n "$osmesa" ]]; then
echo "$osmesa"
fi
Expand Down
Loading