├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── com.blackmagic.Resolve.yaml ├── com.blackmagic.ResolveStudio.yaml ├── logo.png ├── python ├── build_metainfo.py ├── main.py ├── resolve_download.py └── version.py ├── requirements.txt ├── run_complete_installation.sh └── shell ├── resolve.sh ├── setup_directories.sh └── setup_resolve.sh /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | flatpak: 9 | name: "Flatpak CI" 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | file: [Resolve, ResolveStudio] 14 | container: 15 | image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08 16 | options: --privileged 17 | steps: 18 | - uses: actions/checkout@v3 19 | with: 20 | submodules: recursive 21 | 22 | - uses: flatpak/flatpak-github-actions/flatpak-builder@v6.1 23 | with: 24 | bundle: com.blackmagic.${{ matrix.file }} 25 | manifest-path: com.blackmagic.${{ matrix.file }}.yaml 26 | cache-key: flatpak-builder-${{ matrix.file }}-${{ github.sha }} 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build-dir 2 | .idea 3 | venv 4 | repo 5 | .flatpak-builder -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "shared-modules"] 2 | path = shared-modules 3 | url = https://github.com/flathub/shared-modules.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Pob (the Builder) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | resolve-flatpak 4 | =============== 5 | 6 | This repo allows you to package DaVinci Resolve as a Flatpak for use on Linux Flatpak 7 | based systems, especially e.g. Fedora Silverblue where there aren't easier installation 8 | options. 9 | 10 | It's still a work-in-progress; but "works-for-me[tm]" right now. 11 | 12 | Usage 13 | ----- 14 | 15 | 1. If you have appimagelauncherd (the AppImage Launcher daemon) installed and enabled, you NEED to temporarely disable it (either through systemctl or through the AppImage Launcher GUI) as it conflicts with flatpak-builder during the .run file repackaging process. 16 | 17 | 2. Clone this repo with: `git clone https://github.com/pobthebuilder/resolve-flatpak.git --recursive` 18 | By default, com.blackmagic.Resolve.yaml is configured to package the latest version of Resolve (18.5 Beta 3 at the time of writing). 19 | 20 | 3. Build your package, and export to a distributable single file installer: 21 | 22 | #### Free 23 | ``` 24 | flatpak-builder --install-deps-from=flathub --force-clean --repo=.repo .build-dir com.blackmagic.Resolve.yaml 25 | ``` 26 | 27 | To simply install the built version: 28 | ``` 29 | flatpak --user remote-add --no-gpg-verify resolve-repo .repo 30 | flatpak --user install resolve-repo com.blackmagic.Resolve 31 | ``` 32 | 33 | To build a redistruble single file package: 34 | ``` 35 | flatpak build-bundle .repo resolve.flatpak com.blackmagic.Resolve --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo 36 | ``` 37 | 38 | #### Studio 39 | ``` 40 | flatpak-builder --install-deps-from=flathub --force-clean --repo=.repo .build-dir com.blackmagic.ResolveStudio.yaml 41 | ``` 42 | 43 | To simply install the built version: 44 | ``` 45 | flatpak --user remote-add --no-gpg-verify resolve-repo .repo 46 | flatpak --user install resolve-repo com.blackmagic.ResolveStudio 47 | ``` 48 | 49 | To build a redistruble single file package: 50 | ``` 51 | flatpak build-bundle .repo resolve.flatpak com.blackmagic.ResolveStudio --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo 52 | ``` 53 | 54 | 4. Enjoy. 55 | 56 | ## Finding explicit Download IDs (for download_resolve.sh) 57 | #### Studio: 58 | 59 | ``` 60 | curl -o- https://www.blackmagicdesign.com/api/support/nz/downloads.json | 61 | jq -r '.downloads[] 62 | | select(.urls["Linux"] != null) 63 | | select(.urls["Linux"][0]["product"] == "davinci-resolve-studio") 64 | | [.urls["Linux"][0].downloadTitle, .urls["Linux"][0].downloadId] 65 | | @tsv' 66 | ``` 67 | 68 | #### Free: 69 | 70 | ``` 71 | curl -o- https://www.blackmagicdesign.com/api/support/nz/downloads.json | 72 | jq -r '.downloads[] 73 | | select(.urls["Linux"] != null) 74 | | select(.urls["Linux"][0]["product"] == "davinci-resolve") 75 | | [.urls["Linux"][0].downloadTitle, .urls["Linux"][0].downloadId] 76 | | @tsv' 77 | ``` 78 | 79 | ## Licensing 80 | The icon in logo.png is licensed under the Creative [Commons Attribution-Share Alike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/deed.en) and fetched from [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:DaVinci_Resolve_Studio.png). It was only cropped afterwards. 81 | 82 | ## Related 83 | 84 | - [Flathub forum : DaVinci Resolve Feature Requests](https://discourse.flathub.org/t/davinci-resolve-flatpak-request/842) 85 | - [blackmagicdesign forum : DaVinci Resolve Flatpak request](https://forum.blackmagicdesign.com/viewtopic.php?f=33&t=186259) 86 | -------------------------------------------------------------------------------- /com.blackmagic.Resolve.yaml: -------------------------------------------------------------------------------- 1 | #### 2 | # Flatpak Configuration for building DaVinci Resolve 3 | # 4 | #### 5 | app-id: com.blackmagic.Resolve 6 | runtime: org.freedesktop.Platform 7 | runtime-version: &runtime-version '23.08' 8 | sdk: org.freedesktop.Sdk 9 | finish-args: 10 | - --share=ipc 11 | - --share=network 12 | - --socket=pulseaudio 13 | - --socket=x11 14 | - --socket=wayland 15 | - --device=dri 16 | - --filesystem=xdg-documents 17 | - --filesystem=xdg-cache 18 | - --filesystem=xdg-data 19 | - --filesystem=xdg-videos 20 | - --filesystem=~/.local/share/DaVinciResolve 21 | - --filesystem=~/Desktop 22 | - --env=LD_PRELOAD=/lib/x86_64-linux-gnu/libglib-2.0.so.0 /lib/x86_64-linux-gnu/libgio-2.0.so.0 /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 /lib/x86_64-linux-gnu/libgobject-2.0.so.0 23 | 24 | command: /app/bin/resolve.sh 25 | modules: 26 | - shared-modules/glu/glu-9.json 27 | #Ship libcrypt.so.1 with flatpak as not provided by runtime or by Blackmagic. See https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1708 28 | - name: libxcrypt 29 | buildsystem: autotools 30 | config-opts: ["--enable-obsolete-api=glibc"] 31 | sources: 32 | - type: git 33 | url: https://github.com/besser82/libxcrypt.git 34 | tag: v4.4.36 35 | - name: onetbb 36 | disabled: true 37 | buildsystem: cmake-ninja 38 | config-opts: 39 | - -Wno-dev 40 | - -DTBB_TEST=OFF 41 | sources: 42 | - type: git 43 | url: https://github.com/oneapi-src/oneTBB 44 | tag: v2021.11.0 45 | # #Build libcxx and ship as a library with Resolve as BM is outdated and segfaults on some setups. Disabled by default. 46 | # - name: libcxx 47 | # disabled: true 48 | # buildsystem: cmake-ninja 49 | # builddir: true 50 | # subdir: runtimes 51 | # config-opts: 52 | # - -DCMAKE_BUILD_TYPE=Release 53 | # - -DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi 54 | # - -DLLVM_TARGETS_TO_BUILD=X86 55 | # - -Wno-dev 56 | # sources: 57 | # - type: git 58 | # url: https://github.com/llvm/llvm-project.git 59 | # tag: llvmorg-17.0.6 60 | - name: resolve 61 | buildsystem: simple 62 | build-options: 63 | build-args: 64 | - --share=network 65 | build-commands: 66 | - install -Dm644 logo.png /app/share/icons/hicolor/scalable/apps/com.blackmagic.Resolve.png 67 | - | 68 | ./run_complete_installation.sh 69 | sources: 70 | - type: file 71 | path: python/build_metainfo.py 72 | - type: file 73 | path: python/main.py 74 | - type: file 75 | path: python/resolve_download.py 76 | - type: file 77 | path: python/version.py 78 | - type: file 79 | path: shell/setup_resolve.sh 80 | - type: file 81 | path: shell/setup_directories.sh 82 | - type: file 83 | path: shell/resolve.sh 84 | - type: file 85 | path: run_complete_installation.sh 86 | - type: file 87 | path: requirements.txt 88 | - type: file 89 | path: logo.png 90 | -------------------------------------------------------------------------------- /com.blackmagic.ResolveStudio.yaml: -------------------------------------------------------------------------------- 1 | #### 2 | # Flatpak Configuration for building DaVinci Resolve 3 | # 4 | #### 5 | app-id: com.blackmagic.ResolveStudio 6 | runtime: org.freedesktop.Platform 7 | runtime-version: &runtime-version '23.08' 8 | sdk: org.freedesktop.Sdk 9 | finish-args: 10 | - --share=ipc 11 | - --share=network 12 | - --socket=pulseaudio 13 | - --socket=x11 14 | - --socket=wayland 15 | - --device=dri 16 | - --filesystem=xdg-documents 17 | - --filesystem=xdg-cache 18 | - --filesystem=xdg-data 19 | - --filesystem=xdg-videos 20 | - --filesystem=~/.local/share/DaVinciResolve 21 | - --filesystem=~/Desktop 22 | # https://www.reddit.com/r/Fedora/comments/12z32r1/davinci_resolve_libpango_undefined_symbol_g/ 23 | # - --env=LD_PRELOAD=/lib/x86_64-linux-gnu/libglib-2.0.so.0 /lib/x86_64-linux-gnu/libgio-2.0.so.0 /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 /lib/x86_64-linux-gnu/libgobject-2.0.so.0 24 | 25 | command: /app/bin/resolve.sh 26 | modules: 27 | - shared-modules/glu/glu-9.json 28 | # libcrypt.so.1 no longer provided by the runtime. 29 | # See https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1708 30 | - name: libxcrypt 31 | buildsystem: autotools 32 | config-opts: ["--enable-obsolete-api=glibc"] 33 | sources: 34 | - type: git 35 | url: https://github.com/besser82/libxcrypt.git 36 | tag: v4.4.36 37 | - name: onetbb 38 | disabled: true 39 | buildsystem: cmake-ninja 40 | config-opts: 41 | - -Wno-dev 42 | - -DTBB_TEST=OFF 43 | sources: 44 | - type: git 45 | url: https://github.com/oneapi-src/oneTBB 46 | tag: v2021.11.0 47 | #Build libcxx and ship as a library with Resolve as BM is outdated and segfaults on some setups. Disabled by default. 48 | # - name: libcxx 49 | # disabled: true 50 | # buildsystem: cmake-ninja 51 | # builddir: true 52 | # subdir: runtimes 53 | # config-opts: 54 | # - -DCMAKE_BUILD_TYPE=Release 55 | # - -DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi 56 | # - -DLLVM_TARGETS_TO_BUILD=X86 57 | # - -Wno-dev 58 | # sources: 59 | # - type: git 60 | # url: https://github.com/llvm/llvm-project.git 61 | # tag: llvmorg-17.0.6 62 | - name: resolve 63 | buildsystem: simple 64 | build-options: 65 | build-args: 66 | - --share=network 67 | build-commands: 68 | - install -Dm644 logo.png /app/share/icons/hicolor/scalable/apps/com.blackmagic.ResolveStudio.png 69 | - | 70 | ./run_complete_installation.sh --studio 71 | sources: 72 | - type: file 73 | path: python/build_metainfo.py 74 | - type: file 75 | path: python/main.py 76 | - type: file 77 | path: python/resolve_download.py 78 | - type: file 79 | path: python/version.py 80 | - type: file 81 | path: shell/setup_resolve.sh 82 | - type: file 83 | path: shell/setup_directories.sh 84 | - type: file 85 | path: shell/resolve.sh 86 | - type: file 87 | path: run_complete_installation.sh 88 | - type: file 89 | path: requirements.txt 90 | - type: file 91 | path: logo.png 92 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pobthebuilder/resolve-flatpak/4a5c52b399abfd81ad7ff786e47870fb7938145c/logo.png -------------------------------------------------------------------------------- /python/build_metainfo.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import json 3 | import re 4 | 5 | import requests 6 | 7 | from resolve_download import Version 8 | 9 | 10 | def build_metainfo(app_id: str, app_description: str, app_tag: str): 11 | response = requests.get('https://www.blackmagicdesign.com/api/support/en/downloads.json') 12 | 13 | parsed_response = json.loads(response.content) 14 | 15 | latest_description = "" 16 | 17 | releases = "" 18 | for idx, download in enumerate(parsed_response["downloads"]): 19 | if "Linux" not in download["urls"] or download["urls"]["Linux"][0]["product"] != app_tag: 20 | continue 21 | 22 | linux = download["urls"]["Linux"][0] 23 | description = download["desc"] 24 | beta = re.compile(r'.*Beta (\d+)').match(linux["downloadTitle"]) 25 | version = Version( 26 | major=linux["major"], 27 | minor=linux["minor"], 28 | patch=linux["releaseNum"], 29 | build=linux["releaseId"], 30 | beta=-1 if beta is None or beta.group(1) == "" else beta.group(1) 31 | ) 32 | date = datetime.datetime.strptime(download["date"], '%d %b %Y').strftime("%Y-%m-%d") 33 | 34 | if idx == 0 or latest_description == "": 35 | latest_description = description 36 | 37 | release = """ 38 | 39 | """ + description + """ 40 | 41 | """ 42 | 43 | releases += release 44 | 45 | template = """ 46 | 47 | """ + app_id + """ 48 | FSFAP 49 | LicenseRef-proprietary 50 | """ + app_description + """ 51 | Professional Editing, Color, Effects and Audio Post! 52 | 53 | 54 |

