mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
rewrite ubuntu clang acquisition function
This commit is contained in:
parent
7c87795057
commit
f2cb32bf2c
1 changed files with 15 additions and 15 deletions
30
sh/compile
30
sh/compile
|
@ -24,24 +24,24 @@ setup_clang_ubuntu() { ### @-
|
||||||
|
|
||||||
local site="http://apt.llvm.org"
|
local site="http://apt.llvm.org"
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local version=12 # NOTE: no longer decimal-based
|
local version=18 # NOTE: no longer decimal-based
|
||||||
local priority=$(( version * 100 ))
|
local priority=$(( version * 100 ))
|
||||||
[ -n "$name" ] || name="$(lsb_release -c | cut -f2)"
|
[ -n "$name" ] || name="$(lsb_release -c | cut -f2)"
|
||||||
# TODO: use https? this is sketchy
|
# TODO: use https? this is sketchy
|
||||||
echo wget -O - "$site/llvm-snapshot.gpg.key" \| apt-key add -
|
echo wget -O- "$site/llvm-snapshot.gpg.key" \| apt-key add -
|
||||||
echo echo -n \""\
|
printf %s\\n "echo > \"/etc/apt/sources.list.d/llvm-toolchain-$name.list\" \\" \
|
||||||
deb $site/$name/ llvm-toolchain-$name main\n\
|
'"' \
|
||||||
# deb-src $site/$name/ llvm-toolchain-$name main\n\
|
"deb $site/$name/ llvm-toolchain-$name main" \
|
||||||
# $version\n\
|
"# deb-src $site/$name/ llvm-toolchain-$name main" \
|
||||||
deb $site/$name/ llvm-toolchain-$name-$version main\n\
|
"# $version" \
|
||||||
# deb-src $site/$name/ llvm-toolchain-$name-$version main\n\
|
"deb $site/$name/ llvm-toolchain-$name-$version main" \
|
||||||
"\" \> "/etc/apt/sources.list.d/llvm-toolchain-$name.list"
|
"# deb-src $site/$name/ llvm-toolchain-$name-$version main\""
|
||||||
echo apt-get update
|
echo export DEBIAN_FRONTEND=noninteractive NEEDRESTART_SUSPEND=1
|
||||||
echo apt-get install clang-$version
|
echo apt-get update -y \&\& apt-get install -y clang-$version lld-$version
|
||||||
echo apt-get install lld-$version
|
#echo needrestart -ra
|
||||||
echo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$version $priority
|
for p in clang clang++ llvm-symbolizer; do
|
||||||
echo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$version $priority
|
echo update-alternatives --install /usr/bin/$p $p /usr/bin/$p-$version $priority
|
||||||
echo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-$version $priority
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
compile() { ### @-
|
compile() { ### @-
|
||||||
|
|
Loading…
Add table
Reference in a new issue