-
Notifications
You must be signed in to change notification settings - Fork 1
/
create-tarball-sdk
executable file
·38 lines (31 loc) · 1.46 KB
/
create-tarball-sdk
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
#!/bin/bash
# Create something similar to the old tarball SDK from existing debian packages
META_PACKAGE=lunarg-vulkan-sdk
BASE_VERSION=1.0.65.2
SDK_DIR=VulkanSDK
DEBS_DIR=debs-tmp
# Grab the full version string of the first line madison returns which contains the base version (i.e. highest version that matches)
DEB_VERSION=$(apt-cache madison $META_PACKAGE | awk -F"|" -v pattern="$BASE_VERSION" '{if ($2~pattern) {print $2; exit}}' | tr -d ' ')
if [ $DEB_VERSION ]; then
rm -fr $DEBS_DIR $SDK_DIR
mkdir -p $DEBS_DIR
# Note that this hack only works if none of the packages are installed on
# the system/chroot it's running under, and if it's pointing at a current
# lunarg package repository.
apt-get install -y "$META_PACKAGE=$DEB_VERSION" --print-uris | awk -F"'" '{print $2}' | wget -P $DEBS_DIR -i -
# Just extract the packages. Fine, since there are no install scripts.
for DEB in $(ls $DEBS_DIR/*.deb); do
dpkg-deb -x $DEB $SDK_DIR
done
# /etc is empty currently.
rm -fr $SDK_DIR/etc
mv $SDK_DIR/usr $SDK_DIR/$BASE_VERSION
fi
cat > $SDK_DIR/$BASE_VERSION/setup-env.sh <<"EOF"
# source this file into an existing shell.
export VULKAN_SDK="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH="$VULKAN_SDK/bin:$PATH"
export LD_LIBRARY_PATH="$VULKAN_SDK/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}"
export VK_LAYER_PATH="$VULKAN_SDK/share/vulkan/explicit_layer.d"
EOF
tar zcvf vulkansdk-linux-x86_64-$BASE_VERSION.tgz $SDK_DIR