mirror of
https://git.eden-emu.dev/eden-emu/docker
synced 2026-02-04 02:41:22 +01:00
Initial commit
This commit is contained in:
66
Dockerfile.android
Normal file
66
Dockerfile.android
Normal file
@@ -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 <<EOF /build.sh
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
cp -r /source/. /workspace
|
||||
cd /workspace/src/android
|
||||
E_UID=\$(stat -c '%u' /source)
|
||||
E_GID=\$(stat -c '%g' /source)
|
||||
BRANCH=\$(git rev-parse --abbrev-ref HEAD)
|
||||
DATE=\$(date +%Y%m%d%H%M%S)
|
||||
SHORT_SHA=\$(git rev-parse --short HEAD)
|
||||
ID=\${DATE}-\${BRANCH}-\${SHORT_SHA}
|
||||
T=\${1}
|
||||
if [[ "\${1}" == "optimized" ]]; then
|
||||
T="genshinSpoof"
|
||||
fi
|
||||
./gradlew assemble\${T^}Release 2>&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"]
|
||||
38
Dockerfile.linux
Normal file
38
Dockerfile.linux
Normal file
@@ -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 <<EOF /build.sh
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
cp -r /source/. /workspace
|
||||
cd /workspace
|
||||
E_UID=\$(stat -c '%u' /source)
|
||||
E_GID=\$(stat -c '%g' /source)
|
||||
BRANCH=\$(git rev-parse --abbrev-ref HEAD)
|
||||
DATE=\$(date +%Y%m%d%H%M%S)
|
||||
SHORT_SHA=\$(git rev-parse --short HEAD)
|
||||
ID=\${DATE}-\${BRANCH}-\${SHORT_SHA}
|
||||
.ci/linux/build.sh \${1} | tee /output/eden-\${1}-\${ID}.log
|
||||
.ci/linux/package.sh \${1} | tee -a /output/eden-\${1}-\${ID}.log
|
||||
chmod +x Eden-*.AppImage
|
||||
cp Eden-*.AppImage /output/eden-\${1}-\${ID}.AppImage
|
||||
chown \${E_UID}:\${E_GID} /output/*\${ID}*
|
||||
EOF
|
||||
RUN chmod +x /build.sh
|
||||
|
||||
ENTRYPOINT ["/build.sh"]
|
||||
CMD ["steamdeck"]
|
||||
33
README.md
Executable file
33
README.md
Executable file
@@ -0,0 +1,33 @@
|
||||
# Build Eden for Android and Linux:
|
||||
|
||||
```shell
|
||||
./build.sh <platform> <target>
|
||||
```
|
||||
|
||||
<platform> is either 'android' or 'linux'
|
||||
|
||||
<target> 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-<platform>-builder
|
||||
```
|
||||
13
build.sh
Executable file
13
build.sh
Executable file
@@ -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}"
|
||||
Reference in New Issue
Block a user