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
|
|
|
"ninja-build"
|
2020-10-17 00:09:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Packages - PCSX2
|
|
|
|
declare -a PCSX2_PACKAGES=(
|
|
|
|
"libaio-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libbz2-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"libegl1-mesa-dev"
|
|
|
|
"libgdk-pixbuf2.0-dev"
|
|
|
|
"libgl1-mesa-dev"
|
|
|
|
"libgtk-3-dev"
|
|
|
|
"libharfbuzz-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libjpeg-dev"
|
2020-10-17 00:09:15 +00:00
|
|
|
"liblzma-dev"
|
|
|
|
"libpcap0.8-dev"
|
2021-07-13 14:52:58 +00:00
|
|
|
"libpng-dev"
|
2020-11-02 20:53:36 +00:00
|
|
|
"libpulse-dev"
|
2021-07-14 20:54:29 +00:00
|
|
|
"librsvg2-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"
|
|
|
|
"libwxgtk3.0-gtk3-dev"
|
|
|
|
"libx11-xcb-dev"
|
|
|
|
"libxml2-dev"
|
2021-07-14 20:54:29 +00:00
|
|
|
"pkg-config"
|
2020-10-17 00:09:15 +00:00
|
|
|
"portaudio19-dev"
|
|
|
|
"zlib1g-dev"
|
|
|
|
)
|
|
|
|
|
2021-08-19 04:29:19 +00:00
|
|
|
if [ "${COMPILER}" = "gcc" ]; then
|
2021-09-04 21:23:47 +00:00
|
|
|
BUILD_PACKAGES+=("g++-10-multilib")
|
2021-08-19 04:29:19 +00:00
|
|
|
else
|
|
|
|
BUILD_PACKAGES+=("clang")
|
2021-09-04 21:23:47 +00:00
|
|
|
PCSX2_PACKAGES+=("libstdc++-10-dev")
|
2021-08-19 04:29:19 +00:00
|
|
|
fi
|
|
|
|
|
2020-10-17 00:09:15 +00:00
|
|
|
# - 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
|
2021-08-19 04:58:20 +00:00
|
|
|
echo "Will install the following packages for building - ${BUILD_PACKAGES[*]}"
|
2021-07-13 14:52:58 +00:00
|
|
|
#sudo apt remove gcc-9 g++-9
|
2021-08-19 04:58:20 +00:00
|
|
|
sudo apt-get -y install "${BUILD_PACKAGES[@]}"
|
2020-10-17 00:09:15 +00:00
|
|
|
|
|
|
|
# Install packages needed by pcsx2
|
2021-08-19 04:58:20 +00:00
|
|
|
PCSX2_PACKAGES=("${PCSX2_PACKAGES[@]/%/"${ARCH}"}")
|
|
|
|
echo "Will install the following packages for pcsx2 - ${PCSX2_PACKAGES[*]}"
|
|
|
|
sudo apt-get -y install "${PCSX2_PACKAGES[@]}"
|
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
|