-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-sdk-release
executable file
·123 lines (115 loc) · 4.17 KB
/
build-sdk-release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
ReleaseTag="sdk-1.1.85.0"
JSONFile="SDKs/common/config.json"
Packages=("spirv-headers"
"spirv-tools"
"spirv-cross"
"glslang"
"shaderc"
"vulkan-headers"
"vulkan-loader"
"vulkan-validationlayers"
"vulkan-tools"
"lunarg-tools"
)
declare -A JSONName=(
[lunarhub-doc]="LunarHub-Doc"
[spirv-headers]="SPIRV-Headers"
[spirv-tools]="SPIRV-Tools"
[spirv-cross]="SPIRV-Cross"
[glslang]="Glslang"
[shaderc]="shaderc"
[vulkan-headers]="Vulkan-Headers"
[vulkan-loader]="Vulkan-Loader"
[vulkan-validationlayers]="Vulkan-ValidationLayers"
[vulkan-tools]="Dash-Tools"
[lunarg-tools]="LunarG-Tools"
)
declare -A LocalClone=(
[lunarhub-doc]="$HOME/src/vulkan/LunarHub-Doc"
[spirv-headers]="$HOME/src/vulkan/SPIRV-Headers"
[spirv-tools]="$HOME/src/vulkan/SPIRV-Tools"
[spirv-cross]="$HOME/src/vulkan/SPIRV-Cross"
[glslang]="$HOME/src/vulkan/glslang"
[shaderc]="$HOME/src/vulkan/shaderc"
[vulkan-headers]="$HOME/src/vulkan/Vulkan-Headers"
[vulkan-loader]="$HOME/src/vulkan/Vulkan-Loader"
[vulkan-validationlayers]="$HOME/src/vulkan/Vulkan-ValidationLayers"
[vulkan-tools]="$HOME/src/vulkan/Vulkan-Tools"
[lunarg-tools]="$HOME/src/vulkan/VulkanTools"
)
declare -A CommitID=(
[spirv-headers]="khronos/master"
[spirv-tools]="khronos/stable"
[spirv-cross]=""
[glslang]=""
[shaderc]=""
[vulkan-headers]=""
[vulkan-loader]=""
[vulkan-validationlayers]=""
[vulkan-tools]=""
[lunarg-tools]=""
)
# Fill in the commit IDs to build from
pushd "${LocalClone[lunarhub-doc]}"|| exit "$?"
git remote update || exit "$?"
git reset --hard
git clean -f
git co ${ReleaseTag} || exit "$?"
for package in "${Packages[@]}"; do
commit="upstream/$(jq -r .repos.\"${JSONName[${package}]}\".branch ${JSONFile})"
if [ "$commit" == "upstream/null" ]; then
commit=$(jq -r .repos.\"${JSONName[${package}]}\".commit ${JSONFile})
fi
if [ "$commit" != "null" ]; then
CommitID[${package}]=${commit}
fi
done
popd
# This is fugly, but the tarball build depends on the glslang build to pull in
# some random version of spirv-headers and spirv-tools, and then copies those
# subdirectories into the SDK. I guess we should do the same hideous kludge in
# an even more heinous way, since we're building packages, not just copying
# directories around. :P
pushd "${LocalClone[glslang]}"|| exit "$?"
git remote update || exit "$?"
git reset --hard
git clean -f
git co ${CommitID[glslang]} || exit "$?"
# Find spirv-headers commit
commit=$(jq -r '.commits[] | select(.name == "spirv-tools/external/spirv-headers").commit' known_good.json)
[ "$commit" != "null" ] || (echo "Can't find spirv-headers commit"; exit 1)
CommitID[spirv-headers]=${commit}
# Find spirv-tools commit
commit=$(jq -r '.commits[] | select(.name == "spirv-tools").commit' known_good.json)
[ "$commit" != "null" ] || (echo "Can't find spirv-tools commit"; exit 1)
CommitID[spirv-tools]=${commit}
popd
# Check each package to see if we've previously built the same commit, kick off
# a build if not.
for package in "${Packages[@]}"; do
commit=${CommitID[${package}]}
echo "==================================================================="
echo "Checking ${package}: CommitID=${commit}]}"
echo "-------------------------------------------------------------------"
pushd "${LocalClone[${package}]}"|| exit "$?"
git remote update || exit "$?"
git reset --hard
git clean -f
git co debian-unstable || exit "$?"
lbc="upstream-unstable"
lbcFile="debian/lunarg-build-commit"
# Check if there's a debian/lunarg-build-commit file, if so, prefer it
[ -e ${lbcFile} ] && lbc=$(cat ${lbcFile})
lbc="$(git rev-parse ${lbc})"
[ "${lbc}" ] || ( echo "Last build commit is bogus/empty"; continue )
updateCount=$(git rev-list ${lbc}..${commit} --count)
if [ "${updateCount}" -gt "0" ]; then
echo " ######################################"
echo " # ${updateCount} commits since last build"
echo " # Building ${package}: CommitID=${commit}]}"
echo " #-------------------------------------"
build-package-from-commitid -i -c ${commit} -s "~lunarg" -g "\'-l ${lbc}\'"
fi
popd
done