Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-aux: Replace Flatpak modules with pre-compiled dependencies #10934

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions build-aux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,3 @@ Example of use:
```sh
python3 ./build-aux/format-manifest.py com.obsproject.Studio.json
```

## OBS Studio Flatpak Manifest

The manifest is composed of multiple files:
- The main manifest `com.obsproject.Studio.json`
- The `modules` folder which contains OBS Studio dependencies modules

### Manifest modules

Modules are ordered/dispatched in numbered categories following a short list of rules:
- A module must not depend on another module from the same category, so a module can only depend on modules from lower numbered categories.
- A module without dependencies must be placed in the highest numbered category in use, excluding categories meant for specific types of dependency.

Actual categories:
- `99-`: CEF
- `90-`: Headers-only libraries that are dependencies of only OBS Studio
- `50-`: Modules that are dependencies of only OBS Studio
- `40-`: Modules that are dependencies of the `50-` category
- `30-`: FFmpeg
- `20-`: Modules that are dependencies of FFmpeg
- `10-`: Modules that are dependencies of the `20-` category
89 changes: 64 additions & 25 deletions build-aux/com.obsproject.Studio.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,70 @@
"*.la"
],
"modules": [
"modules/10-mbedtls.json",
"modules/20-librist.json",
"modules/20-nv-codec.json",
"modules/20-srt.json",
"modules/20-svt-av1.json",
"modules/20-x264.json",
"modules/30-ffmpeg.json",
"modules/40-luajit.json",
"modules/40-plog.json",
"modules/40-usrsctp.json",
"modules/50-intel-media-sdk.json",
"modules/50-jansson.json",
"modules/50-libdatachannel.json",
"modules/50-libqrcodegencpp.json",
"modules/50-libvpl.json",
"modules/50-ntv2.json",
"modules/50-rnnoise.json",
"modules/50-swig.json",
"modules/50-v4l-utils.json",
"modules/50-vpl-gpu-rt.json",
"modules/90-asio.json",
"modules/90-nlohmann-json.json",
"modules/90-uthash.json",
"modules/90-websocketpp.json",
"modules/99-cef.json",
{
"name": "obs-deps-base",
"buildsystem": "simple",
"build-commands": [
"tar -xvf base.tar.xz -C /"
],
"sources": [
{
"type": "file",
"dest-filename": "base.tar.xz",
"url": "https://github.com/tytan652/obs-deps-bst/releases/download/2024-09-10/flatpak-base-x86_64-2024-09-10.tar.xz",
"sha256": "e9614394ca4aef4d5b7ebeabc6eec3f58d2a941cf56d3a6f0272af514d82dde9"
}
]
},
{
"name": "obs-deps-devels",
"buildsystem": "simple",
"build-commands": [
"tar -xvf devel.tar.xz -C /",
"tar -xvf devtools.tar.xz -C /"
],
"cleanup": [
"*"
],
"sources": [
{
"type": "file",
"dest-filename": "devel.tar.xz",
"url": "https://github.com/tytan652/obs-deps-bst/releases/download/2024-09-10/flatpak-devel-x86_64-2024-09-10.tar.xz",
"sha256": "e3215091794ebd167adf2d44631c889bb25803223d1b4bb49e318cf492e0cef8"
},
{
"type": "file",
"dest-filename": "devtools.tar.xz",
"url": "https://github.com/tytan652/obs-deps-bst/releases/download/2024-09-10/flatpak-devtools-x86_64-2024-09-10.tar.xz",
"sha256": "9e0939f060c8f0bfad99ee987470da469dc6dd7109debf81d5cb6c406e861541"
}
]
},
{
"name": "cef",
"build-options": {
"no-debuginfo": true
},
"buildsystem": "simple",
"build-commands": [
"mkdir -p /app/cef/libcef_dll_wrapper",
"cp -R ./include /app/cef",
"cp -R ./Release /app/cef",
"cp -R ./Resources /app/cef",
"cp -R ./build/libcef_dll_wrapper/libcef_dll_wrapper.a /app/cef/libcef_dll_wrapper"
],
"cleanup": [
"*"
],
"sources": [
{
"type": "archive",
"url": "https://cdn-fastly.obsproject.com/downloads/cef_binary_6533_linux_x86_64.tar.xz",
"sha256": "fab66dfc9cfd2e26fb87798f855aef30c2004edc8e19570d37af555644ae1655"
}
]
},
{
"name": "obs",
"buildsystem": "cmake-ninja",
Expand Down
31 changes: 1 addition & 30 deletions build-aux/format-manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,41 +39,12 @@ def main() -> int:
manifest_string = manifest.read()
manifest_data = json.loads(manifest_string)

module_list = manifest_data.get("modules", [])

obs_object = module_list[-1]

if type(obs_object) != dict:
logger.error(
f"❌ Last element in modules list is not the obs-studio object"
)
return 2

new_module_list = []

for module in module_list:
if type(module) == str:
if not os.path.isfile(os.path.join(manifest_path, module)):
logger.warning(
f"⚠️ Specified module {os.path.basename(module)} not found."
)
continue

new_module_list.append(module)

new_module_list.sort()
new_module_list.append(obs_object)
manifest_data["modules"] = new_module_list

new_manifest_string = (
f"{json.dumps(manifest_data, indent=4, ensure_ascii=False)}\n"
)

if arguments.check:
if new_module_list != module_list:
logger.error(f"❌ Module list failed order validation")
return 2
elif new_manifest_string != manifest_string:
if new_manifest_string != manifest_string:
logger.error(f"❌ Manifest file is not correctly formatted")
return 2
else:
Expand Down
24 changes: 0 additions & 24 deletions build-aux/modules/10-mbedtls.json

This file was deleted.

25 changes: 0 additions & 25 deletions build-aux/modules/20-aom.json.disabled

This file was deleted.

22 changes: 0 additions & 22 deletions build-aux/modules/20-librist.json

This file was deleted.

18 changes: 0 additions & 18 deletions build-aux/modules/20-nv-codec.json

This file was deleted.

23 changes: 0 additions & 23 deletions build-aux/modules/20-srt.json

This file was deleted.

25 changes: 0 additions & 25 deletions build-aux/modules/20-svt-av1.json

This file was deleted.

18 changes: 0 additions & 18 deletions build-aux/modules/20-x264.json

This file was deleted.

47 changes: 0 additions & 47 deletions build-aux/modules/30-ffmpeg.json

This file was deleted.

24 changes: 0 additions & 24 deletions build-aux/modules/40-luajit.json

This file was deleted.

Loading
Loading