1#!/bin/sh -eu
2
3# Copyright (c) 2022 Yubico AB. All rights reserved.
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file.
6# SPDX-License-Identifier: BSD-2-Clause
7
8CC="$1"
9APT="http://apt.llvm.org"
10CODENAME="$(lsb_release -cs)"
11VERSION="${CC#*-}"
12apt-get install -q -y software-properties-common
13apt-key add ./.actions/llvm.gpg
14add-apt-repository \
15    "deb ${APT}/${CODENAME}/ llvm-toolchain-${CODENAME}-${VERSION} main"
16apt-get update -q
17apt-get install -q -y "${CC}" "clang-tools-${VERSION}"
18