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