diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-05-13 11:29:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-13 11:29:51 +0200 |
commit | 30371173db6a60f010ab74f2c327d8c15e351dca (patch) | |
tree | 55b7436f816f6d65d7d078e06fdbfc6eadc9b6f7 /pkgs/applications | |
parent | 9750dce1ceb4871d9631f86b5b5664f0bb00c772 (diff) | |
parent | e11b9dd5fda5cffc1b0b73ee993df798ac264775 (diff) |
Merge pull request #297627 from jshcmpbll/jc/davinci-updateScript
davinci-resolve: add updateScript
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/video/davinci-resolve/default.nix | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/pkgs/applications/video/davinci-resolve/default.nix b/pkgs/applications/video/davinci-resolve/default.nix index bb631909872cf..bca8bc1e48ed2 100644 --- a/pkgs/applications/video/davinci-resolve/default.nix +++ b/pkgs/applications/video/davinci-resolve/default.nix @@ -25,6 +25,9 @@ , jq , studioVariant ? false + +, common-updater-scripts +, writeShellApplication }: let @@ -251,7 +254,28 @@ buildFHSEnv { '' }"; - passthru = { inherit davinci; }; + passthru = { + inherit davinci; + updateScript = lib.getExe (writeShellApplication { + name = "update-davinci-resolve"; + runtimeInputs = [ curl jq common-updater-scripts ]; + text = '' + set -o errexit + drv=pkgs/applications/video/davinci-resolve/default.nix + currentVersion=${lib.escapeShellArg davinci.version} + downloadsJSON="$(curl --fail --silent https://www.blackmagicdesign.com/api/support/us/downloads.json)" + + latestLinuxVersion="$(echo "$downloadsJSON" | jq '[.downloads[] | select(.urls.Linux) | .urls.Linux[] | select(.downloadTitle | test("DaVinci Resolve")) | .downloadTitle]' | grep -oP 'DaVinci Resolve \K\d+\.\d+\.\d+' | sort | tail -n 1)" + update-source-version davinci-resolve "$latestLinuxVersion" --source-key=davinci.src + + # Since the standard and studio both use the same version we need to reset it before updating studio + sed -i -e "s/""$latestLinuxVersion""/""$currentVersion""/" "$drv" + + latestStudioLinuxVersion="$(echo "$downloadsJSON" | jq '[.downloads[] | select(.urls.Linux) | .urls.Linux[] | select(.downloadTitle | test("DaVinci Resolve")) | .downloadTitle]' | grep -oP 'DaVinci Resolve Studio \K\d+\.\d+\.\d+' | sort | tail -n 1)" + update-source-version davinci-resolve-studio "$latestStudioLinuxVersion" --source-key=davinci.src + ''; + }); + }; meta = with lib; { description = "Professional video editing, color, effects and audio post-processing"; |