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

[Misc] Check for the available and installed Vulkan SDK versions before downloading and installing. #98608

Merged
merged 1 commit into from
Dec 2, 2024
Merged
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
22 changes: 22 additions & 0 deletions misc/scripts/install_vulkan_sdk_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
set -euo pipefail
IFS=$'\n\t'

# Check currently installed and latest available Vulkan SDK versions.
if [ -d "$HOME/VulkanSDK" ]; then
if command -v jq 2>&1 >/dev/null; then
curl -L "https://sdk.lunarg.com/sdk/download/latest/mac/config.json" -o /tmp/vulkan-sdk.json

new_ver=`jq -r '.version' /tmp/vulkan-sdk.json`
new_ver=`echo "$new_ver" | awk -F. '{ printf("%d%02d%04d%02d\n", $1,$2,$3,$4); }';`

rm -f /tmp/vulkan-sdk.json

for f in $HOME/VulkanSDK/*; do
if [ -d "$f" ]; then
f=`echo "${f##*/}" | awk -F. '{ printf("%d%02d%04d%02d\n", $1,$2,$3,$4); }';`
if [ $f -ge $new_ver ]; then
echo 'Latest or newer Vulkan SDK is already installed. Skipping installation.'
exit 0
fi
fi
done
fi
fi

# Download and install the Vulkan SDK.
curl -L "https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.zip" -o /tmp/vulkan-sdk.zip
unzip /tmp/vulkan-sdk.zip -d /tmp
Expand Down
Loading