Skip to content

Commit

Permalink
fix: enabled vulkan sdk for ubuntu 20.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart-Steensma committed Jan 30, 2024
1 parent 1140c9d commit 540bb2c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 25 deletions.
24 changes: 0 additions & 24 deletions scripts/build-vulkan

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/helpers/apt/enable-kisak-mesa-repo
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

set -euo pipefail

# Ensure that the latest version of mesa is installed
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo apt update -y
sudo apt upgrade -y
2 changes: 1 addition & 1 deletion scripts/helpers/apt/install-project-deps
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "Installing build dependencies"
sudo apt-get install -y clang ninja-build git cmake llvm pkg-config

echo "Installing project dependencies"
"$root/scripts/build-vulkan" || true # only ubuntu 20.04
"$root/scripts/helpers/apt/install-vulkan"
sudo apt-get install -y libboost-all-dev libspdlog-dev

echo "Installing Qt dependencies"
Expand Down
48 changes: 48 additions & 0 deletions scripts/helpers/apt/install-vulkan
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -euo pipefail

usage="Usage: install-vulkan
Used when running apt package manager to install vulkan sdk using a PPA
repository"

this_dir=$(dirname "$(realpath "${BASH_SOURCE:-$0}")")
"$this_dir/helpers/apt/assert"

while [[ $# -gt 0 ]]; do
case "$1" in
-h | --help)
echo "$usage"
exit 0
;;
esac
done

# For ubuntu 22.04
jammy() {
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt -y install vulkan-sdk
}

# For ubuntu 20.04
focal() {
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-focal.list http://packages.lunarg.com/vulkan/lunarg-vulkan-focal.list
sudo apt update
sudo apt -y install vulkan-sdk
}

case "$(lsb_release -cs)" in
jammy)
jammy
;;
focal)
focal
;;
*)
echo "Only Ubuntu Focal (20.04) and Jammy (22.04) are supported. Aborting." >/dev/stderr
exit 1
;;
esac

0 comments on commit 540bb2c

Please sign in to comment.