about summary refs log tree commit diff homepage
path: root/scripts/build/p-llvm-linux-ubuntu.inc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/p-llvm-linux-ubuntu.inc')
-rw-r--r--scripts/build/p-llvm-linux-ubuntu.inc43
1 files changed, 25 insertions, 18 deletions
diff --git a/scripts/build/p-llvm-linux-ubuntu.inc b/scripts/build/p-llvm-linux-ubuntu.inc
index 1474d1da..83e02d8e 100644
--- a/scripts/build/p-llvm-linux-ubuntu.inc
+++ b/scripts/build/p-llvm-linux-ubuntu.inc
@@ -1,26 +1,33 @@
 # Build dependencies
-install_build_dependencies_llvm() { 
-  apt update -y
-
-  # Add Kitware's certificate for CMake
-  dependencies=(
-    apt-transport-https
-    ca-certificates
-    gnupg
-    lsb-release
-    software-properties-common
-    wget
-  )
+install_build_dependencies_llvm() {
+  source "${DIR}/common-functions"
 
-  apt -y --no-install-recommends install "${dependencies[@]}"
-  wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \
-      | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null
+  # Check if the Ubuntu version is an LTS version - otherwise no cmake version available
+  if grep -q LTS /etc/os-release; then
+      with_sudo apt update -y
+      # Add Kitware's certificate for CMake
+      dependencies=(
+        apt-transport-https
+        ca-certificates
+        gnupg
+        lsb-release
+        software-properties-common
+        wget
+      )
+
+      with_sudo apt -y --no-install-recommends install "${dependencies[@]}"
+      wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \
+          | gpg --dearmor - | with_sudo tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null
+
+      # Add CMake repository
+      codename="$(lsb_release --codename --short)"
+      with_sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${codename} main"
+  fi
 
-  # Add CMake repository
-  codename="$(lsb_release --codename --short)"
-  apt-add-repository "deb https://apt.kitware.com/ubuntu/ ${codename} main"
+  with_sudo apt update -y
 
   dependencies=(
+    ca-certificates
     build-essential
     autoconf
     automake