Skip to content

Commit 081b684

Browse files
tytan652RytoEX
authored andcommitted
build-aux: Replace Flatpak modules with pre-compiled dependencies
To reduce compile time and prepare for aarch64 support, dependencies compilation except CEF is moved to a BuildStream project junctionned with Freedesktop SDK. The BuildStream project is configured to build dependencies in a Flatpak-like environment.
1 parent 1290898 commit 081b684

37 files changed

+75
-933
lines changed

.github/workflows/build-project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ jobs:
312312
313313
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
314314
315-
cache_key='flatpak-builder-${{ hashFiles('build-aux/**/*.json') }}'
315+
cache_key='flatpak-builder-${{ hashFiles('build-aux/com.obsproject.Studio.json') }}'
316316
cache_ref='master'
317317
read -r id key size unit created accessed <<< \
318318
"$(gh cache list --ref "refs/heads/${cache_ref}" --key "${cache_key}-x86_64" | head -1)"

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
154154
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
155155
156-
cache_key='flatpak-builder-${{ hashFiles('build-aux/**/*.json') }}'
156+
cache_key='flatpak-builder-${{ hashFiles('build-aux/com.obsproject.Studio.json') }}'
157157
cache_ref='master'
158158
read -r id key size unit created accessed <<< \
159159
"$(gh cache list --ref "refs/heads/${cache_ref}" --key "${cache_key}-x86_64" | head -1)"

build-aux/README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,3 @@ Example of use:
4949
```sh
5050
python3 ./build-aux/format-manifest.py com.obsproject.Studio.json
5151
```
52-
53-
## OBS Studio Flatpak Manifest
54-
55-
The manifest is composed of multiple files:
56-
- The main manifest `com.obsproject.Studio.json`
57-
- The `modules` folder which contains OBS Studio dependencies modules
58-
59-
### Manifest modules
60-
61-
Modules are ordered/dispatched in numbered categories following a short list of rules:
62-
- A module must not depend on another module from the same category, so a module can only depend on modules from lower numbered categories.
63-
- A module without dependencies must be placed in the highest numbered category in use, excluding categories meant for specific types of dependency.
64-
65-
Actual categories:
66-
- `99-`: CEF
67-
- `90-`: Headers-only libraries that are dependencies of only OBS Studio
68-
- `50-`: Modules that are dependencies of only OBS Studio
69-
- `40-`: Modules that are dependencies of the `50-` category
70-
- `30-`: FFmpeg
71-
- `20-`: Modules that are dependencies of FFmpeg
72-
- `10-`: Modules that are dependencies of the `20-` category

build-aux/com.obsproject.Studio.json

