Fix read-only /app failure + add app icon
On first launch O3DE pip-installs its 'o3de' CLI with 'pip install -e'
(editable), which writes an egg-info next to the source under read-only
/app and fails ([Errno 30] Read-only file system), leaving the venv broken
("unable to install O3DE's built-in Python").
- Patch cmake/LYPython.cmake at build time to force a normal (non-editable)
install, which builds in a temp dir and lands in the writable ~/.o3de venv.
- Drop the build-time get_python "bake": the venv is per-user (keyed to
$HOME), so it can only be created at runtime; baking under a throwaway
build HOME did nothing. Speeds up CI; removes cmake/python3 build deps and
the network build-arg.
- Add a real launcher icon (org.o3de.O3DE.png).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+10
-16
@@ -28,11 +28,6 @@ finish-args:
|
||||
modules:
|
||||
- name: o3de
|
||||
buildsystem: simple
|
||||
# The Python bootstrap step (below) downloads O3DE's Python runtime into the
|
||||
# install tree, so this module needs network access during the build.
|
||||
build-options:
|
||||
build-args:
|
||||
- --share=network
|
||||
build-commands:
|
||||
# The .deb is an `ar` archive containing data.tar.{gz,xz,zst}.
|
||||
- ar x o3de.deb
|
||||
@@ -42,25 +37,22 @@ modules:
|
||||
# is kept for robustness in case a future release adds desktop glue there.)
|
||||
- 'if [ -d data/opt ]; then mkdir -p "${FLATPAK_DEST}/opt"; cp -a data/opt/. "${FLATPAK_DEST}/opt/"; fi'
|
||||
- 'if [ -d data/usr ]; then cp -a data/usr/. "${FLATPAK_DEST}/"; fi'
|
||||
# O3DE fetches its own Python runtime on first use, writing into its install
|
||||
# tree. That tree is read-only at runtime in a Flatpak, so bake Python in now
|
||||
# while ${FLATPAK_DEST} is still writable.
|
||||
# On first launch O3DE pip-installs its 'o3de' CLI editable ('pip install
|
||||
# -e'), which writes an egg-info into read-only /app and fails. Force a
|
||||
# normal install (built in a temp dir, lands in the writable ~/.o3de venv).
|
||||
- |
|
||||
set -e
|
||||
ENGINE_DIR=$(find "${FLATPAK_DEST}/opt/O3DE" -mindepth 1 -maxdepth 1 -type d | head -n1)
|
||||
echo "Engine dir: ${ENGINE_DIR}"
|
||||
if [ -x "${ENGINE_DIR}/python/get_python.sh" ]; then
|
||||
( cd "${ENGINE_DIR}" && HOME="${PWD}" ./python/get_python.sh )
|
||||
LYPYTHON=$(find "${FLATPAK_DEST}/opt/O3DE" -path '*/cmake/LYPython.cmake' | head -n1)
|
||||
if [ -n "$LYPYTHON" ] && grep -q 'set(_pip_install_mode_args "-e")' "$LYPYTHON"; then
|
||||
sed -i 's/set(_pip_install_mode_args "-e")/set(_pip_install_mode_args "")/' "$LYPYTHON"
|
||||
else
|
||||
echo "::warning:: get_python.sh not found; Python may fail at runtime"
|
||||
echo "::warning:: editable-install line not found in LYPython.cmake"
|
||||
fi
|
||||
# Launcher + AppStream + desktop entry under the Flatpak app-id.
|
||||
- install -Dm755 o3de-wrapper.sh "${FLATPAK_DEST}/bin/o3de-wrapper.sh"
|
||||
- install -Dm644 org.o3de.O3DE.desktop "${FLATPAK_DEST}/share/applications/org.o3de.O3DE.desktop"
|
||||
- install -Dm644 org.o3de.O3DE.metainfo.xml "${FLATPAK_DEST}/share/metainfo/org.o3de.O3DE.metainfo.xml"
|
||||
# NOTE: the .deb ships no clean application icon (only in-editor asset icons),
|
||||
# so none is installed; the desktop entry falls back to a generic icon. Drop a
|
||||
# real logo into the repo and install it here to fix the launcher icon.
|
||||
- install -Dm644 org.o3de.O3DE.png "${FLATPAK_DEST}/share/icons/hicolor/256x256/apps/org.o3de.O3DE.png"
|
||||
sources:
|
||||
- type: file
|
||||
path: o3de.deb
|
||||
@@ -70,3 +62,5 @@ modules:
|
||||
path: org.o3de.O3DE.desktop
|
||||
- type: file
|
||||
path: org.o3de.O3DE.metainfo.xml
|
||||
- type: file
|
||||
path: org.o3de.O3DE.png
|
||||
|
||||
Reference in New Issue
Block a user