Skip to content

Commit f8e7c35

Browse files
feat(schema): add Flatpak Builder manifest JSON schema (SchemaStore#5394)
* feat(schema): add Flatpak Builder manifest JSON schema * feat(catalog): register Flatpak manifest schema with file match patterns * test(flatpak-manifest): add positive and negative validation cases * chore(validation): update schema validation configuration for Flatpak manifest * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(flatpak-manifest): remove x-deprecated keyword, not valid in draft-07 Signed-off-by: Vaibhav mittal <vaibhavmittal929@gmail.com> * fix(flatpak-manifest): fix typo transfered -> transferred Signed-off-by: Vaibhav mittal <vaibhavmittal929@gmail.com> --------- Signed-off-by: Vaibhav mittal <vaibhavmittal929@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 130e05f commit f8e7c35

8 files changed

Lines changed: 1866 additions & 0 deletions

File tree

src/api/json/catalog.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,6 +2736,16 @@
27362736
],
27372737
"url": "https://gitlab.cern.ch/steam/fiqus/-/raw/master/docs/schema.json"
27382738
},
2739+
{
2740+
"name": "Flatpak Builder Manifest",
2741+
"description": "flatpak-builder manifest files",
2742+
"fileMatch": [
2743+
"**/*.flatpak.json",
2744+
"**/*.flatpak.yaml",
2745+
"**/*.flatpak.yml"
2746+
],
2747+
"url": "https://www.schemastore.org/flatpak-manifest.json"
2748+
},
27392749
{
27402750
"name": "FlexGet Config",
27412751
"description": "FlexGet config file",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"command": "myapp",
3+
"id": "org.example.MissingRuntime",
4+
"modules": [
5+
{
6+
"build-commands": ["echo done"],
7+
"buildsystem": "simple",
8+
"name": "myapp",
9+
"sources": []
10+
}
11+
],
12+
"sdk": "org.freedesktop.Sdk"
13+
}

src/schema-validation.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"expo-50.0.0.json",
8585
"feed-1.json",
8686
"feed.json",
87+
"flatpak-manifest.json",
8788
"foundryvtt-module-manifest.json",
8889
"foundryvtt-system-manifest.json",
8990
"foundryvtt-world-manifest.json",

src/schemas/json/flatpak-manifest.json

