Skip to content
10 changes: 10 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2736,6 +2736,16 @@
],
"url": "https://gitlab.cern.ch/steam/fiqus/-/raw/master/docs/schema.json"
},
{
"name": "Flatpak Builder Manifest",
"description": "flatpak-builder manifest files",
"fileMatch": [
"**/*.flatpak.json",
"**/*.flatpak.yaml",
"**/*.flatpak.yml"
],
"url": "https://www.schemastore.org/flatpak-manifest.json"
},
{
"name": "FlexGet Config",
"description": "FlexGet config file",
Expand Down
13 changes: 13 additions & 0 deletions src/negative_test/flatpak-manifest/missing-runtime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"command": "myapp",
"id": "org.example.MissingRuntime",
"modules": [
{
"build-commands": ["echo done"],
"buildsystem": "simple",
"name": "myapp",
"sources": []
}
],
"sdk": "org.freedesktop.Sdk"
}
1 change: 1 addition & 0 deletions src/schema-validation.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"expo-50.0.0.json",
"feed-1.json",
"feed.json",
"flatpak-manifest.json",
"foundryvtt-module-manifest.json",
"foundryvtt-system-manifest.json",
"foundryvtt-world-manifest.json",
Expand Down
1,587 changes: 1,587 additions & 0 deletions src/schemas/json/flatpak-manifest.json

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions src/test/flatpak-manifest/com.example.MyApp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"build-options": {
"cflags": "-O2 -g",
"cxxflags": "-O2 -g",
"env": {
"V": "1"
}
},
"cleanup": ["/include", "/lib/pkgconfig", "*.la"],
"command": "myapp",
"finish-args": [
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--device=dri"
],
"id": "org.example.MyApp",
"modules": [
{
"buildsystem": "meson",
"config-opts": ["--buildtype=release"],
"name": "myapp",
"sources": [
{
"sha256": "abc123def456abc123def456abc123def456abc123def456abc123def456ab12",
"type": "archive",
"url": "https://example.com/myapp-1.0.0.tar.xz"
}
]
},
{
"builddir": true,
"buildsystem": "cmake-ninja",
"cleanup": ["/share/doc"],
"config-opts": ["-DCMAKE_BUILD_TYPE=Release"],
"name": "libfoo",
"sources": [
{
"commit": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
"tag": "v1.2.3",
"type": "git",
"url": "https://github.com/example/libfoo.git"
}
]
},
{
"buildsystem": "autotools",
"name": "libbar",
"sources": [
{
"sha256": "cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafeba01",
"type": "archive",
"url": "https://example.com/libbar-2.0.tar.gz"
},
{
"path": "libbar-fix.patch",
"type": "patch"
}
]
},
"extra-module.json"
],
"runtime": "org.freedesktop.Platform",
"runtime-version": "23.08",
"sdk": "org.freedesktop.Sdk"
}
70 changes: 70 additions & 0 deletions src/test/flatpak-manifest/com.example.ProprietaryApp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"add-build-extensions": {
"org.freedesktop.Sdk.Extension.toolchain": {
"directory": "lib/sdk/toolchain",
"remove-after-build": true,
"version": "23.08"
}
},
"add-extensions": {
"com.example.ProprietaryApp.Plugin": {
"autodelete": true,
"directory": "lib/plugin",
"no-autodownload": true,
"subdirectories": true
}
},
"command": "proprietary-app",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--device=dri",
"--share=network"
],
"id": "com.example.ProprietaryApp",
"modules": [
{
"build-commands": [
"install -Dm755 proprietary-app /app/bin/proprietary-app"
],
"buildsystem": "simple",
"name": "proprietary-app",
"sources": [
{
"filename": "proprietary-app.tar.gz",
"installed-size": 52428800,
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"size": 10485760,
"type": "extra-data",
"url": "https://example.com/download/proprietary-app-1.0.tar.gz"
}
]
},
{
"build-commands": ["install -Dm755 helper.sh /app/bin/helper"],
"buildsystem": "simple",
"name": "helper-script",
"sources": [
{
"contents": "#!/bin/sh\nexec proprietary-app \"$@\"\n",
"dest-filename": "helper.sh",
"type": "inline"
}
]
},
{
"build-commands": [],
"buildsystem": "simple",
"name": "apply-patches",
"sources": [
{
"commands": ["sed -i 's/old/new/g' config.h", "chmod +x configure"],
"type": "shell"
}
]
}
],
"runtime": "org.freedesktop.Platform",
"runtime-version": "23.08",
"sdk": "org.freedesktop.Sdk"
}
46 changes: 46 additions & 0 deletions src/test/flatpak-manifest/org.example.LegacyApp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"app-id": "org.example.LegacyApp",
"cleanup": ["/include", "/lib/pkgconfig", "/share/man", "*.la", "*.a"],
"cleanup-commands": ["ldconfig"],
"command": "legacy-app",
"copy-icon": true,
"desktop-file-name-prefix": "(Nightly) ",
"finish-args": [
"--share=network",
"--share=ipc",
"--socket=x11",
"--filesystem=home"
],
"modules": [
{
"build-commands": [
"install -Dm755 legacy-app.sh /app/bin/legacy-app",
"install -Dm644 legacy-app.desktop /app/share/applications/legacy-app.desktop"
],
"buildsystem": "simple",
"name": "legacy-app",
"sources": [
{
"commands": ["#!/bin/bash", "exec /app/lib/legacy-app/run.sh \"$@\""],
"dest-filename": "legacy-app.sh",
"type": "script"
},
{
"path": "legacy-app.desktop",
"type": "file"
},
{
"path": ".",
"type": "dir"
}
]
}
],
"rename-appdata-file": "legacy-app.appdata.xml",
"rename-desktop-file": "legacy-app.desktop",
"rename-icon": "legacy-app",
"runtime": "org.gnome.Platform",
"runtime-version": "45",
"sdk": "org.gnome.Sdk",
"separate-locales": false
}
73 changes: 73 additions & 0 deletions src/test/flatpak-manifest/org.example.Sdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"branch": "23.08",
"build-options": {
"arch": {
"aarch64": {
"cflags": "-O2 -march=armv8-a",
"cxxflags": "-O2 -march=armv8-a"
},
"x86_64": {
"cflags": "-O2 -march=x86-64",
"cxxflags": "-O2 -march=x86-64"
}
},
"cflags": "-O2",
"cxxflags": "-O2"
},
"build-runtime": true,
"cleanup-platform": ["/share/man", "/share/doc"],
"cleanup-platform-commands": ["ldconfig"],
"id": "org.example.Sdk",
"id-platform": "org.example.Platform",
"inherit-extensions": [
"org.freedesktop.Platform.GL",
"org.freedesktop.Platform.Timezones",
"org.freedesktop.Platform.GStreamer"
],
"metadata-platform": "metadata.platform",
"modules": [
{
"buildsystem": "autotools",
"modules": [
{
"buildsystem": "meson",
"name": "sub-dependency",
"skip-arches": ["i386"],
"sources": [
{
"branch": "main",
"type": "git",
"url": "https://gitlab.example.com/sub-dep.git"
}
]
}
],
"name": "base-tools",
"only-arches": ["x86_64", "aarch64"],
"sources": [
{
"sha256": "aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899",
"type": "archive",
"url": "https://example.com/base-tools-1.0.tar.xz"
}
]
},
{
"buildsystem": "autotools",
"name": "legacy-vcs-lib",
"sources": [
{
"type": "svn",
"url": "svn://svn.example.com/repos/legacy-lib/trunk"
}
]
}
],
"platform-extensions": ["org.example.Platform.Locale"],
"prepare-platform-commands": ["rm -rf /usr/share/doc"],
"runtime": "org.freedesktop.Platform",
"runtime-version": "23.08",
"sdk": "org.freedesktop.Sdk",
"sdk-extensions": ["org.freedesktop.Sdk.Extension.rust-stable"],
"writable-sdk": true
}