Skip to content

fix(linux): enable Solar2DBuilder Android builds on Linux#891

Open
shtse8 wants to merge 1 commit intocoronalabs:masterfrom
shtse8:fix/linux-android-builder
Open

fix(linux): enable Solar2DBuilder Android builds on Linux#891
shtse8 wants to merge 1 commit intocoronalabs:masterfrom
shtse8:fix/linux-android-builder

Conversation

@shtse8
Copy link
Copy Markdown

@shtse8 shtse8 commented Mar 28, 2026

Fixes #890

What

Enables Solar2DBuilder to build Android APKs on Linux. The C++ code already had Rtt_LINUX_ENV defined and compiles fine — it just had Mac/Windows branches without a Linux equivalent in a few places.

Changes (5 files)

File Fix
CMakeLists.txt Simplify root cmake — was duplicating platform logic that belongs in platform/linux/CMakeList.txt
platform/linux/CMakeList.txt Add Rtt_AndroidSupportTools.c to Solar2DBuilder sources; add CORONABUILDER_ANDROID compile definition
Rtt_AppPackagerAndroidFactory.cpp Add Rtt_LINUX_ENV branch for AndroidValidation.lua path (was Mac/Win only)
Rtt_AppPackagerFactory.cpp Implement GetResourceDirectory() for Linux via /proc/self/exe readlink
tools/CoronaBuilder/main.cpp Use $TMPDIR instead of hardcoded /TemporaryFiles (root-owned on Linux CI)

Tested

Successfully builds Android APKs on Ubuntu 22.04 self-hosted runners. We've been using this in production CI for our Solar2D games.

Community build repo with pre-built binaries + auto-update workflow: https://github.com/Cubeage/solar2d-linux

Solar2DBuilder's Android packaging code had Mac/Windows branches but
no Linux equivalent. This adds the missing Linux support across 5 files.

Fixes:
- CMakeLists.txt: simplify root cmake to delegate to platform/linux
- platform/linux/CMakeList.txt: add Rtt_AndroidSupportTools.c to
  Solar2DBuilder sources; add CORONABUILDER_ANDROID compile definition
- Rtt_AppPackagerAndroidFactory.cpp: add Rtt_LINUX_ENV branch for
  AndroidValidation.lua path lookup (was Mac/Win only)
- Rtt_AppPackagerFactory.cpp: implement GetResourceDirectory() for
  Linux using /proc/self/exe readlink
- tools/CoronaBuilder/main.cpp: use $TMPDIR instead of hardcoded
  /TemporaryFiles (root-owned on Linux)

Tested: successfully builds Android APKs on Ubuntu 22.04 CI runners.

Closes coronalabs#890
@shtse8 shtse8 requested a review from Shchvova as a code owner March 28, 2026 20:07
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2026

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Community: Linux Solar2DBuilder builds for CI/CD (Android APK)

2 participants