Lines changed: 1587 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"build-options": {
3+
"cflags": "-O2 -g",
4+
"cxxflags": "-O2 -g",
5+
"env": {
6+
"V": "1"
7+
}
8+
},
9+
"cleanup": ["/include", "/lib/pkgconfig", "*.la"],
10+
"command": "myapp",
11+
"finish-args": [
12+
"--share=ipc",
13+
"--socket=fallback-x11",
14+
"--socket=wayland",
15+
"--device=dri"
16+
],
17+
"id": "org.example.MyApp",
18+
"modules": [
19+
{
20+
"buildsystem": "meson",
21+
"config-opts": ["--buildtype=release"],
22+
"name": "myapp",
23+
"sources": [
24+
{
25+
"sha256": "abc123def456abc123def456abc123def456abc123def456abc123def456ab12",
26+
"type": "archive",
27+
"url": "https://example.com/myapp-1.0.0.tar.xz"
28+
}
29+
]
30+
},
31+
{
32+
"builddir": true,
33+
"buildsystem": "cmake-ninja",
34+
"cleanup": ["/share/doc"],
35+
"config-opts": ["-DCMAKE_BUILD_TYPE=Release"],
36+
"name": "libfoo",
37+
"sources": [
38+
{
39+
"commit": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
40+
"tag": "v1.2.3",
41+
"type": "git",
42+
"url": "https://github.com/example/libfoo.git"
43+
}
44+
]
45+
},
46+
{
47+
"buildsystem": "autotools",
48+
"name": "libbar",
49+
"sources": [
50+
{
51+
"sha256": "cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafeba01",
52+
"type": "archive",
53+
"url": "https://example.com/libbar-2.0.tar.gz"
54+
},
55+
{
56+
"path": "libbar-fix.patch",
57+
"type": "patch"
58+
}
59+
]
60+
},
61+
"extra-module.json"
62+
],
63+
"runtime": "org.freedesktop.Platform",
64+
"runtime-version": "23.08",
65+
"sdk": "org.freedesktop.Sdk"
66+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"add-build-extensions": {
3+
"org.freedesktop.Sdk.Extension.toolchain": {
4+
"directory": "lib/sdk/toolchain",
5+
"remove-after-build": true,
6+
"version": "23.08"
7+
}
8+
},
9+
"add-extensions": {
10+
"com.example.ProprietaryApp.Plugin": {
11+
"autodelete": true,
12+
"directory": "lib/plugin",
13+
"no-autodownload": true,
14+
"subdirectories": true
15+
}
16+
},
17+
"command": "proprietary-app",
18+
"finish-args": [
19+
"--share=ipc",
20+
"--socket=x11",
21+
"--device=dri",
22+
"--share=network"
23+
],
24+
"id": "com.example.ProprietaryApp",
25+
"modules": [
26+
{
27+
"build-commands": [
28+
"install -Dm755 proprietary-app /app/bin/proprietary-app"
29+
],
30+
"buildsystem": "simple",
31+
"name": "proprietary-app",
32+
"sources": [
33+
{
34+
"filename": "proprietary-app.tar.gz",
35+
"installed-size": 52428800,
36+
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
37+
"size": 10485760,
38+
"type": "extra-data",
39+
"url": "https://example.com/download/proprietary-app-1.0.tar.gz"
40+
}
41+
]
42+
},
43+
{
44+
"build-commands": ["install -Dm755 helper.sh /app/bin/helper"],
45+
"buildsystem": "simple",
46+
"name": "helper-script",
47+
"sources": [
48+
{
49+
"contents": "#!/bin/sh\nexec proprietary-app \"$@\"\n",
50+
"dest-filename": "helper.sh",
51+
"type": "inline"
52+
}
53+
]
54+
},
55+
{
56+
"build-commands": [],
57+
"buildsystem": "simple",
58+
"name": "apply-patches",
59+
"sources": [
60+
{
61+
"commands": ["sed -i 's/old/new/g' config.h", "chmod +x configure"],
62+
"type": "shell"
63+
}
64+
]
65+
}
66+
],
67+
"runtime": "org.freedesktop.Platform",
68+
"runtime-version": "23.08",
69+
"sdk": "org.freedesktop.Sdk"
70+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"app-id": "org.example.LegacyApp",
3+
"cleanup": ["/include", "/lib/pkgconfig", "/share/man", "*.la", "*.a"],
4+
"cleanup-commands": ["ldconfig"],
5+
"command": "legacy-app",
6+
"copy-icon": true,
7+
"desktop-file-name-prefix": "(Nightly) ",
8+
"finish-args": [
9+
"--share=network",
10+
"--share=ipc",
11+
"--socket=x11",
12+
"--filesystem=home"
13+
],
14+
"modules": [
15+
{
16+
"build-commands": [
17+
"install -Dm755 legacy-app.sh /app/bin/legacy-app",
18+
"install -Dm644 legacy-app.desktop /app/share/applications/legacy-app.desktop"
19+
],
20+
"buildsystem": "simple",
21+
"name": "legacy-app",
22+
"sources": [
23+
{
24+
"commands": ["#!/bin/bash", "exec /app/lib/legacy-app/run.sh \"$@\""],
25+
"dest-filename": "legacy-app.sh",
26+
"type": "script"
27+
},
28+
{
29+
"path": "legacy-app.desktop",
30+
"type": "file"
31+
},
32+
{
33+
"path": ".",
34+
"type": "dir"
35+
}
36+
]
37+
}
38+
],
39+
"rename-appdata-file": "legacy-app.appdata.xml",
40+
"rename-desktop-file": "legacy-app.desktop",
41+
"rename-icon": "legacy-app",
42+
"runtime": "org.gnome.Platform",
43+
"runtime-version": "45",
44+
"sdk": "org.gnome.Sdk",
45+
"separate-locales": false
46+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"branch": "23.08",
3+
"build-options": {
4+
"arch": {
5+
"aarch64": {
6+
"cflags": "-O2 -march=armv8-a",
7+
"cxxflags": "-O2 -march=armv8-a"
8+
},
9+
"x86_64": {
10+
"cflags": "-O2 -march=x86-64",
11+
"cxxflags": "-O2 -march=x86-64"
12+
}
13+
},
14+
"cflags": "-O2",
15+
"cxxflags": "-O2"
16+
},
17+
"build-runtime": true,
18+
"cleanup-platform": ["/share/man", "/share/doc"],
19+
"cleanup-platform-commands": ["ldconfig"],
20+
"id": "org.example.Sdk",
21+
"id-platform": "org.example.Platform",
22+
"inherit-extensions": [
23+
"org.freedesktop.Platform.GL",
24+
"org.freedesktop.Platform.Timezones",
25+
"org.freedesktop.Platform.GStreamer"
26+
],
27+
"metadata-platform": "metadata.platform",
28+
"modules": [
29+
{
30+
"buildsystem": "autotools",
31+
"modules": [
32+
{
33+
"buildsystem": "meson",
34+
"name": "sub-dependency",
35+
"skip-arches": ["i386"],
36+
"sources": [
37+
{
38+
"branch": "main",
39+
"type": "git",
40+
"url": "https://gitlab.example.com/sub-dep.git"
41+
}
42+
]
43+
}
44+
],
45+
"name": "base-tools",
46+
"only-arches": ["x86_64", "aarch64"],
47+
"sources": [
48+
{
49+
"sha256": "aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899",
50+
"type": "archive",
51+
"url": "https://example.com/base-tools-1.0.tar.xz"
52+
}
53+
]
54+
},
55+
{
56+
"buildsystem": "autotools",
57+
"name": "legacy-vcs-lib",
58+
"sources": [
59+
{
60+
"type": "svn",
61+
"url": "svn://svn.example.com/repos/legacy-lib/trunk"
62+
}
63+
]
64+
}
65+
],
66+
"platform-extensions": ["org.example.Platform.Locale"],
67+
"prepare-platform-commands": ["rm -rf /usr/share/doc"],
68+
"runtime": "org.freedesktop.Platform",
69+
"runtime-version": "23.08",
70+
"sdk": "org.freedesktop.Sdk",
71+
"sdk-extensions": ["org.freedesktop.Sdk.Extension.rust-stable"],
72+
"writable-sdk": true
73+
}

0 commit comments

Comments
 (0)