Reworked the project structure.

This commit is contained in:
2026-09-12 11:10:17 +02:00
parent 15741f5f8a
commit be7a4782e8
8 changed files with 81 additions and 14657 deletions

44
.gitignore vendored
View File

@@ -3,25 +3,35 @@ __pycache__/
*.py[cod] *.py[cod]
.pytest_cache/ .pytest_cache/
.idea/ .idea/
.run/
# Legacy safety net only. Release tooling requires private keys outside the
# checkout and generated artifact tree.
release-keys/ release-keys/
config/local.toml config/local.toml
diagnostics/config/local.toml
# Local development, investigation, and release tooling. The production # Generated builds, candidates, runtime evidence, and machine-local state.
# repository intentionally contains only the installer/runtime sources. .artifacts/
AGENTS.md
AIO_INSTALLER.md # Legacy output locations remain ignored while existing local data is migrated
BOOTSTRAP_WORKPLAN.md # manually. New commands write only below .artifacts/.
DEBUGGING.md candidates/
GITEA_UPDATES.md dist/
README.md
config/
configs/
findings/
replay_pid*.log replay_pid*.log
results/ results/
testcases/ runner-data/
tests/ runner-token
tools/ infra/gitea-runner/.env
dist/ infra/gitea-runner/runner-data/
/native/ infra/gitea-runner/runner-token
server/telemetry/.env
/diagnostics/
/devtools/
/docs/
/infra/
/artifacts/
/release_tests/
/tests/
/tools/
/.gitea/
/.run/

117
install.sh Normal file → Executable file
View File

