2020-10-17 00:09:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Packages - Build Environment
|
|
|
|
declare -a BUILD_PACKAGES=(
|
|
|
|
"ccache"
|
|
|
|
"cmake"
|
2021-07-13 14:52:58 +00:00
|
|
|
"g++-8-multilib"
|
|
|
|
"ninja-build"
|
2020-10-17 00:09:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
declare -a GCC_PACKAGES=(
|
|
|
|
# Nothing Unique Needed
|
|
|
|
)
|
|
|
|
|
|
|
|
declare -a CLANG_PACKAGES=(
|
|
|
|
"clang-format"
|
|
|
|
"clang-tidy"
|
|
|
|
"clang-tools"
|
|
|
|
"clang"
|
2021-07-13 14:52:58 +00:00
|
|
|
"clangd-10"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libc++-dev"
|
|
|
|
"libc++1"
|
|
|
|
"libc++abi-dev"
|
|
|
|
"libc++abi1"
|
|
|
|
"libclang-dev"
|
|
|
|
"libclang1"
|
2021-07-13 14:52:58 +00:00
|
|
|
"liblldb-10-dev"
|
|
|
|
"libllvm-10-ocaml-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libomp-dev"
|
|
|
|
"libomp5"
|
|
|
|
"lld"
|
|
|
|
"lldb"
|
|
|
|
"llvm-dev"
|
|
|
|
"llvm-runtime"
|
|
|
|
"llvm"
|
2021-07-13 14:52:58 +00:00
|
|
|
"python3-clang-10"
|
2020-10-17 00:09:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Packages - PCSX2
|
|
|
|
declare -a PCSX2_PACKAGES=(
|
2021-07-13 14:52:58 +00:00
|
|
|
"curl"
|
|
|
|
"fuse"
|
|
|
|
"gettext"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libaio-dev"
|
|
|
|
"libasound2-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libatk1.0-dev"
|
|
|
|
"libatk-bridge2.0-dev"
|
|
|
|
"libbz2-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libcairo2-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libcggl"
|
|
|
|
"libdbus-1-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libegl1-mesa-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libfontconfig1-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libgdk-pixbuf2.0-dev"
|
|
|
|
"libgirepository-1.0-1"
|
|
|
|
"libgl-dev"
|
|
|
|
"libgl1-mesa-dev"
|
|
|
|
"libgl1-mesa-dri"
|
|
|
|
"libgl1"
|
|
|
|
"libgles2-mesa-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libglew-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libglib2.0-dev"
|
|
|
|
"libglu1-mesa-dev"
|
|
|
|
"libglu1-mesa"
|
|
|
|
"libglvnd-dev"
|
|
|
|
"libglx-mesa0"
|
|
|
|
"libglx0"
|
|
|
|
"libgtk-3-dev"
|
|
|
|
"libgtk2.0-dev"
|
|
|
|
"libharfbuzz-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libibus-1.0-dev"
|
|
|
|
"libjack-jackd2-dev"
|
|
|
|
"libjpeg-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libllvm10"
|
|
|
|
"liblzma-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"liblzma5"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libpango1.0-dev"
|
|
|
|
"libpcap0.8-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libpng-dev"
|
|
|
|
"libportaudiocpp0"
|
2020-11-02 20:53:36 +00:00
|
|
|
"libpulse-dev"
|
2021-07-14 20:54:29 +00:00
|
|
|
"librsvg2-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libsdl1.2-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libsdl2-dev"
|
2020-11-02 20:53:36 +00:00
|
|
|
"libsamplerate0-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libsoundtouch-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libwxgtk3.0-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libwxgtk3.0-gtk3-0v5"
|
|
|
|
"libwxgtk3.0-gtk3-dev"
|
|
|
|
"libx11-xcb-dev"
|
|
|
|
"libxext-dev"
|
|
|
|
"libxft-dev"
|
|
|
|
"libxml2-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"nvidia-cg-toolkit"
|
2021-07-14 20:54:29 +00:00
|
|
|
"pkg-config"
|
2020-10-17 00:09:15 +00:00
|
|
|
"portaudio19-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"python"
|
2020-10-17 00:09:15 +00:00
|
|
|
"zlib1g-dev"
|
|
|
|
)
|
|
|
|
|
|
|
|
# - https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
|
|
|
|
ARCH=""
|
|
|
|
echo "${PLATFORM}"
|
|
|
|
if [ "${PLATFORM}" == "x86" ]; then
|
|
|
|
ARCH=":i386"
|
|
|
|
sudo dpkg --add-architecture i386
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo apt-get -qq update
|
|
|
|
|
|
|
|
# Install packages needed for building
|
|
|
|
BUILD_PACKAGE_STR=""
|
|
|
|
for i in "${BUILD_PACKAGES[@]}"; do
|
|
|
|
BUILD_PACKAGE_STR="${BUILD_PACKAGE_STR} ${i}"
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "${COMPILER}" = "gcc" ]; then
|
|
|
|
for i in "${GCC_PACKAGES[@]}"; do
|
|
|
|
BUILD_PACKAGE_STR="${BUILD_PACKAGE_STR} ${i}"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
for i in "${CLANG_PACKAGES[@]}"; do
|
|
|
|
BUILD_PACKAGE_STR="${BUILD_PACKAGE_STR} ${i}"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Will install the following packages for building - ${BUILD_PACKAGE_STR}"
|
2021-07-13 14:52:58 +00:00
|
|
|
#sudo apt remove gcc-9 g++-9
|
2020-10-17 00:09:15 +00:00
|
|
|
sudo apt-get -y install ${BUILD_PACKAGE_STR}
|
|
|
|
|
2021-07-13 14:52:58 +00:00
|
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
|
|
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 10
|
2020-10-17 00:09:15 +00:00
|
|
|
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
|
|
|
|
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
|
|
|
|
|
|
|
|
# Install packages needed by pcsx2
|
|
|
|
PCSX2_PACKAGES_STR=""
|
|
|
|
for i in "${PCSX2_PACKAGES[@]}"; do
|
|
|
|
PCSX2_PACKAGES_STR="${PCSX2_PACKAGES_STR} ${i}${ARCH}"
|
|
|
|
done
|
2020-11-06 12:11:31 +00:00
|
|
|
if [ "${PLATFORM}" == "x86" ]; then
|
|
|
|
echo "Installing workaround attempt"
|
|
|
|
sudo apt-get -y install libgcc-s1:i386
|
|
|
|
fi
|
2020-10-17 00:09:15 +00:00
|
|
|
echo "Will install the following packages for pcsx2 - ${PCSX2_PACKAGES_STR}"
|
|
|
|
sudo apt-get -y install ${PCSX2_PACKAGES_STR}
|
2021-07-13 14:52:58 +00:00
|
|
|
|
|
|
|
cd /tmp
|
|
|
|
curl -sSfLO https://github.com/NixOS/patchelf/releases/download/0.12/patchelf-0.12.tar.bz2
|
|
|
|
tar xvf patchelf-0.12.tar.bz2
|
|
|
|
cd patchelf-0.12*/
|
|
|
|
./configure
|
|
|
|
make && sudo make install
|