Add Flatpak’s *.Locale runtime extension support

Enables partial downloading of only required l10n files
This commit is contained in:
GITNE 2022-09-27 22:22:22 +02:00
parent 2bcd79b0bf
commit 4c02395dfa

View file

@ -2,6 +2,7 @@ app-id: org.ppsspp.PPSSPP
runtime: org.freedesktop.Platform runtime: org.freedesktop.Platform
runtime-version: '22.08' runtime-version: '22.08'
sdk: org.freedesktop.Sdk sdk: org.freedesktop.Sdk
separate-locales: false
rename-icon: ppsspp rename-icon: ppsspp
rename-desktop-file: PPSSPPSDL.desktop rename-desktop-file: PPSSPPSDL.desktop
command: PPSSPPSDL command: PPSSPPSDL
@ -14,6 +15,14 @@ finish-args:
- --share=ipc - --share=ipc
- --share=network - --share=network
- --talk-name=org.freedesktop.ScreenSaver - --talk-name=org.freedesktop.ScreenSaver
add-extensions:
org.ppsspp.PPSSPP.Locale:
directory: share/locale
bundle: true
no-autodownload: false
subdirectories: false
autodelete: true
locale-subset: true
modules: modules:
- shared-modules/glu/glu-9.json - shared-modules/glu/glu-9.json
- shared-modules/glew/glew.json - shared-modules/glew/glew.json
@ -38,12 +47,15 @@ modules:
- -DUSING_GLES2=ON - -DUSING_GLES2=ON
post-install: post-install:
- desktop-file-edit --set-name=PPSSPP ${FLATPAK_DEST}/share/applications/PPSSPPSDL.desktop - desktop-file-edit --set-name=PPSSPP ${FLATPAK_DEST}/share/applications/PPSSPPSDL.desktop
- install -Dm644 icons/icon-512.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/ppsspp.svg
- install -Dm644 ${FLATPAK_ID}.metainfo.xml -t ${FLATPAK_DEST}/share/metainfo - install -Dm644 ${FLATPAK_ID}.metainfo.xml -t ${FLATPAK_DEST}/share/metainfo
cleanup:
- /share/ppsspp/assets/lang/README.md
sources: sources:
- type: git - type: git
url: https://github.com/hrydgard/ppsspp.git url: &ppsspp-url https://github.com/hrydgard/ppsspp.git
tag: v1.13.2 tag: &ppsspp-tag v1.13.2
commit: 9fe6338e3bf397f8a009a51a282c139dfa180eb6 commit: &ppsspp-commit 9fe6338e3bf397f8a009a51a282c139dfa180eb6
x-checker-data: x-checker-data:
type: git type: git
tag-pattern: ^v([\d.]+)$ tag-pattern: ^v([\d.]+)$
@ -51,3 +63,20 @@ modules:
- type: file - type: file
path: org.ppsspp.PPSSPP.metainfo.xml path: org.ppsspp.PPSSPP.metainfo.xml
- name: ppsspp-localization
buildsystem: simple
build-commands:
- |
for LANG_FILE in assets/lang/*.ini
do LANG_FILE_BASENAME="$(basename "$LANG_FILE")"
PPSSPP_LANG="$(grep -Eo '^[a-z]{2}' <<< "$LANG_FILE_BASENAME")"
ln -fsr "$FLATPAK_DEST/share/locale/$PPSSPP_LANG/ppsspp/$LANG_FILE_BASENAME" "$FLATPAK_DEST/share/ppsspp/$LANG_FILE"
install -Dm644 "$LANG_FILE" "$FLATPAK_DEST/share/locale/$PPSSPP_LANG/ppsspp/$LANG_FILE_BASENAME"
done
sources:
- type: git
url: *ppsspp-url
tag: *ppsspp-tag
commit: *ppsspp-commit
disable-submodules: true