Lines changed: 72 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,37 +37,79 @@
3737
"no-autodownload": true
3838
}
3939
},
40-
"cleanup": [
41-
"/share/man",
42-
"*.la"
43-
],
4440
"modules": [
45-
"modules/10-mbedtls.json",
46-
"modules/20-librist.json",
47-
"modules/20-nv-codec.json",
48-
"modules/20-srt.json",
49-
"modules/20-svt-av1.json",
50-
"modules/20-x264.json",
51-
"modules/30-ffmpeg.json",
52-
"modules/40-luajit.json",
53-
"modules/40-plog.json",
54-
"modules/40-usrsctp.json",
55-
"modules/50-intel-media-sdk.json",
56-
"modules/50-jansson.json",
57-
"modules/50-libdatachannel.json",
58-
"modules/50-libqrcodegencpp.json",
59-
"modules/50-libvpl.json",
60-
"modules/50-ntv2.json",
61-
"modules/50-rnnoise.json",
62-
"modules/50-swig.json",
63-
"modules/50-v4l-utils.json",
64-
"modules/50-vpl-gpu-rt.json",
65-
"modules/90-asio.json",
66-
"modules/90-nlohmann-json.json",
67-
"modules/90-simde.json",
68-
"modules/90-uthash.json",
69-
"modules/90-websocketpp.json",
70-
"modules/99-cef.json",
41+
{
42+
"name": "obs-deps-base",
43+
"buildsystem": "simple",
44+
"build-commands": [
45+
"tar -xvf base.tar.xz -C /"
46+
],
47+
"sources": [
48+
{
49+
"type": "file",
50+
"dest-filename": "base.tar.xz",
51+
"url": "https://github.com/obsproject/obs-deps-buildstream/releases/download/2025-10-03/flatpak-base-x86_64-2025-10-03.tar.xz",
52+
"sha256": "5bb40382cf587c0f20f6bead0f93f41ab0ea252a49f3d3ea73e8d554eb44ef6d"
53+
}
54+
]
55+
},
56+
{
57+
"name": "obs-deps-devel",
58+
"buildsystem": "simple",
59+
"build-commands": [
60+
"tar -xvf devel.tar.xz -C /"
61+
],
62+
"sources": [
63+
{
64+
"type": "file",
65+
"dest-filename": "devel.tar.xz",
66+
"url": "https://github.com/obsproject/obs-deps-buildstream/releases/download/2025-10-03/flatpak-devel-x86_64-2025-10-03.tar.xz",
67+
"sha256": "69dbbb2f0097503b5c4acd9ee5834f44fc6276e9d3b4ab70526f0ef0292a9797"
68+
}
69+
]
70+
},
71+
{
72+
"name": "obs-deps-devtools",
73+
"buildsystem": "simple",
74+
"build-commands": [
75+
"tar -xvf devtools.tar.xz -C /"
76+
],
77+
"cleanup": [
78+
"*"
79+
],
80+
"sources": [
81+
{
82+
"type": "file",
83+
"dest-filename": "devtools.tar.xz",
84+
"url": "https://github.com/obsproject/obs-deps-buildstream/releases/download/2025-10-03/flatpak-devtools-x86_64-2025-10-03.tar.xz",
85+
"sha256": "db1e9b7804c3f9f08b3a4321166abfb53462c9f6e6d6ca5a26eb36b8cfa23df3"
86+
}
87+
]
88+
},
89+
{
90+
"name": "cef",
91+
"build-options": {
92+
"no-debuginfo": true
93+
},
94+
"buildsystem": "simple",
95+
"build-commands": [
96+
"mkdir -p /app/cef/libcef_dll_wrapper",
97+
"cp -R ./include /app/cef",
98+
"cp -R ./Release /app/cef",
99+
"cp -R ./Resources /app/cef",
100+
"cp -R ./build/libcef_dll_wrapper/libcef_dll_wrapper.a /app/cef/libcef_dll_wrapper"
101+
],
102+
"cleanup": [
103+
"*"
104+
],
105+
"sources": [
106+
{
107+
"type": "archive",
108+
"url": "https://cdn-fastly.obsproject.com/downloads/cef_binary_6533_linux_x86_64_v6.tar.xz",
109+
"sha256": "7963335519a19ccdc5233f7334c5ab023026e2f3e9a0cc417007c09d86608146"
110+
}
111+
]
112+
},
71113
{
72114
"name": "obs",
73115
"buildsystem": "cmake-ninja",

build-aux/format-manifest.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,12 @@ def main() -> int:
3939
manifest_string = manifest.read()
4040
manifest_data = json.loads(manifest_string)
4141

42-
module_list = manifest_data.get("modules", [])
43-
44-
obs_object = module_list[-1]
45-
46-
if type(obs_object) != dict:
47-
logger.error(
48-
f"❌ Last element in modules list is not the obs-studio object"
49-
)
50-
return 2
51-
52-
new_module_list = []
53-
54-
for module in module_list:
55-
if type(module) == str:
56-
if not os.path.isfile(os.path.join(manifest_path, module)):
57-
logger.warning(
58-
f"⚠️ Specified module {os.path.basename(module)} not found."
59-
)
60-
continue
61-
62-
new_module_list.append(module)
63-
64-
new_module_list.sort()
65-
new_module_list.append(obs_object)
66-
manifest_data["modules"] = new_module_list
67-
6842
new_manifest_string = (
6943
f"{json.dumps(manifest_data, indent=4, ensure_ascii=False)}\n"
7044
)
7145

7246
if arguments.check:
73-
if new_module_list != module_list:
74-
logger.error(f"❌ Module list failed order validation")
75-
return 2
76-
elif new_manifest_string != manifest_string:
47+
if new_manifest_string != manifest_string:
7748
logger.error(f"❌ Manifest file is not correctly formatted")
7849
return 2
7950
else:

build-aux/modules/10-mbedtls.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

build-aux/modules/20-aom.json.disabled

Lines changed: 0 additions & 25 deletions
This file was deleted.

build-aux/modules/20-librist.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

build-aux/modules/20-nv-codec.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

build-aux/modules/20-srt.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)