xref: /freebsd/contrib/libfido2/.actions/setup_clang (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
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