base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12 (#356361)
[NixPkgs.git] / pkgs / tools / graphics / vulkan-cts / update.sh
blob11081d8708dc9ebbe0843a5e5914ac6620e37bac
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p common-updater-scripts curl jq
4 set -euo pipefail
6 rawVersion="$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -s "https://api.github.com/repos/KhronosGroup/VK-GL-CTS/releases" | jq -r 'map(select(.tag_name | startswith("vulkan-cts-"))) | .[0].tag_name')"
7 basedir="$(git rev-parse --show-toplevel)"
9 cd "$basedir"
10 # Strip prefix
11 version="$(echo "$rawVersion" | sed 's/vulkan-cts-//')"
12 update-source-version vulkan-cts "$version"
14 # Update imported sources
15 tmpDir="$(mktemp -d)"
16 trap "rm -rf $tmpDir" EXIT
18 curl -s "https://raw.githubusercontent.com/KhronosGroup/VK-GL-CTS/$rawVersion/external/fetch_sources.py" -o "$tmpDir/fetch_sources.py"
19 sed -i '/from ctsbuild.common import/d' "$tmpDir/fetch_sources.py"
20 cd "$(dirname "$0")"
21 PYTHONPATH="$tmpDir/" ./vk-cts-sources.py