Skip to content

Commit 648a1bc

Browse files
authored
Fix build date, unify build process for x64 and ARM versions, get NZ:P saving properly, and bring in various Flathub improvements (#1373)
* [Flatpak]: Get build date working * [Flatpak]: Unify x64 and ARM Versions, get NZ:P saving (properly) & bring in Flathub improvements * [Flatpak]: Remove line
1 parent 67ba97c commit 648a1bc

2 files changed

Lines changed: 28 additions & 42 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# flatpak build files
2+
.flatpak-builder
3+
build-dir

gay.nzp.nzportable.json

Lines changed: 25 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,58 @@
11
{
22
"app-id": "gay.nzp.nzportable",
33
"runtime": "org.freedesktop.Platform",
4-
"runtime-version": "24.08",
4+
"runtime-version": "25.08",
55
"sdk": "org.freedesktop.Sdk",
66
"command": "nzportable",
77
"finish-args": [
8-
"--device=dri",
98
"--share=ipc",
109
"--socket=pulseaudio",
1110
"--socket=x11",
12-
"--socket=wayland",
1311
"--env=SDL_VIDEODRIVER=x11",
1412
"--env=SDL_AUDIODRIVER=pulseaudio",
1513
"--filesystem=xdg-config",
1614
"--share=network",
17-
"--device=input"
15+
"--device=all"
1816
],
1917
"modules": [
2018
{
21-
"name": "nzportable-linux64",
22-
"only-arches": [
23-
"x86_64"
24-
],
19+
"name": "nzportable-launcher",
2520
"buildsystem": "simple",
26-
"build-commands": [
27-
"mkdir -p /app/bin",
28-
"mkdir -p /app/share/nzportable",
29-
"# install the game binary",
30-
"install -Dm755 nzportable64-sdl /app/share/nzportable/nzportable.bin",
31-
"# install default.fmf",
32-
"cp default.fmf /app/share/nzportable/",
33-
"# install game data",
34-
"mkdir -p /app/share/nzportable/nzp",
35-
"for f in *; do if [ \"$f\" != \"nzportable64-sdl\" ] && [ \"$f\" != \"default.fmf\" ]; then cp -r \"$f\" /app/share/nzportable/nzp/; fi; done",
36-
"echo \"nightly\" > /app/share/nzportable/nzp/version.txt",
37-
"printf '%s\\n' '#!/bin/bash' '' 'DATA_DIR=\"$HOME/.var/app/gay.nzp.nzportable/data\"' 'GAME_DIR=\"$DATA_DIR/nzportable\"' 'SOURCE_DIR=\"/app/share/nzportable\"' '' 'mkdir -p \"$DATA_DIR\"' '' 'if [ ! -d \"$GAME_DIR\" ] || [ ! -f \"$GAME_DIR/nzportable.bin\" ]; then' ' echo \"Setting up NZPortable data directory...\"' ' mkdir -p \"$GAME_DIR\"' ' cp -r \"$SOURCE_DIR\"/* \"$GAME_DIR/\"' ' chmod +x \"$GAME_DIR/nzportable.bin\"' ' echo \"Setup complete.\"' 'fi' '' 'if [ \"$SOURCE_DIR/nzp/version.txt\" -nt \"$GAME_DIR/nzp/version.txt\" ]; then' ' echo \"Updating game data...\"' ' # Preserve user settings' ' if [ -f \"$GAME_DIR/nzp/user_settings.cfg\" ]; then' ' cp \"$GAME_DIR/nzp/user_settings.cfg\" /tmp/nzp_user_settings_backup.cfg' ' fi' ' # Update game files' ' cp -r \"$SOURCE_DIR/nzp\"/* \"$GAME_DIR/nzp/\"' ' # Restore user settings' ' if [ -f \"/tmp/nzp_user_settings_backup.cfg\" ]; then' ' cp /tmp/nzp_user_settings_backup.cfg \"$GAME_DIR/nzp/user_settings.cfg\"' ' rm /tmp/nzp_user_settings_backup.cfg' ' fi' ' echo \"Update complete.\"' 'fi' '' 'cd \"$GAME_DIR\"' 'exec ./nzportable.bin \"$@\"' > nzportable-launcher",
38-
"",
39-
"install -Dm755 nzportable-launcher /app/bin/nzportable"
40-
],
4121
"sources": [
4222
{
43-
"type": "archive",
44-
"url": "https://github.com/nzp-team/nzportable/releases/download/nightly/nzportable-linux64.zip",
45-
"sha256": "ARCHIVE_SHA256_REPLACE"
23+
"type": "script",
24+
"dest-filename": "nzportable-launcher",
25+
"commands": [
26+
"export FTEHOME=\"$HOME/.var/app/gay.nzp.nzportable/data/nzportable/\"",
27+
"mkdir -p \"$FTEHOME/nzp\"",
28+
"exec /app/share/nzportable/nzportable.bin -basedir /app/share/nzportable -usehome \"$@\""
29+
]
4630
}
31+
],
32+
"build-commands": [
33+
"install -Dm755 nzportable-launcher /app/bin/nzportable"
4734
]
4835
},
4936
{
50-
"name": "nzportable-arm64",
51-
"only-arches": [
52-
"aarch64"
53-
],
37+
"name": "nzportable",
5438
"buildsystem": "simple",
5539
"build-commands": [
56-
"mkdir -p /app/bin",
57-
"mkdir -p /app/share/nzportable",
58-
"# install the game binary",
59-
"install -Dm755 nzportablearm64-sdl /app/share/nzportable/nzportable.bin",
60-
"# install default.fmf",
40+
"mkdir -p /app/bin /app/share/nzportable/nzp",
41+
"if [ -f nzportable64-sdl ]; then install -Dm755 nzportable64-sdl /app/share/nzportable/nzportable.bin; fi",
42+
"if [ -f nzportablearm64-sdl ]; then install -Dm755 nzportablearm64-sdl /app/share/nzportable/nzportable.bin; fi",
6143
"cp default.fmf /app/share/nzportable/",
62-
"# install game data",
63-
"mkdir -p /app/share/nzportable/nzp",
64-
"for f in *; do if [ \"$f\" != \"nzportablearm64-sdl\" ] && [ \"$f\" != \"default.fmf\" ]; then cp -r \"$f\" /app/share/nzportable/nzp/; fi; done",
65-
"echo \"nightly\" > /app/share/nzportable/nzp/version.txt",
66-
"printf '%s\\n' '#!/bin/bash' '' 'DATA_DIR=\"$HOME/.var/app/gay.nzp.nzportable/data\"' 'GAME_DIR=\"$DATA_DIR/nzportable\"' 'SOURCE_DIR=\"/app/share/nzportable\"' '' 'mkdir -p \"$DATA_DIR\"' '' 'if [ ! -d \"$GAME_DIR\" ] || [ ! -f \"$GAME_DIR/nzportable.bin\" ]; then' ' echo \"Setting up NZPortable data directory...\"' ' mkdir -p \"$GAME_DIR\"' ' cp -r \"$SOURCE_DIR\"/* \"$GAME_DIR/\"' ' chmod +x \"$GAME_DIR/nzportable.bin\"' ' echo \"Setup complete.\"' 'fi' '' 'if [ \"$SOURCE_DIR/nzp/version.txt\" -nt \"$GAME_DIR/nzp/version.txt\" ]; then' ' echo \"Updating game data...\"' ' # Preserve user settings' ' if [ -f \"$GAME_DIR/nzp/user_settings.cfg\" ]; then' ' cp \"$GAME_DIR/nzp/user_settings.cfg\" /tmp/nzp_user_settings_backup.cfg' ' fi' ' # Update game files' ' cp -r \"$SOURCE_DIR/nzp\"/* \"$GAME_DIR/nzp/\"' ' # Restore user settings' ' if [ -f \"/tmp/nzp_user_settings_backup.cfg\" ]; then' ' cp /tmp/nzp_user_settings_backup.cfg \"$GAME_DIR/nzp/user_settings.cfg\"' ' rm /tmp/nzp_user_settings_backup.cfg' ' fi' ' echo \"Update complete.\"' 'fi' '' 'cd \"$GAME_DIR\"' 'exec ./nzportable.bin \"$@\"' > nzportable-launcher",
67-
"",
68-
"install -Dm755 nzportable-launcher /app/bin/nzportable"
44+
"for f in *; do if [ \"$f\" != \"nzportable64-sdl\" ] && [ \"$f\" != \"nzportablearm64-sdl\" ] && [ \"$f\" != \"default.fmf\" ]; then cp -r \"$f\" /app/share/nzportable/nzp/; fi; done"
6945
],
7046
"sources": [
7147
{
7248
"type": "archive",
49+
"only-arches": [ "x86_64" ],
50+
"url": "https://github.com/nzp-team/nzportable/releases/download/nightly/nzportable-linux64.zip",
51+
"sha256": "ARCHIVE_SHA256_REPLACE"
52+
},
53+
{
54+
"type": "archive",
55+
"only-arches": [ "aarch64" ],
7356
"url": "https://github.com/nzp-team/nzportable/releases/download/nightly/nzportable-linuxarm64.zip",
7457
"sha256": "ARCHIVE_SHA256_REPLACE"
7558
}

0 commit comments

Comments
 (0)