55 | """ + latest_description + """ 56 |

57 |
58 | 59 | """ + app_id + """.desktop 60 | 61 | 62 | 63 | DaVinci Resolve 18 Cut Page 64 | https://images.blackmagicdesign.com/images/products/davinciresolve/overview/onesolution/carousel/cut.jpg 65 | 66 | 67 | DaVinci Resolve 18 Edit Page 68 | https://images.blackmagicdesign.com/images/products/davinciresolve/overview/onesolution/carousel/edit.jpg 69 | 70 | 71 | DaVinci Resolve 18 Color Page 72 | https://images.blackmagicdesign.com/images/products/davinciresolve/overview/onesolution/carousel/color.jpg 73 | 74 | 75 | DaVinci Resolve 18 Fusion Page 76 | https://images.blackmagicdesign.com/images/products/davinciresolve/overview/onesolution/carousel/fusion.jpg 77 | 78 | 79 | DaVinci Resolve 18 Fairlight Page 80 | https://images.blackmagicdesign.com/images/products/davinciresolve/overview/onesolution/carousel/fairlight.jpg 81 | 82 | 83 | 84 | https://www.blackmagicdesign.com/products/davinciresolve 85 | Blackmagicdesign 86 | 87 | 88 | resolve 89 | 90 | 91 | 92 | """ + releases + """ 93 | 94 |
95 | """ 96 | with open(f"/app/share/metainfo/{app_id}.metainfo.xml", 'w') as f: 97 | f.write(template) 98 | -------------------------------------------------------------------------------- /python/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os.path 3 | import zipfile 4 | 5 | from resolve_download import * 6 | from build_metainfo import * 7 | 8 | if __name__ == "__main__": 9 | is_studio = '--studio' in sys.argv 10 | is_beta = '--beta' in sys.argv 11 | app_tag = "davinci-resolve-studio" if is_studio else "davinci-resolve" 12 | 13 | print("Building for tag " + app_tag) 14 | 15 | print("Requesting version information...") 16 | (version, release_id, download_id) = get_latest_version_information( 17 | refer_id='77ef91f67a9e411bbbe299e595b4cfcc', 18 | app_tag=app_tag, 19 | stable=is_beta is False, 20 | ) 21 | if not os.path.isfile("resolve.zip"): 22 | print(f"Download latest version of DaVinci Resolve{' Studio' if is_studio else ''}...") 23 | download_using_id(download_id) 24 | else: 25 | print(f"Using user supplied resolve.zip (testing)") 26 | 27 | print("Extracting resolve installation...") 28 | with zipfile.ZipFile("./resolve.zip", 'r') as zip_file: 29 | zip_file.extractall('.') 30 | 31 | print(f"Building meta info...") 32 | build_metainfo( 33 | app_id='com.blackmagic.ResolveStudio' if is_studio else 'com.blackmagic.Resolve', 34 | app_description="DaVinci Resolve Studio" if is_studio else 'DaVinci Resolve', 35 | app_tag=app_tag, 36 | ) 37 | -------------------------------------------------------------------------------- /python/resolve_download.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | import requests 4 | 5 | from version import Version 6 | 7 | cookies = { 8 | '_ga': 'GA1.2.1849503966.1518103294', 9 | '_gid': 'GA1.2.953840595.1518103294', 10 | } 11 | 12 | headers = { 13 | 'Host': 'www.blackmagicdesign.com', 14 | 'Accept': 'application/json, text/plain, */*', 15 | 'Origin': 'https://www.blackmagicdesign.com', 16 | 'User-Agent': "Mozilla/5.0 (X11; Linux) \ 17 | AppleWebKit/537.36 (KHTML, like Gecko) \ 18 | Chrome/77.0.3865.75 \ 19 | Safari/537.36", 20 | 'Content-Type': 'application/json;charset=UTF-8', 21 | 'Accept-Encoding': 'gzip, deflate, br', 22 | 'Accept-Language': 'en-US,en;q=0.9', 23 | 'Authority': 'www.blackmagicdesign.com', 24 | 'Cookie': '_ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294', 25 | } 26 | 27 | 28 | def get_latest_version_information(app_tag: str, refer_id: str = '77ef91f67a9e411bbbe299e595b4cfcc', stable=True): 29 | response: requests.Response = requests.get( 30 | f"https://www.blackmagicdesign.com/api/support/latest-stable-version/{app_tag}/linux" 31 | if stable else 32 | f"https://www.blackmagicdesign.com/api/support/latest-version/{app_tag}/linux", 33 | cookies=cookies, 34 | headers={ 35 | **headers, 36 | 'Referer': 'https://www.blackmagicdesign.com/support/download/' + refer_id + '/Linux', 37 | }, 38 | ) 39 | 40 | parsed_response = json.loads(response.content.decode('utf-8')) 41 | 42 | return (Version( 43 | major=parsed_response["linux"]["major"], 44 | minor=parsed_response["linux"]["minor"], 45 | patch=parsed_response["linux"]["releaseNum"], 46 | build=parsed_response["linux"]["build"], 47 | beta=parsed_response["linux"]["beta"] if "beta" in parsed_response["linux"] else -1 48 | ), parsed_response["linux"]["releaseId"], parsed_response["linux"]["downloadId"]) 49 | 50 | 51 | def download_using_id(download_id: str, refer_id: str = "77ef91f67a9e411bbbe299e595b4cfcc"): 52 | download_url_data = { 53 | "firstname": "Flatpak", 54 | "lastname": "Builder", 55 | "email": "someone@flathub.org", 56 | "phone": "202-555-0194", 57 | "country": "us", 58 | "state": "New York", 59 | "city": "FPK", 60 | "street": "Bowery 146", 61 | "product": "DaVinci Resolve" 62 | } 63 | 64 | download_url_response = requests.post( 65 | 'https://www.blackmagicdesign.com/api/register/us/download/' + download_id, 66 | cookies=cookies, 67 | headers={ 68 | **headers, 69 | "Referer": "https://www.blackmagicdesign.com/support/download/" + refer_id + "/Linux", 70 | }, 71 | data=json.dumps(download_url_data), 72 | ) 73 | 74 | download_url = download_url_response.content.decode('utf-8') 75 | 76 | download_response = requests.get(download_url, stream=True) 77 | total_size_in_bytes = int(download_response.headers.get('Content-Length', 0)) 78 | progress = 0 79 | with open("./resolve.zip", "wb") as f: 80 | for chunk in download_response.iter_content(chunk_size=10242 * 1024): 81 | f.write(chunk) 82 | progress += len(chunk) 83 | print(" " + str(round(progress / total_size_in_bytes * 100, 4)) + "%", end='\r', flush=True) 84 | -------------------------------------------------------------------------------- /python/version.py: -------------------------------------------------------------------------------- 1 | class Version: 2 | def __init__(self, major: int, minor: int, patch: int, beta: int, build: int): 3 | self.major = major 4 | self.minor = minor 5 | self.patch = patch 6 | self.beta = beta 7 | self.build = build 8 | 9 | def __str__(self): 10 | return f"""{self.major}.{self.minor}.{self.patch}{"" if self.beta == -1 else f".{self.beta}+{self.build}"}""" 11 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests -------------------------------------------------------------------------------- /run_complete_installation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Setting up python build environment..." 3 | python -m venv venv 4 | source ./venv/bin/activate 5 | pip3 install -r requirements.txt 6 | echo "Setting up directory structure..." 7 | ./setup_directories.sh $1 8 | python3 ./main.py $1 9 | chmod +x ./DaVinci_Resolve_*_Linux.run 10 | ./setup_resolve.sh $1 11 | install -Dm755 resolve.sh /app/bin/resolve.sh 12 | -------------------------------------------------------------------------------- /shell/resolve.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #export BMD_RESOLVE_LUT_DIR= 3 | #export BMD_RESOLVE_SUPPORT_DIR 4 | export BMD_RESOLVE_CONFIG_DIR="${XDG_CONFIG_HOME}" 5 | export BMD_RESOLVE_LICENSE_DIR="${XDG_DATA_HOME}/license" 6 | export BMD_RESOLVE_LOGS_DIR="${XDG_DATA_HOME}/logs" 7 | exec /app/bin/resolve $@ 8 | -------------------------------------------------------------------------------- /shell/setup_directories.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir -p /app/share/metainfo 3 | chmod 755 /app/share/metainfo -------------------------------------------------------------------------------- /shell/setup_resolve.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #### 3 | # Build DaVinci Resolve in a Flatpak 4 | # 5 | # This script leverages heavily on work from makeresolvedeb, with great thanks: 6 | # https://www.danieltufvesson.com/makeresolvedeb 7 | #### 8 | PREFIX='/app' 9 | STUDIO=false 10 | 11 | usage() 12 | { 13 | echo "Usage: $0 [ -s | --studio ] [ -p | --prefix PREFIX ]" 14 | exit 2 15 | } 16 | 17 | PARSED_ARGUMENTS=$(getopt -a -n setup_resolve.sh -o sp: --long studio,prefix: -- "$@") 18 | VALID_ARGUMENTS=$? 19 | if [ "$VALID_ARGUMENTS" != "0" ]; then 20 | usage 21 | fi 22 | 23 | eval set -- "$PARSED_ARGUMENTS" 24 | while : 25 | do 26 | case "$1" in 27 | -s | --studio) STUDIO=true ; shift ;; 28 | -p | --prefix) PREFIX="$2" ; shift 2 ;; 29 | --) shift; break ;; 30 | *) echo "Unexpected option: $1 - this should not happen." 31 | usage ;; 32 | esac 33 | done 34 | 35 | APP_ID="com.blackmagic.Resolve" 36 | APP_DESCRIPTION="DaVinci Resolve" 37 | if [ "${STUDIO}" = true ] ; then 38 | APP_ID="com.blackmagic.ResolveStudio" 39 | APP_DESCRIPTION="DaVinci Resolve Studio" 40 | fi 41 | 42 | echo "Building ${APP_ID}" 43 | 44 | ./DaVinci_Resolve_*_Linux.run --appimage-extract 2>&1 45 | find squashfs-root -type f -exec chmod a+r,u+w {} \; 46 | find squashfs-root -type d -exec chmod a+rx,u+w {} \; 47 | 48 | # Create directories 49 | mkdir -p ${PREFIX}/easyDCP ${PREFIX}/scripts ${PREFIX}/share ${PREFIX}/Fairlight ${PREFIX}/share/applications ${PREFIX}/share/icons/hicolor/128x128/apps ${PREFIX}/share/icons/hicolor/256x256/apps 50 | chmod 755 ${PREFIX}/easyDCP ${PREFIX}/scripts ${PREFIX}/share ${PREFIX}/Fairlight ${PREFIX}/share/applications ${PREFIX}/share/icons/hicolor/128x128/apps ${PREFIX}/share/icons/hicolor/256x256/apps 51 | 52 | # Copy objects 53 | cp -rp squashfs-root/bin ${PREFIX}/ 54 | cp -rp squashfs-root/Control ${PREFIX}/ 55 | cp -rp squashfs-root/Certificates ${PREFIX}/ 56 | cp -rp squashfs-root/DaVinci\ Control\ Panels\ Setup ${PREFIX}/ 57 | cp -rp squashfs-root/Developer ${PREFIX}/ 58 | cp -rp squashfs-root/docs ${PREFIX}/ 59 | cp -rp squashfs-root/Fairlight\ Studio\ Utility ${PREFIX}/ 60 | cp -rp squashfs-root/Fusion ${PREFIX}/ 61 | cp -rp squashfs-root/graphics ${PREFIX}/ 62 | 63 | # https://www.reddit.com/r/Fedora/comments/12z32r1/davinci_resolve_libpango_undefined_symbol_g/ 64 | rm squashfs-root/libs/libglib* 65 | rm squashfs-root/libs/libgio* 66 | rm squashfs-root/libs/libgmodule* 67 | rm squashfs-root/libs/libgobject* 68 | # Can we use system Qt5? Not yet. 69 | # rm squashfs-root/libs/libQt5* 70 | cp -rp squashfs-root/libs ${PREFIX}/ 71 | 72 | cp -rp squashfs-root/LUT ${PREFIX}/ 73 | cp -rp squashfs-root/Onboarding ${PREFIX}/ 74 | cp -rp squashfs-root/plugins ${PREFIX}/ 75 | cp -rp squashfs-root/Technical\ Documentation ${PREFIX}/ 76 | cp -rp squashfs-root/UI_Resource ${PREFIX}/ 77 | cp -rp squashfs-root/scripts/script.checkfirmware ${PREFIX}/scripts/ 78 | cp -rp squashfs-root/scripts/script.getlogs.v4 ${PREFIX}/scripts/ 79 | cp -rp squashfs-root/scripts/script.start ${PREFIX}/scripts/ 80 | cp -rp squashfs-root/share/default-config.dat ${PREFIX}/share/ 81 | cp -rp squashfs-root/share/default_cm_config.bin ${PREFIX}/share/ 82 | cp -rp squashfs-root/share/log-conf.xml ${PREFIX}/share/ 83 | if [[ -e squashfs-root/share/remote-monitoring-log-conf.xml ]]; then 84 | cp -rp squashfs-root/share/remote-monitoring-log-conf.xml ${PREFIX}/share/ 85 | fi 86 | 87 | tar -xzvf squashfs-root/share/panels/dvpanel-framework-linux-x86_64.tgz -C ${PREFIX}/libs libDaVinciPanelAPI.so libFairlightPanelAPI.so 88 | 89 | # Quiet some errors 90 | mkdir -p ${PREFIX}/bin/BlackmagicRawAPI/ 91 | ln -s ../libs/libBlackmagicRawAPI.so ${PREFIX}/bin/libBlackmagicRawAPI.so 92 | ln -s ../../libs/libBlackmagicRawAPI.so ${PREFIX}/bin/BlackmagicRawAPI/libBlackmagicRawAPI.so 93 | 94 | if [[ -e squashfs-root/BlackmagicRAWPlayer ]]; then 95 | echo "Adding RAWPlayer" 96 | 97 | cp -rp squashfs-root/BlackmagicRAWPlayer ${PREFIX} 98 | cat < ${PREFIX}/share/applications/${APP_ID}.RAWPlayer.desktop 99 | [Desktop Entry] 100 | Version=1.0 101 | Type=Application 102 | Name=Blackmagic RAW Player 103 | Exec=/app/BlackmagicRAWPlayer/BlackmagicRAWPlayer 104 | Icon=${APP_ID}.RAWPlayer 105 | Terminal=false 106 | MimeType=application/x-braw-clip;application/x-braw-sidecar 107 | StartupNotify=true 108 | Categories=AudioVideo 109 | PrefersNonDefaultGPU=true 110 | EOF 111 | cp -p squashfs-root/graphics/blackmagicraw-player_256x256_apps.png ${PREFIX}/share/icons/hicolor/256x256/apps/${APP_ID}.RAWPlayer.png 112 | fi 113 | if [[ -e squashfs-root/BlackmagicRAWSpeedTest ]]; then 114 | echo "Adding BlackmagicRAWSpeedTest" 115 | 116 | cp -rp squashfs-root/BlackmagicRAWSpeedTest ${PREFIX} 117 | cat < ${PREFIX}/share/applications/${APP_ID}.RAWSpeedTest.desktop 118 | [Desktop Entry] 119 | Version=1.0 120 | Type=Application 121 | Name=Blackmagic RAW Speed Test 122 | Exec=/app/BlackmagicRAWSpeedTest/BlackmagicRAWSpeedTest 123 | Icon=${APP_ID}.RAWSpeedTest 124 | Terminal=false 125 | StartupNotify=true 126 | Categories=AudioVideo 127 | PrefersNonDefaultGPU=true 128 | EOF 129 | cp -p squashfs-root/graphics/blackmagicraw-speedtest_256x256_apps.png ${PREFIX}/share/icons/hicolor/256x256/apps/${APP_ID}.RAWSpeedTest.png 130 | fi 131 | 132 | #### 133 | # Create udev rules 134 | # 135 | # Figure out how to do this under Flatpak 136 | # 137 | #### 138 | #mkdir -p ${PREFIX}/lib/udev/rules.d 139 | #chmod 755 ${PREFIX}/lib/udev/rules.d 140 | #cat > ${PREFIX}/lib/udev/rules.d/75-davincipanel.rules < ${PREFIX}/lib/udev/rules.d/75-davincikb.rules < ${PREFIX}/lib/udev/rules.d/75-sdx.rules < ${PREFIX}/share/applications/${APP_ID}.desktop 156 | [Desktop Entry] 157 | Version=1.0 158 | Type=Application 159 | Name=${APP_DESCRIPTION} 160 | Name[en_US]=${APP_DESCRIPTION} 161 | GenericName=${APP_DESCRIPTION} 162 | Comment=Revolutionary new tools for editing, visual effects, color correction and professional audio post production, all in a single application! 163 | Exec=/app/bin/resolve.sh %U 164 | Icon=${APP_ID} 165 | Terminal=false 166 | MimeType=application/x-resolveproj; 167 | StartupNotify=true 168 | Categories=AudioVideo 169 | PrefersNonDefaultGPU=true 170 | EOF 171 | cp -rp squashfs-root/graphics/DV_Resolve.png ${PREFIX}/share/icons/hicolor/128x128/apps/${APP_ID}.png 172 | 173 | # if [[ -e "${PREFIX}/DaVinci Resolve Panels Setup/DaVinci Resolve Panels Setup" ]]; then 174 | # cat << EOF > ${PREFIX}/share/applications/${APP_ID}.PanelSetup.desktop 175 | # [Desktop Entry] 176 | # Version=1.0 177 | # Type=Application 178 | # Name=DaVinci Resolve Panels Setup 179 | # Exec="/app/DaVinci Resolve Panels Setup/DaVinci Resolve Panels Setup" 180 | # Icon=${APP_ID}.PanelSetup 181 | # Terminal=false 182 | # StartupNotify=true 183 | # Categories=AudioVideo 184 | # EOF 185 | # cp -rp squashfs-root/graphics/DV_Panels.png ${PREFIX}/share/icons/hicolor/128x128/apps/${APP_ID}.PanelSetup.png 186 | # fi 187 | if [[ -e "${PREFIX}/DaVinci Control Panels Setup/DaVinci Control Panels Setup" ]]; then 188 | cat < ${PREFIX}/share/applications/${APP_ID}.PanelSetup.desktop 189 | [Desktop Entry] 190 | Version=1.0 191 | Type=Application 192 | Name=DaVinci Resolve Panels Setup 193 | Exec="/app/DaVinci Resolve Panels Setup/DaVinci Resolve Panels Setup" 194 | Icon=${APP_ID}.PanelSetup 195 | Terminal=false 196 | StartupNotify=true 197 | Categories=AudioVideo 198 | PrefersNonDefaultGPU=true 199 | EOF 200 | cp -rp squashfs-root/graphics/DV_Panels.png ${PREFIX}/share/icons/hicolor/128x128/apps/${APP_ID}.PanelSetup.png 201 | fi 202 | if [[ -e "${PREFIX}/bin/DaVinci Remote Monitoring" ]]; then 203 | cat < ${PREFIX}/share/applications/${APP_ID}.RemoteMonitoring.desktop 204 | [Desktop Entry] 205 | Version=1.0 206 | Type=Application 207 | Name=DaVinci Remote Monitoring 208 | Exec="/app/bin/DaVinci Remote Monitoring" 209 | Icon=${APP_ID}.RemoteMonitoring 210 | Terminal=false 211 | StartupNotify=true 212 | Categories=AudioVideo 213 | PrefersNonDefaultGPU=true 214 | EOF 215 | cp -rp squashfs-root/graphics/Remote_Monitoring.png ${PREFIX}/share/icons/hicolor/128x128/apps/${APP_ID}.RemoteMonitoring.png 216 | fi 217 | --------------------------------------------------------------------------------