Skip to content

Commit 162bdd0

Browse files
committed
feat: add Flatpak configuration
This uses https://github.com/TheAppgineer/flatpak-flutter to generate a Flatpak manifest (de.provokateurin.neon.yaml) that can build from source without network access. The input for that is the flatpak-flutter.yaml. When submitting the application to Flathub de.provokateurin.neon.yaml with the "generated" folder is what would be submitted to them. Signed-off-by: Bart Ribbers <bribbers@disroot.org>
1 parent 93f74b2 commit 162bdd0

6 files changed

Lines changed: 4373 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ packages/**/doc/api
1616
# **/pubspec_overrides.yaml
1717

1818
.fvm/
19+
20+
# Flatpak
21+
.flatpak-builder/
22+
repo

de.provokateurin.neon.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Generated by flatpak-flutter v0.12.0 from flatpak-flutter.yaml, do not edit
2+
# Visit the project at https://github.com/TheAppgineer/flatpak-flutter
3+
id: de.provokateurin.neon
4+
runtime: org.freedesktop.Platform
5+
runtime-version: '25.08'
6+
sdk: org.freedesktop.Sdk
7+
sdk-extensions:
8+
- org.freedesktop.Sdk.Extension.llvm20
9+
command: nextcloud-neon
10+
finish-args:
11+
- --share=ipc
12+
- --socket=fallback-x11
13+
- --socket=wayland
14+
- --device=dri
15+
modules:
16+
- name: neon
17+
buildsystem: simple
18+
build-options:
19+
arch:
20+
x86_64:
21+
env:
22+
BUNDLE_PATH: packages/neon_framework/example/build/linux/x64/release/bundle
23+
aarch64:
24+
env:
25+
BUNDLE_PATH: packages/neon_framework/example/build/linux/arm64/release/bundle
26+
append-path: /usr/lib/sdk/llvm20/bin:/var/lib/flutter/bin
27+
prepend-ld-library-path: /usr/lib/sdk/llvm20/lib
28+
env:
29+
PUB_CACHE: /run/build/neon/.pub-cache
30+
build-commands:
31+
- mkdir /app/lib/
32+
- if [ "$(arch)" == "x86_64" ]; then ln -sf /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
33+
/app/lib/libsqlite3.so; fi
34+
- if [ "$(arch)" == "aarch64" ]; then ln -sf /usr/lib/aarch64-linux-gnu/libsqlite3.so.0
35+
/app/lib/libsqlite3.so; fi
36+
- setup-flutter.sh
37+
- cd packages/neon_framework/example && flutter build linux --release --no-pub
38+
- install -D $BUNDLE_PATH/nextcloud-neon /app/bin/nextcloud-neon
39+
- cp -r $BUNDLE_PATH/lib /app/bin/lib
40+
- cp -r $BUNDLE_PATH/data /app/bin/data
41+
sources:
42+
- type: git
43+
url: https://github.com/nextcloud/neon.git
44+
branch: main
45+
commit: 93f74b2d818add82392d32495b1d2524dae80c01
46+
- generated/sources/pubspec.json
47+
modules:
48+
- generated/modules/flutter-sdk-3.38.9.json

