-
Notifications
You must be signed in to change notification settings - Fork 775
Expand file tree
/
Copy pathinstall_ubuntu_dependencies.sh
More file actions
executable file
·68 lines (55 loc) · 2.59 KB
/
install_ubuntu_dependencies.sh
File metadata and controls
executable file
·68 lines (55 loc) · 2.59 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# Shim code to get local docker/ec2 instances bootstrapped like a CodeBuild instance.
# Not actually used by CodeBuild.
# This script is now targeting Ubuntu 24 not Ubuntu 18.
source codebuild/bin/s2n_setup_env.sh
set -e
github_apt(){
apt update -y
apt install -y gh
}
get_rust() {
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
rustup default nightly
}
base_packages() {
echo "Installing repositories and base packages"
apt update -y
apt install -y software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test -y
add-apt-repository ppa:longsleep/golang-backports -y
apt-get update -o Acquire::CompressionTypes::Order::=gz
DEPENDENCIES="unzip make indent iproute2 kwstyle libssl-dev net-tools tcpdump valgrind lcov m4 nettle-dev nettle-bin pkg-config psmisc gcc g++ zlib1g-dev python3-pip python3-testresources llvm libclang-dev curl shellcheck git tox cmake libtool ninja-build golang-go quilt jq apache2"
if [[ -n "${GCC_VERSION:-}" ]] && [[ "${GCC_VERSION:-}" != "NONE" ]]; then
DEPENDENCIES+=" gcc-$GCC_VERSION g++-$GCC_VERSION";
fi
apt-get -y install --no-install-recommends ${DEPENDENCIES}
}
base_packages
github_apt
get_rust
# If prlimit is not on our current PATH, download and compile prlimit manually. s2n needs prlimit to memlock pages
if ! type prlimit > /dev/null && [[ ! -d "$PRLIMIT_INSTALL_DIR" ]]; then
mkdir -p "$PRLIMIT_INSTALL_DIR";
codebuild/bin/install_prlimit.sh "$(mktemp -d)" "$PRLIMIT_INSTALL_DIR";
fi
if [[ "$TESTS" == "ctverif" || "$TESTS" == "ALL" ]] && [[ ! -d "$CTVERIF_INSTALL_DIR" ]]; then
mkdir -p "$CTVERIF_INSTALL_DIR" && codebuild/bin/install_ctverif.sh "$CTVERIF_INSTALL_DIR" > /dev/null ; fi
if [[ "$TESTS" == "sidetrail" || "$TESTS" == "ALL" ]] ; then
codebuild/bin/install_sidetrail_dependencies.sh ; fi
if [[ "$TESTS" == "sidetrail" || "$TESTS" == "ALL" ]] && [[ ! -d "$SIDETRAIL_INSTALL_DIR" ]]; then
mkdir -p "$SIDETRAIL_INSTALL_DIR" && codebuild/bin/install_sidetrail.sh "$SIDETRAIL_INSTALL_DIR" > /dev/null ; fi