-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathinstall.sh
More file actions
40 lines (29 loc) · 1.05 KB
/
install.sh
File metadata and controls
40 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /usr/bin/env bash
set -e
NINJA_VERSION="${VERSION:-latest}";
# Ensure we're in this feature's directory during build
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
# install global/common scripts
. ./common/install.sh;
check_packages jq wget unzip ca-certificates bash-completion;
echo "Installing ninja-build...";
if [ "${NINJA_VERSION}" = latest ]; then
find_version_from_git_tags NINJA_VERSION https://github.com/ninja-build/ninja;
fi
_name="ninja-linux";
if test "$(uname -p)" = "aarch64"; then
_name+="-aarch64";
fi
# Install Ninja
wget --no-hsts -q -O /tmp/ninja-linux.zip \
"https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/${_name}.zip";
unzip -d /usr/bin /tmp/ninja-linux.zip;
chmod +x /usr/bin/ninja;
# Install Ninja bash completions
wget --no-hsts -q -O /usr/share/bash-completion/completions/ninja \
"https://github.com/ninja-build/ninja/raw/v${NINJA_VERSION}/misc/bash-completion";
# Clean up
rm -rf /var/tmp/*;
rm -rf /var/cache/apt/*;
rm -rf /var/lib/apt/lists/*;
rm -rf /tmp/ninja-linux.zip;