Use premade docker image

This commit is contained in:
dcvz 2024-05-22 11:38:57 +02:00
parent cdd69890a4
commit f91126323a
4 changed files with 1 additions and 119 deletions

View file

@ -1,18 +0,0 @@
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-22.04
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 file
ARG INSTALL_SDL2_VERSION_FROM_SOURCE="2.26.1"
COPY ./install-sdl2.sh /tmp/
RUN if [ "${INSTALL_SDL2_VERSION_FROM_SOURCE}" != "none" ]; then \
chmod +x /tmp/install-sdl2.sh && /tmp/install-sdl2.sh ${INSTALL_SDL2_VERSION_FROM_SOURCE}; \
fi \
&& rm -f /tmp/install-sdl2.sh
COPY ./install-n64recomp.sh /tmp/
RUN chmod +x /tmp/install-n64recomp.sh && /tmp/install-n64recomp.sh
RUN rm -f /tmp/install-n64recomp.sh
RUN curl -Ssf https://pkgx.sh | sh

View file

@ -1,8 +1,6 @@
{
"name": "Zelda64Recomp",
"build": {
"dockerfile": "Dockerfile",
},
"image": "dcvz/n64recomp:0.0.1-ubuntu-22.04",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

View file

@ -1,44 +0,0 @@
#!/usr/bin/env bash
set -e
# Cleanup temporary directory and associated files when exiting the script.
cleanup() {
EXIT_CODE=$?
set +e
if [[ -n "${TMP_DIR}" ]]; then
echo "Executing cleanup of tmp files"
rm -Rf "${TMP_DIR}"
fi
exit $EXIT_CODE
}
trap cleanup EXIT
echo "Installing N64Recomp..."
architecture=$(dpkg --print-architecture)
case "${architecture}" in
arm64)
ARCH=aarch64 ;;
amd64)
ARCH=x86_64 ;;
*)
echo "Unsupported architecture ${architecture}."
exit 1
;;
esac
TMP_DIR=$(mktemp -d -t n64recomp-XXXXXXXXXX)
echo "${TMP_DIR}"
cd "${TMP_DIR}"
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
cd N64RecompSource
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
cmake --build cmake-build --config Release --target N64Recomp -j $(nproc)
cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc)
sudo cp -v cmake-build/N64Recomp /usr/local/bin/
sudo cp -v cmake-build/RSPRecomp /usr/local/bin/

View file

@ -1,54 +0,0 @@
#!/usr/bin/env bash
set -e
SDL2_VERSION=${1:-"none"}
if [ "${SDL2_VERSION}" = "none" ]; then
echo "No SDL2 version specified, skipping SDL2 installation"
exit 0
fi
# Cleanup temporary directory and associated files when exiting the script.
cleanup() {
EXIT_CODE=$?
set +e
if [[ -n "${TMP_DIR}" ]]; then
echo "Executing cleanup of tmp files"
rm -Rf "${TMP_DIR}"
fi
exit $EXIT_CODE
}
trap cleanup EXIT
echo "Installing CMake..."
architecture=$(dpkg --print-architecture)
case "${architecture}" in
arm64)
ARCH=aarch64 ;;
amd64)
ARCH=x86_64 ;;
*)
echo "Unsupported architecture ${architecture}."
exit 1
;;
esac
TMP_DIR=$(mktemp -d -t sdl2-XXXXXXXXXX)
echo "${TMP_DIR}"
cd "${TMP_DIR}"
wget https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz
tar -xzf SDL2-${SDL2_VERSION}.tar.gz
cd SDL2-${SDL2_VERSION}
./configure
make -j 10
sudo make install
if [ "$(uname -m)" == "x86_64" ]; then
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
else
sudo cp -av /usr/local/lib/libSDL* /usr/lib/aarch64-linux-gnu/
fi