diff --git a/scripts/build/build_node/Platform/Linux/install-awscli.sh b/scripts/build/build_node/Platform/Linux/install-awscli.sh new file mode 100644 index 0000000000..c9addedc82 --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/install-awscli.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +# This script must be run as root +if [ "`whoami`" != "root" ] +then + echo "This script must be run as root (sudo)" + exit 1 +fi + +# +# Install curl if its not installed +# +curl --version >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "Installing curl" + apt-get install curl -y +fi + +# +# Setup AWS CLI if needed +# +aws --version >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo Setting up AWS CLI + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + ./aws/install + rm -rf ./aws +else + AWS_CLI_VERSION=`aws --version | awk '{print $1}' | awk -F/ '{print $2}'` + echo AWS CLI \(version $AWS_CLI_VERSION\) already installed +fi + + + + diff --git a/scripts/build/build_node/Platform/Linux/install-ubuntu-build-libraries.sh b/scripts/build/build_node/Platform/Linux/install-ubuntu-build-libraries.sh new file mode 100644 index 0000000000..7b78a53802 --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/install-ubuntu-build-libraries.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +# This script must be run as root +if [ "`whoami`" != "root" ] +then + echo "This script must be run as root (sudo)" + exit 1 +fi + +# +# Make sure we are installing on a supported ubuntu distro +# +lsb_release -c >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo This script is only supported on Ubuntu Distros + exit 1 +fi + +UBUNTU_DISTRO="`lsb_release -c | awk '{print $2}'`" +if [ "$UBUNTU_DISTRO" == "bionic" ] +then + echo "Setup for Ubuntu 18.04 LTS ($UBUNTU_DISTRO)" +elif [ "$UBUNTU_DISTRO" == "focal" ] +then + echo "Setup for Ubuntu 20.04 LTS ($UBUNTU_DISTRO)" +else + echo "Unsupported version of Ubuntu $UBUNTU_DISTRO" + exit 1 +fi + +# +# Install curl if its not installed +# +curl --version >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "Installing curl" + apt-get install curl -y +fi + + +# +# If the linux distro is 20.04 (focal), we need libffi.so.6, which is not part of the focal distro. We +# will install it from the bionic distro manually into focal. This is needed since Ubuntu 20.04 supports +# python 3.8 out of the box, but we are using 3.7 +# +LIBFFI6_COUNT=`apt list --installed 2>/dev/null | grep libffi6 | wc -l` +if [ "$UBUNTU_DISTRO" == "focal" ] && [ $LIBFFI6_COUNT -eq 0 ] +then + echo "Installing libffi for Ubuntu 20.04" + + pushd /tmp >/dev/null + + LIBFFI_PACKAGE_NAME=libffi6_3.2.1-8_amd64.deb + LIBFFI_PACKAGE_URL=http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/ + + curl --location $LIBFFI_PACKAGE_URL/$LIBFFI_PACKAGE_NAME -o $LIBFFI_PACKAGE_NAME + if [ $? -ne 0 ] + then + echo Unable to download $LIBFFI_PACKAGE_URL/$LIBFFI_PACKAGE_NAME + popd + exit 1 + fi + + apt install ./$LIBFFI_PACKAGE_NAME -y + if [ $? -ne 0 ] + then + echo Unable to install $LIBFFI_PACKAGE_NAME + rm -f ./$LIBFFI_PACKAGE_NAME + popd + exit 1 + fi + + rm -f ./$LIBFFI_PACKAGE_NAME + popd + echo "libffi.so.6 installed" +fi + +# Install the required build packages +apt-get install clang-6.0 -y # For the compiler and its dependencies +apt-get install libglu1-mesa-dev -y # For Qt (GL dependency) + +# The following packages resolves a runtime error with Qt Plugins +apt-get install libxcb-xinerama0 -y # For Qt plugins at runtime +apt-get install libxcb-xinput0 -y # For Qt plugins at runtime + +apt-get install libcurl4-openssl-dev -y # For HttpRequestor +apt-get install libsdl2-dev -y # For WWise + +apt-get install libz-dev -y +apt-get install mesa-common-dev -y + +echo Build Libraries Setup Complete diff --git a/scripts/build/build_node/Platform/Linux/install-ubuntu-build-tools.sh b/scripts/build/build_node/Platform/Linux/install-ubuntu-build-tools.sh new file mode 100644 index 0000000000..eb9229d90b --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/install-ubuntu-build-tools.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +# This script must be run as root +if [ "`whoami`" != "root" ] +then + echo "This script must be run as root (sudo)" + exit 1 +fi + +# +# Make sure we are installing on a supported ubuntu distro +# +lsb_release -c >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo This script is only supported on Ubuntu Distros + exit 1 +fi + +UBUNTU_DISTRO="`lsb_release -c | awk '{print $2}'`" +if [ "$UBUNTU_DISTRO" == "bionic" ] +then + echo "Setup for Ubuntu 18.04 LTS ($UBUNTU_DISTRO)" +elif [ "$UBUNTU_DISTRO" == "focal" ] +then + echo "Setup for Ubuntu 20.04 LTS ($UBUNTU_DISTRO)" +else + echo "Unsupported version of Ubuntu $UBUNTU_DISTRO" + exit 1 +fi + +# +# Always install the latest version of cmake (from kitware) +# +echo Installing the latest version of CMake + +# Remove any pre-existing version of cmake +apt purge --auto-remove cmake -y +wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null +CMAKE_DEB_REPO="'deb https://apt.kitware.com/ubuntu/ $UBUNTU_DISTRO main'" + +# Add the appropriate kitware repository to apt +if [ "$UBUNTU_DISTRO" == "bionic" ] +then + apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' +elif [ "$UBUNTU_DISTRO" == "focal" ] +then + apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' +fi +apt-get update + +# Install cmake +apt-get install cmake -y + + +# +# Make sure that Ninja is installed +# +echo Installing Ninja +apt-get install ninja-build -y + + +echo Build Tools Setup Complete diff --git a/scripts/build/build_node/Platform/Linux/install-ubuntu-git.sh b/scripts/build/build_node/Platform/Linux/install-ubuntu-git.sh new file mode 100644 index 0000000000..a1c2923c13 --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/install-ubuntu-git.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +# This script must be run as root +if [ "`whoami`" != "root" ] +then + echo "This script must be run as root (sudo)" + exit 1 +fi + +# +# Make sure we are installing on a supported ubuntu distro +# +lsb_release -c >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo This script is only supported on Ubuntu Distros + exit 1 +fi + +UBUNTU_DISTRO="`lsb_release -c | awk '{print $2}'`" +if [ "$UBUNTU_DISTRO" == "bionic" ] +then + echo "Setup for Ubuntu 18.04 LTS ($UBUNTU_DISTRO)" +elif [ "$UBUNTU_DISTRO" == "focal" ] +then + echo "Setup for Ubuntu 20.04 LTS ($UBUNTU_DISTRO)" +else + echo "Unsupported version of Ubuntu $UBUNTU_DISTRO" + exit 1 +fi + +# +# Setup and get the latest from git if necessary +# +git --version > /dev/null 2>&1 +if [ $? -ne 0 ] +then + echo Setting up latest version of GIT + add-apt-repository ppa:git-core/ppa -y + apt-get update + apt-get install git -y +else + GIT_VERSION=`git --version | awk '{print $3}'` + echo Git $GIT_VERSION already Installed. Skipping Git installation +fi + +# +# Setup Git-LFS if needed +# +GIT_LFS_PACKAGE_COUNT=`apt list --installed 2>/dev/null | grep git-lfs/ | wc -l` +if [ $GIT_LFS_PACKAGE_COUNT -eq 0 ] +then + echo Setting up Git-LFS + pushd /tmp + wget https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh -o script.deb.sh + rm script.deb.sh + mv script.deb.sh.1 script.deb.sh + chmod +x script.deb.sh + ./script.deb.sh + sudo apt-get install git-lfs -y + popd +else + echo Git LFS already installed. Skipping Git-LFS installation +fi + +# Setup GCM if needed +git-credential-manager-core --version > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Download and setup Git Credential Manager + GCM_PACKAGE_NAME=gcmcore-linux_amd64.2.0.394.50751.deb + GCM_PACKAGE_URL=https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/v2.0.394-beta + + echo Installing Git Credential Manager \($GCM_PACKAGE_NAME\) + + pushd /tmp > /dev/null + curl --location $GCM_PACKAGE_URL/$GCM_PACKAGE_NAME -o $GCM_PACKAGE_NAME + dpkg -i $GCM_PACKAGE_NAME + popd +else + GCM_VERSION=`git-credential-manager-core --version` + echo Git Credential Manager \(GCM\) version $GCM_VERSION already installed. Skipping GCM installation +fi + +# Setup pass (password manager) for git-credential-manager +apt-get install pass -y +