mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2025-04-29 17:25:34 +00:00
Resolve automatic install
This commit is contained in:
parent
39efa6380f
commit
f5d9c6d2c5
@ -5,13 +5,15 @@
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
bitwig=$(dnf list | grep bitwig-studio)
|
||||
bitwig=$(sudo dnf list | grep bitwig-studio)
|
||||
bitwigVersion=$(echo $bitwig | awk '{print $2;}'| filterVersion)
|
||||
url=$(curl -s https://www.bitwig.com/en/download.html | grep .deb | grep -Po '(?<=href=")[^"]*.deb')
|
||||
urlVersion=$(echo $url | awk -F "-" '{ print $3 }' | rev | cut -f 2- -d '.' | rev)
|
||||
|
||||
checkUptoDate Bitwig $bitwigVersion $urlVersion
|
||||
|
||||
echo Installing Bitwig Studio $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
mkdir -p ~/Downloads/installers
|
||||
cd ~/Downloads/installers
|
||||
|
42
scripts/installers/blackmagic-parser.py
Normal file
42
scripts/installers/blackmagic-parser.py
Normal file
@ -0,0 +1,42 @@
|
||||
import json
|
||||
import os
|
||||
import urllib.request
|
||||
|
||||
# getJSONData returns JSON data from Blackmagic Design's website.
|
||||
def getJSONData():
|
||||
with urllib.request.urlopen('https://www.blackmagicdesign.com/api/support/us/downloads.json') as url:
|
||||
return json.loads(url.read().decode())
|
||||
|
||||
# getDownloads() returns a list of downloads.
|
||||
def getDownloads():
|
||||
return getJSONData()['downloads']
|
||||
|
||||
# getResolveStudioDownloads() returns a list of DaVinci Resolve Studio downlaods.
|
||||
def getResolveStudioDownloads():
|
||||
return [d for d in getDownloads() if 'davinci-resolve-and-fusion' in d['relatedFamilies'][0] and
|
||||
'Studio' in d['name'] and 'Resolve' in d['name']]
|
||||
|
||||
# filterOnlyLinuxSupport() filters a list of downloads to only ones that
|
||||
# support Linux.
|
||||
def filterOnlyLinuxSupport(downloads):
|
||||
return [d for d in downloads if 'Linux' in d['platforms']]
|
||||
|
||||
# getLinuxURL() returns the Linux download info.
|
||||
def getLinuxURL(download):
|
||||
return download['urls']['Linux'][0]
|
||||
|
||||
# getURLId() returns the download id.
|
||||
def getURLId(url):
|
||||
return url['downloadId']
|
||||
|
||||
# getURLVersion() returns the url version number.
|
||||
def getURLVersion(url):
|
||||
return '{}.{}.{}'.format(url['major'], url['minor'], url['releaseNum'])
|
||||
|
||||
# getDownloadId() returns downlaod id hash.
|
||||
def getDownloadId(download):
|
||||
return download['id']
|
||||
|
||||
for d in filterOnlyLinuxSupport(getResolveStudioDownloads()):
|
||||
linux = getLinuxURL(d)
|
||||
print(getURLVersion(linux), getURLId(linux), getDownloadId(d))
|
@ -5,16 +5,13 @@
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
dragonframe=$(dnf list | grep dragonframe)
|
||||
dragonframe=$(sudo dnf list | grep dragonframe)
|
||||
dragonframeVersion=$(echo $dragonframe | awk '{print $2;}')
|
||||
url=$(curl -s https://www.dragonframe.com/downloads/ | grep .rpm | grep downloadButton | grep -Po '(?<=href=")[^"]*.rpm')
|
||||
urlVersion=$(echo $url | awk -F "-" '{ print $2 }')
|
||||
|
||||
# Check if installed to the most recent version
|
||||
if versionGreater $dragonframeVersion $urlVersion; then
|
||||
echo Dragonframe is up to date. Installed version $dragonframeVersion Web version $urlVersion
|
||||
exit
|
||||
fi
|
||||
checkUptoDate dragonframe $dragonframeVersion $urlVersion
|
||||
echo Installing Dragonframe $urlVersion
|
||||
|
||||
# Setting up and downloading package
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Program version number comparison
|
||||
# Program version number comparison.
|
||||
function versionGreater() {
|
||||
if [[ $1 == $2 ]];then
|
||||
return 0
|
||||
@ -24,14 +24,25 @@ function versionGreater() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Check if installed to the most recent version
|
||||
# Check if installed to the most recent version.
|
||||
function checkUptoDate() {
|
||||
if versionGreater $2 $3; then
|
||||
echo $1 is up to date. Installed version $2 Web version $3
|
||||
echo $1 is up to date. Installed version $2 web version $3
|
||||
exit
|
||||
else
|
||||
echo Updating $1 from $2 to $3...
|
||||
fi
|
||||
}
|
||||
|
||||
# Filters string to Semantic Versioning.
|
||||
function filterVersion() {
|
||||
grep -Go [0-9]\.[0-9]\.[0-9]
|
||||
grep -Po -m 1 '\d{1,4}\.\d{1,4}\.\d{1,4}'
|
||||
}
|
||||
|
||||
# Downloads a file to the given download directory with
|
||||
# the given name.
|
||||
function downloadPackage() {
|
||||
mkdir -p ~/Downloads/installers/$1
|
||||
cd ~/Downloads/installers/$1
|
||||
wget -O $3 $2
|
||||
}
|
||||
|
61
scripts/installers/resolve-install.sh
Normal file
61
scripts/installers/resolve-install.sh
Normal file
@ -0,0 +1,61 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Automatic install script for DaVinci Resolve
|
||||
|
||||
# Import library
|
||||
source $(dirname ${BASH_SOURCE[0]})/install-lib.sh
|
||||
|
||||
resolveVersion=$(cat /opt/resolve/docs/ReadMe.html | grep 'DaVinci Resolve Studio' | filterVersion)
|
||||
url=$(python $(dirname ${BASH_SOURCE[0]})/blackmagic-parser.py | head -n 1)
|
||||
urlVersion=$(echo $url | awk '{print $1;}')
|
||||
downloadID=$(echo $url | awk '{print $2;}')
|
||||
referId=$(echo $url | awk '{print $3;}')
|
||||
packageName="DaVinci_Resolve_Studio_${urlVersion}.zip"
|
||||
|
||||
checkUptoDate Resolve $resolveVersion $urlVersion
|
||||
|
||||
downloadUrl="https://www.blackmagicdesign.com/api/register/us/download/${downloadID}"
|
||||
useragent="User-Agent: Mozilla/5.0 (X11; Linux) \
|
||||
AppleWebKit/537.36 (KHTML, like Gecko) \
|
||||
Chrome/77.0.3865.75 \
|
||||
Safari/537.36"
|
||||
reqjson="{ \
|
||||
\"firstname\": \"Fedora\", \
|
||||
\"lastname\": \"Linux\", \
|
||||
\"email\": \"user@getfedora.org\", \
|
||||
\"phone\": \"919-555-7428\", \
|
||||
\"country\": \"us\", \
|
||||
\"state\": \"North Carolina\", \
|
||||
\"city\": \"Raleigh\", \
|
||||
\"product\": \"DaVinci Resolve\" \
|
||||
}"
|
||||
zipUrl="$(curl \
|
||||
-s \
|
||||
-H 'Host: www.blackmagicdesign.com' \
|
||||
-H 'Accept: application/json, text/plain, */*' \
|
||||
-H 'Origin: https://www.blackmagicdesign.com' \
|
||||
-H "$useragent" \
|
||||
-H 'Content-Type: application/json;charset=UTF-8' \
|
||||
-H "Referer: https://www.blackmagicdesign.com/support/download/${referId}/Linux" \
|
||||
-H 'Accept-Encoding: gzip, deflate, br' \
|
||||
-H 'Accept-Language: en-US,en;q=0.9' \
|
||||
-H 'Authority: www.blackmagicdesign.com' \
|
||||
-H 'Cookie: _ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294' \
|
||||
--data-ascii "$reqjson" \
|
||||
--compressed \
|
||||
"$downloadUrl")"
|
||||
|
||||
# Setting up and downloading package
|
||||
downloadPackage resolve $zipUrl $packageName
|
||||
|
||||
# Installing package
|
||||
sudo dnf install libxcrypt-compat
|
||||
unzip -o $packageName
|
||||
sudo ./*16.2.5*.run -i -y
|
||||
|
||||
# Graphics card fix
|
||||
sudo rm /etc/OpenCL/vendors/mesa.icd
|
||||
sudo rm /etc/OpenCL/vendors/pocl.icd
|
||||
|
||||
# Keyboard mapping fix
|
||||
setxkbmap -option 'caps:super'
|
@ -30,7 +30,7 @@ function flatpakUpdate {
|
||||
# Checks if a program is installed and if it is runs an updater script
|
||||
function updateProgram {
|
||||
if command -v $1 &> /dev/null; then
|
||||
sudo sh $2
|
||||
sh $2
|
||||
fi
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ function manualUpdate {
|
||||
updateProgram bitwig-studio ~/.config/scripts/installers/bitwig-install.sh
|
||||
updateProgram dragonframe ~/.config/scripts/installers/dragonframe-install.sh
|
||||
updateProgram reaper ~/.config/scripts/installers/reaper-install.sh
|
||||
updateProgram /opt/resolve/bin/resolve ~/.config/scripts/installers/resolve-install.sh
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user