flatpak-flutter.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
id: de.provokateurin.neon
2+
runtime: org.freedesktop.Platform
3+
runtime-version: '25.08'
4+
sdk: org.freedesktop.Sdk
5+
sdk-extensions:
6+
- org.freedesktop.Sdk.Extension.llvm20
7+
command: nextcloud-neon
8+
finish-args:
9+
- --share=ipc
10+
- --socket=fallback-x11
11+
- --socket=wayland
12+
- --device=dri
13+
modules:
14+
- name: neon
15+
buildsystem: simple
16+
build-options:
17+
arch:
18+
x86_64:
19+
env:
20+
BUNDLE_PATH: packages/neon_framework/example/build/linux/x64/release/bundle
21+
aarch64:
22+
env:
23+
BUNDLE_PATH: packages/neon_framework/example/build/linux/arm64/release/bundle
24+
append-path: /usr/lib/sdk/llvm20/bin:/run/build/neon/flutter/bin
25+
prepend-ld-library-path: /usr/lib/sdk/llvm20/lib
26+
env:
27+
PUB_CACHE: /run/build/neon/.pub-cache
28+
build-commands:
29+
- mkdir /app/lib/
30+
- if [ "$arch" == "x86_64" ]; then ln -sf /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /app/lib/libsqlite3.so; fi
31+
- if [ "$arch" == "aarch64" ]; then ln -sf /usr/lib/aarch64-linux-gnu/libsqlite3.so.0 /app/lib/libsqlite3.so; fi
32+
- cd packages/neon_framework/example && flutter build linux --release --no-pub
33+
- install -D $BUNDLE_PATH/nextcloud-neon /app/bin/nextcloud-neon
34+
- cp -r $BUNDLE_PATH/lib /app/bin/lib
35+
- cp -r $BUNDLE_PATH/data /app/bin/data
36+
sources:
37+
- type: git
38+
url: https://github.com/nextcloud/neon.git
39+
branch: main
40+
commit: 93f74b2d818add82392d32495b1d2524dae80c01
41+
- type: git
42+
url: https://github.com/flutter/flutter.git
43+
tag: 3.38.9
44+
dest: flutter
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
{
2+
"name": "flutter",
3+
"buildsystem": "simple",
4+
"build-commands": [
5+
"cp flutter/bin/internal/engine.version flutter/bin/cache/engine-dart-sdk.stamp",
6+
"cp flutter/bin/internal/material_fonts.version flutter/bin/cache/material_fonts.stamp",
7+
"cp flutter/bin/internal/gradle_wrapper.version flutter/bin/cache/gradle_wrapper.stamp",
8+
"cp flutter/bin/internal/engine.version flutter/bin/cache/engine_stamp.stamp",
9+
"cp flutter/bin/internal/engine.version flutter/bin/cache/flutter_sdk.stamp",
10+
"cp flutter/bin/internal/engine.version flutter/bin/cache/font-subset.stamp",
11+
"cp flutter/bin/internal/engine.version flutter/bin/cache/linux-sdk.stamp",
12+
"mkdir -p /var/lib && cp -r flutter /var/lib"
13+
],
14+
"sources": [
15+
{
16+
"type": "git",
17+
"url": "https://github.com/flutter/flutter.git",
18+
"tag": "3.38.9",
19+
"commit": "67323de285b00232883f53b84095eb72be97d35c",
20+
"dest": "flutter"
21+
},
22+
{
23+
"type": "archive",
24+
"only-arches": [
25+
"x86_64"
26+
],
27+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/dart-sdk-linux-x64.zip",
28+
"sha256": "ac5476d6b4b235375e3fdce83ff501e121629ab9053dd9a2a5019af1947af462",
29+
"strip-components": 0,
30+
"dest": "flutter/bin/cache"
31+
},
32+
{
33+
"type": "archive",
34+
"only-arches": [
35+
"aarch64"
36+
],
37+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/dart-sdk-linux-arm64.zip",
38+
"sha256": "9d0846bd206d440ddd4408e1dcfe3ccdd6e875dfb96ccaa82358f32172785647",
39+
"strip-components": 0,
40+
"dest": "flutter/bin/cache"
41+
},
42+
{
43+
"type": "archive",
44+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/fonts/3012db47f3130e62f7cc0beabff968a33cbec8d8/fonts.zip",
45+
"sha256": "e56fa8e9bb4589fde964be3de451f3e5b251e4a1eafb1dc98d94add034dd5a86",
46+
"dest": "flutter/bin/cache/artifacts/material_fonts"
47+
},
48+
{
49+
"type": "archive",
50+
"url": "https://storage.googleapis.com/flutter_infra_release/gradle-wrapper/fd5c1f2c013565a3bea56ada6df9d2b8e96d56aa/gradle-wrapper.tgz",
51+
"sha256": "31e9428baf1a2b2f485f1110c5899f852649b33d46a2e9b07f9d17752d50190a",
52+
"strip-components": 0,
53+
"dest": "flutter/bin/cache/artifacts/gradle_wrapper"
54+
},
55+
{
56+
"type": "archive",
57+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/sky_engine.zip",
58+
"sha256": "e0cee975a38bdaeaf46cc5347aceb9839b5ec928a4eb971e0742778f39fd4e97",
59+
"dest": "flutter/bin/cache/pkg/sky_engine"
60+
},
61+
{
62+
"type": "archive",
63+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/flutter_gpu.zip",
64+
"sha256": "becb5716b58b40d350a4e130d94be46706478248ec853b6691b963282f0284f4",
65+
"dest": "flutter/bin/cache/pkg/flutter_gpu"
66+
},
67+
{
68+
"type": "archive",
69+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/flutter_patched_sdk.zip",
70+
"sha256": "1c22a78c166941f2308dae6019050d3a70a000d3094ae4e7e70a6568c9c77d53",
71+
"dest": "flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk"
72+
},
73+
{
74+
"type": "archive",
75+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/flutter_patched_sdk_product.zip",
76+
"sha256": "263bf6901b0b5c78e916364046588458f22373ad2c986a9261631f8b33321969",
77+
"dest": "flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product"
78+
},
79+
{
80+
"type": "archive",
81+
"only-arches": [
82+
"x86_64"
83+
],
84+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-x64/artifacts.zip",
85+
"sha256": "fa37682eb238fa51e05b60a0aec3ad453a38695bc45439d9a4a389cf192a2341",
86+
"strip-components": 0,
87+
"dest": "flutter/bin/cache/artifacts/engine/linux-x64"
88+
},
89+
{
90+
"type": "archive",
91+
"only-arches": [
92+
"x86_64"
93+
],
94+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-x64/font-subset.zip",
95+
"sha256": "75f5fe94a3399c7ca2d54dcb1f8e8f5470fa336e1ed34418206a0d2158ffd953",
96+
"dest": "flutter/bin/cache/artifacts/engine/linux-x64"
97+
},
98+
{
99+
"type": "archive",
100+
"only-arches": [
101+
"x86_64"
102+
],
103+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-x64-profile/linux-x64-flutter-gtk.zip",
104+
"sha256": "0819a1f4a1ce6a3bb0471f3ff1f75082dfa797478a128a30e7de2ffbbb242453",
105+
"strip-components": 0,
106+
"dest": "flutter/bin/cache/artifacts/engine/linux-x64-profile"
107+
},
108+
{
109+
"type": "archive",
110+
"only-arches": [
111+
"x86_64"
112+
],
113+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-x64-release/linux-x64-flutter-gtk.zip",
114+
"sha256": "8dcfa58602a7f5156402e3f660b0e111458a15bf8c702926237dee66afd91100",
115+
"strip-components": 0,
116+
"dest": "flutter/bin/cache/artifacts/engine/linux-x64-release"
117+
},
118+
{
119+
"type": "archive",
120+
"only-arches": [
121+
"aarch64"
122+
],
123+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-arm64/artifacts.zip",
124+
"sha256": "7e77c678c10bc789145aa55ba21750641fe0c56a3d663b96f067056ba5aff72c",
125+
"strip-components": 0,
126+
"dest": "flutter/bin/cache/artifacts/engine/linux-arm64"
127+
},
128+
{
129+
"type": "archive",
130+
"only-arches": [
131+
"aarch64"
132+
],
133+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-arm64/font-subset.zip",
134+
"sha256": "dbcb7f504f8aa22a1b948ff3cff599c73ffd0904c5705c69a58bcc02e2bd699c",
135+
"dest": "flutter/bin/cache/artifacts/engine/linux-arm64"
136+
},
137+
{
138+
"type": "archive",
139+
"only-arches": [
140+
"aarch64"
141+
],
142+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-arm64-profile/linux-arm64-flutter-gtk.zip",
143+
"sha256": "994555e5f2f8360991e50240baf54efc88f1eed971296425b93a9f5e4aa96f06",
144+
"strip-components": 0,
145+
"dest": "flutter/bin/cache/artifacts/engine/linux-arm64-profile"
146+
},
147+
{
148+
"type": "archive",
149+
"only-arches": [
150+
"aarch64"
151+
],
152+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/linux-arm64-release/linux-arm64-flutter-gtk.zip",
153+
"sha256": "7cebab5b5418cf06af49e2b0ec29befd0b4ea247a057ca2cc21c3d8ea2201153",
154+
"strip-components": 0,
155+
"dest": "flutter/bin/cache/artifacts/engine/linux-arm64-release"
156+
},
157+
{
158+
"type": "patch",
159+
"path": "../patches/flutter/shared.sh.patch"
160+
},
161+
{
162+
"type": "script",
163+
"dest": "flutter/bin",
164+
"dest-filename": "setup-flutter.sh",
165+
"commands": [
166+
"flutter pub get --offline $@"
167+
]
168+
},
169+
{
170+
"type": "file",
171+
"url": "https://storage.googleapis.com/flutter_infra_release/flutter/587c18f873b8ab57330422bce09047420d9c7f42/engine_stamp.json",
172+
"sha256": "eb970e7ed0d5750ff452d845f4e415330aaa80e7247602bac4259563bd531ab6",
173+
"dest": "flutter/bin/cache"
174+
}
175+
]
176+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/flutter/bin/internal/shared.sh b/flutter/bin/internal/shared.sh
2+
index d78e0cd..b8eb978 100644
3+
--- a/flutter/bin/internal/shared.sh
4+
+++ b/flutter/bin/internal/shared.sh
5+
@@ -20,7 +20,7 @@ function pub_upgrade_with_retry {
6+
local total_tries="10"
7+
local remaining_tries=$((total_tries - 1))
8+
while [[ "$remaining_tries" -gt 0 ]]; do
9+
- (cd "$FLUTTER_TOOLS_DIR" && "$DART" pub upgrade --suppress-analytics >&2) && break
10+
+ (cd "$FLUTTER_TOOLS_DIR" && "$DART" pub upgrade --offline --suppress-analytics >&2) && break
11+
>&2 echo "Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... ($remaining_tries tries left)"
12+
remaining_tries=$((remaining_tries - 1))
13+
sleep 5

0 commit comments

Comments
 (0)