@@ -3,8 +3,23 @@
set -euo pipefail set -euo pipefail
SOURCE_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" SOURCE_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
if [[ -d "${SOURCE_ROOT}/src/ptlinux" ]]
then
PACKAGE_SOURCE_ROOT="${SOURCE_ROOT}/src"
else
# Bootstrap archives retain the historical top-level package layout.
PACKAGE_SOURCE_ROOT="$SOURCE_ROOT"
fi
if [[ -d "${SOURCE_ROOT}/native/gamescope" ]]
then
GAMESCOPE_PROVENANCE_ROOT="${SOURCE_ROOT}/native/gamescope"
GAMESCOPE_PATCH_ROOT="${GAMESCOPE_PROVENANCE_ROOT}/patches"
else
GAMESCOPE_PROVENANCE_ROOT="${PACKAGE_SOURCE_ROOT}/ptlinux/native"
GAMESCOPE_PATCH_ROOT="$GAMESCOPE_PROVENANCE_ROOT"
fi
SEMVER_PATTERN='(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|rc)\.(0|[1-9][0-9]*))?' SEMVER_PATTERN='(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|rc)\.(0|[1-9][0-9]*))?'
SOURCE_VERSION="$(sed -n 's/^__version__ = "\([^"]*\)"$/\1/p' "${SOURCE_ROOT}/ptlinux/__init__.py")" SOURCE_VERSION="$(sed -n 's/^__version__ = "\([^"]*\)"$/\1/p' "${PACKAGE_SOURCE_ROOT}/ptlinux/__init__.py")"
VERSION="${PTLINUX_VERSION:-$SOURCE_VERSION}" VERSION="${PTLINUX_VERSION:-$SOURCE_VERSION}"
if [[ ! "$VERSION" =~ ^${SEMVER_PATTERN}$ ]] if [[ ! "$VERSION" =~ ^${SEMVER_PATTERN}$ ]]
then then
@@ -153,25 +168,30 @@ APP_ROOT="${INSTALL_DIRECTORY}/app"
RELEASES_ROOT="${APP_ROOT}/releases" RELEASES_ROOT="${APP_ROOT}/releases"
RELEASE_ROOT="${RELEASES_ROOT}/${VERSION}" RELEASE_ROOT="${RELEASES_ROOT}/${VERSION}"
if [[ ! -d "${SOURCE_ROOT}/ptlinux" \ if [[ ! -d "${PACKAGE_SOURCE_ROOT}/ptlinux" \
|| ! -f "${SOURCE_ROOT}/ptdiag/assbin.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptdiag/assbin.py" \
|| ! -f "${SOURCE_ROOT}/ptdiag/__init__.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptdiag/__init__.py" \
|| ! -f "${SOURCE_ROOT}/ptdiag/logs.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptdiag/logs.py" \
|| ! -f "${SOURCE_ROOT}/ptlinux/desktop_entry.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/desktop_entry.py" \
|| ! -f "${SOURCE_ROOT}/ptlinux/launcher_wrapper.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/launcher_wrapper.py" \
|| ! -f "${SOURCE_ROOT}/ptlinux/self_update.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/self_update.py" \
|| ! -f "${SOURCE_ROOT}/ptlinux/ui/__init__.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/ui/__init__.py" \
|| ! -f "${SOURCE_ROOT}/ptlinux/ui/dashboard.py" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/ui/dashboard.py" \
|| ! -f "${SOURCE_ROOT}/ptlinux/launcher-update-public.pem" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/launcher-update-public.pem" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/pt-identity-probe.exe" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/native/pt-identity-probe.exe" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-3.16.20-ubuntu26.04-amd64" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/native/ptr-bcrypt-proxy.dll" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-compat.README" \ || ! -f "${PACKAGE_SOURCE_ROOT}/ptlinux/native/gamescope-3.16.20-ubuntu26.04-amd64" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-compat.copyright" \ || ! -f "${GAMESCOPE_PROVENANCE_ROOT}/gamescope-compat.README" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-lazy-output-images.patch" \ || ! -f "${GAMESCOPE_PROVENANCE_ROOT}/gamescope-compat.copyright" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-wayland-live-resize.patch" \ || ! -f "${GAMESCOPE_PATCH_ROOT}/gamescope-lazy-output-images.patch" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-wayland-letterbox-backing.patch" \ || ! -f "${GAMESCOPE_PATCH_ROOT}/gamescope-wayland-live-resize.patch" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-wayland-libdecor-input-scope.patch" \ || ! -f "${GAMESCOPE_PATCH_ROOT}/gamescope-wayland-letterbox-backing.patch" \
|| ! -f "${SOURCE_ROOT}/ptlinux/native/gamescope-keep-nested-windows-visible.patch" \ || ! -f "${GAMESCOPE_PATCH_ROOT}/gamescope-wayland-libdecor-input-scope.patch" \
|| ! -f "${GAMESCOPE_PATCH_ROOT}/gamescope-keep-nested-windows-visible.patch" \
|| ! -f "${SOURCE_ROOT}/scripts/__init__.py" \
|| ! -f "${SOURCE_ROOT}/scripts/repository_paths.py" \
|| ! -f "${SOURCE_ROOT}/scripts/release_lib.py" \
|| ! -f "${SOURCE_ROOT}/release/config.json" \
|| ! -f "${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.desktop" \ || ! -f "${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.desktop" \
|| ! -f "${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.png" \ || ! -f "${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.png" \
|| ! -f "${SOURCE_ROOT}/packaging/pristontale-eu" \ || ! -f "${SOURCE_ROOT}/packaging/pristontale-eu" \
@@ -223,7 +243,7 @@ then
fi fi
if ! "$PYTHON_BIN" -I -B -c \ if ! "$PYTHON_BIN" -I -B -c \
'import sys; sys.path.insert(0, sys.argv[1]); from ptlinux.update_resolver import validate_channel_version; validate_channel_version(sys.argv[2], sys.argv[3])' \ 'import sys; sys.path.insert(0, sys.argv[1]); from ptlinux.update_resolver import validate_channel_version; validate_channel_version(sys.argv[2], sys.argv[3])' \
"$SOURCE_ROOT" "$RELEASE_CHANNEL" "$VERSION" "$PACKAGE_SOURCE_ROOT" "$RELEASE_CHANNEL" "$VERSION"
then then
printf '%s\n' "Launcher version and release channel validation failed." >&2 printf '%s\n' "Launcher version and release channel validation failed." >&2
exit 1 exit 1
@@ -236,46 +256,17 @@ then
printf 'Launcher staging path already exists: %s\n' "$STAGING_RELEASE" >&2 printf 'Launcher staging path already exists: %s\n' "$STAGING_RELEASE" >&2
exit 1 exit 1
fi fi
install -d -m 0755 "$STAGING_RELEASE" if ! "$PYTHON_BIN" -I -B -c \
install -d -m 0755 \ 'import sys; from pathlib import Path; sys.path.insert(0, sys.argv[1]); from scripts.release_lib import load_config, stage_runtime_payload; stage_runtime_payload(Path(sys.argv[2]), load_config(Path(sys.argv[3])), source_root=Path(sys.argv[4]))' \
"${STAGING_RELEASE}/ptlinux" \ "$SOURCE_ROOT" "$STAGING_RELEASE" "${SOURCE_ROOT}/release/config.json" "$SOURCE_ROOT"
"${STAGING_RELEASE}/ptlinux/native" \ then
"${STAGING_RELEASE}/ptdiag" printf '%s\n' "The launcher runtime payload could not be staged." >&2
shopt -s globstar nullglob if [[ -d "$STAGING_RELEASE" && ! -L "$STAGING_RELEASE" ]]
for SOURCE_MODULE in "${SOURCE_ROOT}/ptlinux/"**/*.py then
do rm -r -- "$STAGING_RELEASE"
RELATIVE_MODULE="${SOURCE_MODULE#"${SOURCE_ROOT}/ptlinux/"}" fi
case "$RELATIVE_MODULE" in exit 1
desktop_entry.py|launcher_wrapper.py) fi
continue
;;
esac
install -D -m 0644 \
"$SOURCE_MODULE" \
"${STAGING_RELEASE}/ptlinux/${RELATIVE_MODULE}"
done
shopt -u globstar nullglob
install -m 0644 \
"${SOURCE_ROOT}/ptlinux/launcher-update-public.pem" \
"${STAGING_RELEASE}/ptlinux/launcher-update-public.pem"
install -m 0644 \
"${SOURCE_ROOT}/ptlinux/native/pt-identity-probe.exe" \
"${STAGING_RELEASE}/ptlinux/native/pt-identity-probe.exe"
install -m 0755 \
"${SOURCE_ROOT}/ptlinux/native/gamescope-3.16.20-ubuntu26.04-amd64" \
"${STAGING_RELEASE}/ptlinux/native/gamescope-3.16.20-ubuntu26.04-amd64"
install -m 0644 \
"${SOURCE_ROOT}/ptlinux/native/gamescope-compat.README" \
"${SOURCE_ROOT}/ptlinux/native/gamescope-compat.copyright" \
"${SOURCE_ROOT}/ptlinux/native/gamescope-lazy-output-images.patch" \
"${SOURCE_ROOT}/ptlinux/native/gamescope-wayland-live-resize.patch" \
"${SOURCE_ROOT}/ptlinux/native/gamescope-wayland-letterbox-backing.patch" \
"${SOURCE_ROOT}/ptlinux/native/gamescope-wayland-libdecor-input-scope.patch" \
"${SOURCE_ROOT}/ptlinux/native/gamescope-keep-nested-windows-visible.patch" \
"${STAGING_RELEASE}/ptlinux/native/"
install -m 0644 "${SOURCE_ROOT}/ptdiag/__init__.py" "${STAGING_RELEASE}/ptdiag/__init__.py"
install -m 0644 "${SOURCE_ROOT}/ptdiag/assbin.py" "${STAGING_RELEASE}/ptdiag/assbin.py"
install -m 0644 "${SOURCE_ROOT}/ptdiag/logs.py" "${STAGING_RELEASE}/ptdiag/logs.py"
printf '{\n "channel": "%s",\n "config_schema": 1,\n "minimum_config_schema": 1,\n "schema": 1,\n "tag": "v%s",\n "version": "%s"\n}\n' \ printf '{\n "channel": "%s",\n "config_schema": 1,\n "minimum_config_schema": 1,\n "schema": 1,\n "tag": "v%s",\n "version": "%s"\n}\n' \
"$RELEASE_CHANNEL" "$VERSION" "$VERSION" > "${STAGING_RELEASE}/release.json" "$RELEASE_CHANNEL" "$VERSION" "$VERSION" > "${STAGING_RELEASE}/release.json"
chmod 0644 "${STAGING_RELEASE}/release.json" chmod 0644 "${STAGING_RELEASE}/release.json"
@@ -357,7 +348,7 @@ CURRENT_LINK="${APP_ROOT}/.current.$$.tmp"
ln -s -- "releases/${VERSION}" "$CURRENT_LINK" ln -s -- "releases/${VERSION}" "$CURRENT_LINK"
mv -Tf -- "$CURRENT_LINK" "${APP_ROOT}/current" mv -Tf -- "$CURRENT_LINK" "${APP_ROOT}/current"
"$PYTHON_BIN" "${SOURCE_ROOT}/ptlinux/launcher_wrapper.py" \ "$PYTHON_BIN" "${PACKAGE_SOURCE_ROOT}/ptlinux/launcher_wrapper.py" \
"${SOURCE_ROOT}/packaging/pristontale-eu" \ "${SOURCE_ROOT}/packaging/pristontale-eu" \
"$APP_ROOT" \ "$APP_ROOT" \
"$INSTALL_DIRECTORY" \ "$INSTALL_DIRECTORY" \
@@ -365,7 +356,7 @@ mv -Tf -- "$CURRENT_LINK" "${APP_ROOT}/current"
install -m 0644 \ install -m 0644 \
"${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.png" \ "${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.png" \
"$ICON_PATH" "$ICON_PATH"
"$PYTHON_BIN" "${SOURCE_ROOT}/ptlinux/desktop_entry.py" \ "$PYTHON_BIN" "${PACKAGE_SOURCE_ROOT}/ptlinux/desktop_entry.py" \
"${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.desktop" \ "${SOURCE_ROOT}/packaging/eu.pristontale.PTLinux.desktop" \
"${BIN_HOME}/pristontale-eu" \ "${BIN_HOME}/pristontale-eu" \
"$ICON_PATH" \ "$ICON_PATH" \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff