Merge pull request #255577 from amarshall/davinci-resolve

davinci-resolve: 18.5.1 -> 18.6.2; add studio variant; various improvements
This commit is contained in:
Peder Bergebakken Sundt 2023-12-02 13:35:43 +01:00 committed by GitHub
commit 669b964ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 12 deletions

View File

@ -22,13 +22,16 @@
, aprutil
, makeDesktopItem
, copyDesktopItems
, jq
, studioVariant ? false
}:
let
davinci = (
stdenv.mkDerivation rec {
pname = "davinci-resolve";
version = "18.5.1";
pname = "davinci-resolve${lib.optionalString studioVariant "-studio"}";
version = "18.6.3";
nativeBuildInputs = [
(appimage-run.override { buildFHSEnv = buildFHSEnvChroot; } )
@ -47,19 +50,24 @@ let
rec {
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "sha256-AZ869hA/WeCf3sxhdDOzD/q30P1NaD18TheBtS1ammQ=";
outputHash =
if studioVariant
then "sha256-OX8PyMhfl0jRdXBNsjlwkCAh8XUNJv8HEbmyAdjIv18="
else "sha256-PNzdVxGgXIHM2vi3ChHx67TQBFlCYBOZCiFkDi/RSu4=";
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
nativeBuildInputs = [ curl ];
nativeBuildInputs = [ curl jq ];
# ENV VARS
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
# Get linux.downloadId from HTTP response on https://www.blackmagicdesign.com/products/davinciresolve
DOWNLOADID = "defc1c6789b7475b9ee4a42daf9ba61d";
REFERID = "263d62f31cbb49e0868005059abcb0c9";
SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";
DOWNLOADSURL = "https://www.blackmagicdesign.com/api/support/us/downloads.json";
SITEURL = "https://www.blackmagicdesign.com/api/register/us/download";
PRODUCT = "DaVinci Resolve${lib.optionalString studioVariant " Studio"}";
VERSION = version;
USERAGENT = builtins.concatStringsSep " " [
"User-Agent: Mozilla/5.0 (X11; Linux ${stdenv.hostPlatform.linuxArch})"
@ -77,10 +85,16 @@ let
"street" = "Hogeweide 346";
"state" = "Province of Utrecht";
"city" = "Utrecht";
"product" = "DaVinci Resolve";
"product" = PRODUCT;
};
} ''
DOWNLOADID=$(
curl --silent --compressed "$DOWNLOADSURL" \
| jq --raw-output '.downloads[] | select(.name | test("^'"$PRODUCT $VERSION"'( Update)?$")) | .urls.Linux[0].downloadId'
)
echo "downloadid is $DOWNLOADID"
test -n "$DOWNLOADID"
RESOLVEURL=$(curl \
--silent \
--header 'Host: www.blackmagicdesign.com' \
@ -95,7 +109,7 @@ let
--header 'Cookie: _ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294' \
--data-ascii "$REQJSON" \
--compressed \
"$SITEURL")
"$SITEURL/$DOWNLOADID")
curl \
--retry 3 --retry-delay 3 \
@ -111,14 +125,17 @@ let
# The unpack phase won't generate a directory
sourceRoot = ".";
installPhase = ''
installPhase = let
appimageName = "DaVinci_Resolve_${lib.optionalString studioVariant "Studio_"}${version}_Linux.run";
in ''
runHook preInstall
export HOME=$PWD/home
mkdir -p $HOME
mkdir -p $out
appimage-run ./DaVinci_Resolve_${version}_Linux.run -i -y -n -C $out
test -e ${lib.escapeShellArg appimageName}
appimage-run ${lib.escapeShellArg appimageName} -i -y -n -C $out
mkdir -p $out/{configs,DolbyVision,easyDCP,Fairlight,GPUCache,logs,Media,"Resolve Disk Database",.crashreport,.license,.LUT}
runHook postInstall
@ -162,7 +179,9 @@ let
);
in
buildFHSEnv {
name = "davinci-resolve";
inherit (davinci) pname version;
name = null;
targetPkgs = pkgs: with pkgs; [
alsa-lib
aprutil
@ -201,6 +220,7 @@ buildFHSEnv {
xorg.libXinerama
xorg.libXrandr
xorg.libXrender
xorg.libXt
xorg.libXtst
xorg.libXxf86vm
xorg.libxcb
@ -213,16 +233,22 @@ buildFHSEnv {
zlib
];
extraBwrapArgs = lib.optionals studioVariant [
"--bind \"$HOME\"/.local/share/DaVinciResolve/license ${davinci}/.license"
];
runScript = "${bash}/bin/bash ${
writeText "davinci-wrapper"
''
export QT_XKB_CONFIG_ROOT="${xkeyboard_config}/share/X11/xkb"
export QT_PLUGIN_PATH="${davinci}/libs/plugins:$QT_PLUGIN_PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${davinci}/libs
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/lib32:${davinci}/libs
${davinci}/bin/resolve
''
}";
passthru = { inherit davinci; };
meta = with lib; {
description = "Professional video editing, color, effects and audio post-processing";
homepage = "https://www.blackmagicdesign.com/products/davinciresolve";

View File

@ -1764,6 +1764,8 @@ with pkgs;
davinci-resolve = callPackage ../applications/video/davinci-resolve { };
davinci-resolve-studio = callPackage ../applications/video/davinci-resolve { studioVariant = true; };
dolbybcsoftwaredecode = callPackage ../applications/audio/dolbybcsoftwaredecode { };
donkey = callPackage ../tools/security/donkey { };