From 47c7104e45116874e677591d53bb3d70528c5e9e Mon Sep 17 00:00:00 2001 From: Louis <contact@louiscap.co> Date: Sun, 22 Dec 2024 18:54:35 +0000 Subject: [PATCH] Include rust, emscripten, wasm toolchain --- Dockerfile | 17 ++++++++++++++--- README.md | 5 ++++- commands/emsdk_install.sh | 11 +++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100755 commands/emsdk_install.sh diff --git a/Dockerfile b/Dockerfile index e2018bd..b80a420 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM debian:12.8-slim +FROM cr.weirdboi.dev/base/rust:1-82-node-22 ARG PLATFORM="linux.x86_64" ARG GODOT_VERSION="4.3-stable" ARG BUTLER_VERSION="15.12.0" RUN apt-get update \ - && apt-get install -y wget zip unzip libfontconfig1 \ + && apt-get install -y git libfontconfig1 \ && rm -rf /var/lib/apt/lists/* COPY commands/godot_build.sh /usr/bin/godot_build @@ -16,6 +16,17 @@ COPY commands/godot_project_title.sh /usr/bin/godot_project_title COPY commands/butler_install.sh /usr/bin/butler_install COPY commands/butler_upload.sh /usr/bin/butler_upload +COPY commands/emsdk_install.sh /usr/bin/emsdk_install + +RUN rustup component add rust-src --toolchain nightly && \ + rustup target add wasm32-unknown-emscripten --toolchain nightly + RUN chmod +x /usr/bin/godot_* /usr/bin/butler_* RUN godot_install $GODOT_VERSION $PLATFORM -RUN butler_install $BUTLER_VERSION \ No newline at end of file +RUN butler_install $BUTLER_VERSION + +ENV EMSDK=/usr/bin/emsdk +RUN emsdk_install "${EMSDK}" + +ENV EMSDK_NODE="${EMSDK}/node/20.18.0_64bit/bin/node" +ENV PATH="${EMSDK}:${EMSDK}/upstream/emscripten:${PATH}" \ No newline at end of file diff --git a/README.md b/README.md index d64ce7d..1d14569 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ ## Godot Builder -A base debian image, configured with tools and helpers required to build godot games in CI +A base debian image, configured with tools and helpers required to build godot games in CI. + +Additionally includes all tools & dependencies to build web content with Node, and Rust extensions +with Rust & emscripten ### Commands diff --git a/commands/emsdk_install.sh b/commands/emsdk_install.sh new file mode 100755 index 0000000..8d036cc --- /dev/null +++ b/commands/emsdk_install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +INSTALL_DIR="$1" +FULL_DIR="$INSTALL_DIR/emsdk" + +mkdir -p "$FULL_DIR" +git clone https://github.com/emscripten-core/emsdk.git "$FULL_DIR" +cd "$FULL_DIR" +"$FULL_DIR/emsdk" install 3.1.62 +"$FULL_DIR/emsdk" activate 3.1.62 +source "$FULL_DIR/emsdk.sh" \ No newline at end of file -- GitLab