From c9194895e0e09fafbc9a3585c9ff48206dcc3e3f Mon Sep 17 00:00:00 2001 From: dcvz Date: Wed, 22 May 2024 12:05:58 +0200 Subject: [PATCH] Use prebuild image --- .devcontainer/Dockerfile | 12 -------- .devcontainer/devcontainer.json | 4 +-- .devcontainer/install-sdl2.sh | 54 --------------------------------- 3 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/install-sdl2.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 2f702a6..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,12 +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 - -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 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 060faf2..7e7a34b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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": {}, diff --git a/.devcontainer/install-sdl2.sh b/.devcontainer/install-sdl2.sh deleted file mode 100644 index a693b1d..0000000 --- a/.devcontainer/install-sdl2.sh +++ /dev/null @@ -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