From 84bb2782ba049bb5338ec1159888ccd0a2c2c430 Mon Sep 17 00:00:00 2001 From: Denis Dupeyron Date: Sun, 26 Oct 2025 22:30:26 -0600 Subject: [PATCH] Initial commit --- Dockerfile.android | 66 ++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile.linux | 38 ++++++++++++++++++++++++++ README.md | 33 +++++++++++++++++++++++ build.sh | 13 +++++++++ 4 files changed, 150 insertions(+) create mode 100644 Dockerfile.android create mode 100644 Dockerfile.linux create mode 100755 README.md create mode 100755 build.sh diff --git a/Dockerfile.android b/Dockerfile.android new file mode 100644 index 0000000..79c0149 --- /dev/null +++ b/Dockerfile.android @@ -0,0 +1,66 @@ +FROM ubuntu + +RUN apt update && apt full-upgrade -y && apt install -y \ + wget unzip git build-essential cmake ninja-build python3 python3-pip curl \ + libasound2-dev libpulse-dev libjack-jackd2-dev \ + pkg-config libssl-dev zlib1g-dev \ + glslang-tools libvulkan-dev default-jdk \ + && rm -rf /var/lib/apt/lists/* + +ENV ANDROID_SDK_ROOT=/opt/android-sdk +ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin:${ANDROID_SDK_ROOT}/platform-tools + +RUN mkdir -p ${ANDROID_SDK_ROOT} && \ + cd ${ANDROID_SDK_ROOT} && \ + SDK_ZIP=$(curl -sL https://developer.android.com/studio | \ + sed -n 's|.*href="https://dl.google.com/android/repository/\(commandlinetools-linux-[0-9]*_latest.zip\).*|\1|p') && \ + wget -q https://dl.google.com/android/repository/${SDK_ZIP} && \ + unzip ${SDK_ZIP} && \ + rm ${SDK_ZIP} && \ + mkdir -p cmdline-tools/latest && \ + mv cmdline-tools/* cmdline-tools/latest/ || true && \ + rmdir cmdline-tools/bin cmdline-tools/lib 2>/dev/null || true + +RUN yes | sdkmanager --licenses && \ + LATEST_PLATFORM=$(sdkmanager --list | grep "platforms;android-" | tail -1 | awk '{print $1}') && \ + LATEST_BUILD_TOOLS=$(sdkmanager --list | grep "build-tools;" | tail -1 | awk '{print $1}') && \ + LATEST_CMAKE=$(sdkmanager --list | grep "cmake;" | tail -1 | awk '{print $1}') && \ + LATEST_NDK=$(sdkmanager --list | grep "ndk;" | tail -1 | awk '{print $1}') && \ + sdkmanager --no_https "platform-tools" "${LATEST_PLATFORM}" "${LATEST_BUILD_TOOLS}" "${LATEST_CMAKE}" "${LATEST_NDK}" && \ + rm -rf ${ANDROID_SDK_ROOT}/system-images/* ${ANDROID_SDK_ROOT}/emulator/* ${ANDROID_SDK_ROOT}/extras/* 2>/dev/null || true + +RUN GRADLE_VERSION=$(curl -sL https://gradle.org/releases/ | \ + sed -n 's|.*https://services.gradle.org/distributions/gradle-\(8[0-9.]*\)-bin.zip.*|\1|p' | sort -V | tail -n 1) && \ + wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && \ + unzip -q gradle-${GRADLE_VERSION}-bin.zip && \ + mv gradle-${GRADLE_VERSION} /opt/gradle && \ + rm gradle-${GRADLE_VERSION}-bin.zip + +ENV PATH=${PATH}:/opt/gradle/bin + +WORKDIR /workspace +RUN mkdir -p /output + +COPY <&1 | tee /output/eden-\${1}-\${ID}.log +cp app/build/outputs/apk/\${T}/release/app-\${T}-release.apk /output/eden-\${1}-\${ID}.apk +chown \${E_UID}:\${E_GID} /output/*\${ID}* +EOF +RUN chmod +x /build.sh + +ENTRYPOINT ["/build.sh"] +CMD ["mainline"] diff --git a/Dockerfile.linux b/Dockerfile.linux new file mode 100644 index 0000000..e0c6d41 --- /dev/null +++ b/Dockerfile.linux @@ -0,0 +1,38 @@ +FROM ubuntu + +RUN apt update && apt full-upgrade -y && apt install -y \ + autoconf cmake g++ gcc git glslang-tools libglu1-mesa-dev libhidapi-dev libpulse-dev libtool \ + libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 \ + libxcb-xkb1 libxext-dev libxkbcommon-x11-0 mesa-common-dev nasm ninja-build \ + qt6-base-private-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev \ + libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev pkg-config zlib1g-dev \ + libva-dev libvdpau-dev qt6-tools-dev libzydis-dev zydis-tools libzycore-dev libvulkan-dev \ + spirv-tools spirv-headers libusb-1.0-0-dev libxbyak-dev libboost-dev libboost-fiber-dev \ + libboost-context-dev libsdl2-dev libopus-dev libasound2t64 vulkan-utility-libraries-dev \ + qt6-multimedia-dev wget xvfb zsync && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace +RUN mkdir -p /output + +COPY < +``` + + is either 'android' or 'linux' + + is either 'mainline', 'optimized', or 'legacy' for Android, and any from +'.ci/linux/build.sh' for Linux (.e.g., 'amd64', 'steamdeck', 'rog-ally', etc...) + +Example: +```shell +./build.sh android optimized +``` + +This requires Docker. + +Output artifacts, .apk or .AppImage, and logs, will end up in this directory. Their names contain +target, build date/time, branch, and short commit SHA for easy reference. + +No hand-holding (yet), so if you typo stuff or wrongly capitalize it, things will break. + +The Eden repository must be cloned at the same level as this script and called 'eden'. Make sure +to switch to the branch you want to build before you run this script. + +It will be copied inside the container, so no changes will be made to it. If you keep your clone +clean, then your builds will always be from a clean slate. + +If you want to refresh or rebuild a build image, then just delete it: +```shell +docker rmi eden--builder +``` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..e6e1c2f --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -euo pipefail + +HERE=$(dirname "$(realpath "${0}")") +IMAGE="eden-${1}-builder" + +if [[ "$(docker images | grep "^${IMAGE} ")" == "" ]]; then + docker pull ubuntu + docker build --no-cache -t "${IMAGE}" -f "${HERE}/Dockerfile.${1}" "${HERE}" +fi + +docker run --rm -v "${HERE}/eden":/source -v "${HERE}":/output "${IMAGE}" "${2}"