Skip to content

Commit

Permalink
Added abuncha stuff, Working towards a unified Dockerfile set for dep…
Browse files Browse the repository at this point in the history
…loying, since Github is deprecating 20.04 of ubuntu.
  • Loading branch information
Bioblaze committed Dec 8, 2024
1 parent e01368f commit 3c357b7
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 18 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ jobs:
- name: Ubuntu Base Dockerfile
file: ./cicd/ubuntu/base.Dockerfile
tag: base
context: cicd/ubuntu/
- name: Ubuntu Linux Dockerfile (Windows/Linux/Android)
file: ./cicd/ubuntu/linux.Dockerfile
tag: linux
context: cicd/ubuntu/
- name: Ubuntu Apple Dockerfile (MacOS/iOS)
file: ./cicd/ubuntu/apple.Dockerfile
tag: apple
context: cicd/ubuntu/
# - name: Web Dockerfile
# file: ./images/web.Dockerfile
# tag: web
Expand Down Expand Up @@ -49,6 +58,6 @@ jobs:
uses: docker/build-push-action@v6
with:
file: ${{ matrix.file }}
context: cicd/ubuntu/
context: ${{ matrix.context }}
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME_BASE }}-${{ matrix.tag }}:latest
19 changes: 19 additions & 0 deletions cicd/ubuntu/apple.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM bioblaze/blazium-base:latest

WORKDIR /root

RUN download-apple-files

RUN download-project-deps

RUN install-llvm-mingw

RUN install-xar test

RUN setup-xcode-sdks

RUN setup-osxcross

RUN setup-ios-cross-toolchain

CMD ["/bin/bash"]
45 changes: 34 additions & 11 deletions cicd/ubuntu/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" >> /etc/apt/

RUN echo "deb http://security.ubuntu.com/ubuntu xenial-security main" >> /etc/apt/sources.list

RUN echo "deb [trusted=yes] http://security.ubuntu.com/ubuntu bionic-security main" >> /etc/apt/sources.list

RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb
Expand All @@ -57,13 +59,13 @@ RUN apt-get install -y \
speech-dispatcher \
fontconfig \
dotnet-host dotnet-sdk-8.0 \
libfontconfig-dev
libfontconfig-dev --no-remove --no-upgrade

RUN apt-get install -y --no-install-recommends clang-format clang-tidy \
clang-tools clang clangd libc++-dev libc++1 libc++abi-dev \
libc++abi1 libclang-dev libclang1 libllvm-ocaml-dev \
libomp-dev libomp5 lld llvm-dev llvm-runtime llvm python3-clang liblldb-20-dev lldb-20 \
python3-lldb-20
python3-lldb-20 --no-remove --no-upgrade

RUN apt-get install -y \
gcc-multilib g++-multilib \
Expand All @@ -75,7 +77,7 @@ RUN apt-get install -y \
libxi-dev libxi-dev:i386 \
libxrandr-dev libxrandr-dev:i386 \
libgl1-mesa-dev libgl1-mesa-dev:i386 \
libatomic-ops-dev
libatomic-ops-dev --no-remove --no-upgrade

RUN apt-get install -y \
libglu1-mesa-dev \
Expand All @@ -87,13 +89,13 @@ RUN apt-get install -y \
libstdc++6 \
libatomic1 \
libfreetype6-dev \
libssl-dev libssl1.0.0 \
libgl-dev \
liblzma-dev liblzma5 lzma-dev \
libglu-dev \
libdbus-1-dev \
libxml2-dev \
bzip2 \
libbz2-dev --no-remove --no-upgrade
RUN apt-get install -y \
libmpc-dev libmpfr-dev libgmp-dev \
libembree-dev \
libenet-dev \
Expand All @@ -112,19 +114,37 @@ RUN apt-get install -y \
libzstd-dev \
libsquish-dev \
libicu-dev \
libdispatch-dev \
libdispatch-dev --no-remove --no-upgrade
RUN apt-get install -y \
libltdl-dev libtool libltdl7 uuid-dev \
gobjc gobjc++ \
#lib32ncurses-dev lib32ncurses6 lib32ncursesw6 lib32tinfo6 lib32c-dev lib32tinfo6 libc6-i386 \
lib64ncurses-dev lib64ncurses6 lib64ncursesw6:i386 lib64tinfo6:i386 lib64c-dev:i386 libc6-amd64:i386 lib64tinfo6:i386 \
libncurses-dev openjdk-17-jdk
gobjc gobjc++ --no-remove --no-upgrade
RUN apt-get install -y \
openjdk-17-jdk --no-remove --no-upgrade
RUN apt-get install -y \
libncurses-dev --no-remove --no-upgrade


RUN apt-get install -y \
mingw-w64 \
mingw-w64-common \
mingw-w64-tools \
gcc-mingw-w64 g++-mingw-w64 directx-headers-dev
gcc-mingw-w64 g++-mingw-w64 directx-headers-dev --no-remove --no-upgrade

RUN apt-cache policy libssl1.0-dev



RUN apt-get install -y libcrypto++ libcrypto++-dev libssl1.0-dev libbz2-dev \
lib32z1 lib32c-dev libcrypt1:i386 libminizip-dev lib32z1-dev \
libc6-i386 --no-upgrade

RUN apt-mark hold libssl1.0-dev


RUN apt-get install -y -f \
lib32ncurses-dev lib32ncurses6 lib32ncursesw6 lib32tinfo6 lib32c-dev lib32tinfo6 libc6-i386 --no-remove --no-upgrade



RUN update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix && \
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix && \
Expand Down Expand Up @@ -181,5 +201,8 @@ COPY cmds/download-apple-files.sh $INSTALL_DIR/
RUN chmod +x $INSTALL_DIR/download-apple-files.sh
RUN update-alternatives --install $INSTALL_DIR/download-apple-files download-apple-files $INSTALL_DIR/download-apple-files.sh 10

COPY cmds/download-project-deps.sh $INSTALL_DIR/
RUN chmod +x $INSTALL_DIR/download-project-deps.sh
RUN update-alternatives --install $INSTALL_DIR/download-project-deps download-project-deps $INSTALL_DIR/download-project-deps.sh 10

CMD ["/bin/bash"]
96 changes: 96 additions & 0 deletions cicd/ubuntu/cmds/download-project-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/bash

# Exit immediately if a command exits with a non-zero status
set -e

# Log function for structured output
log() {
local message="$1"
if [[ -n "$GITHUB_ACTIONS" ]]; then
echo "$message" >> "$GITHUB_STEP_SUMMARY"
fi
echo "$message"
}

# Detect if running on a GitHub Actions runner
if [[ -n "$GITHUB_ACTIONS" ]]; then
log "### Running on a GitHub Actions runner"
log "Debug information will be written to GITHUB_STEP_SUMMARY."
else
log "### Not running on a GitHub Actions runner"
log "Debug information will only appear in the terminal."
fi

# Ensure the base directory exists
DEPS_DIR="/root/deps"
log "### Ensuring dependencies directory exists: $DEPS_DIR"
mkdir -p "$DEPS_DIR"

# macOS needs MoltenVK
if [ ! -d "$DEPS_DIR/moltenvk" ]; then
log "### Missing MoltenVK for macOS, downloading it."
mkdir -p "$DEPS_DIR/moltenvk"
pushd "$DEPS_DIR/moltenvk" > /dev/null
curl -L -o moltenvk.tar https://github.com/godotengine/moltenvk-osxcross/releases/download/vulkan-sdk-1.3.283.0-2/MoltenVK-all.tar
tar xf moltenvk.tar && rm -f moltenvk.tar
mv MoltenVK/MoltenVK/include/ MoltenVK/
mv MoltenVK/MoltenVK/static/MoltenVK.xcframework/ MoltenVK/
popd > /dev/null
log "MoltenVK downloaded and extracted successfully."
else
log "MoltenVK already exists. Skipping download."
fi

# Windows and macOS need ANGLE
if [ ! -d "$DEPS_DIR/angle" ]; then
log "### Missing ANGLE libraries, downloading them."
mkdir -p "$DEPS_DIR/angle"
pushd "$DEPS_DIR/angle" > /dev/null
base_url="https://github.com/godotengine/godot-angle-static/releases/download/chromium%2F6601.2/godot-angle-static"
curl -L -o windows_arm64.zip "$base_url-arm64-llvm-release.zip"
curl -L -o windows_x86_64.zip "$base_url-x86_64-gcc-release.zip"
curl -L -o windows_x86_32.zip "$base_url-x86_32-gcc-release.zip"
curl -L -o macos_arm64.zip "$base_url-arm64-macos-release.zip"
curl -L -o macos_x86_64.zip "$base_url-x86_64-macos-release.zip"
unzip -o windows_arm64.zip && rm -f windows_arm64.zip
unzip -o windows_x86_64.zip && rm -f windows_x86_64.zip
unzip -o windows_x86_32.zip && rm -f windows_x86_32.zip
unzip -o macos_arm64.zip && rm -f macos_arm64.zip
unzip -o macos_x86_64.zip && rm -f macos_x86_64.zip
popd > /dev/null
log "ANGLE libraries downloaded and extracted successfully."
else
log "ANGLE libraries already exist. Skipping download."
fi

# Mesa/NIR libraries
if [ ! -d "$DEPS_DIR/mesa" ]; then
log "### Missing Mesa/NIR libraries, downloading them."
mkdir -p "$DEPS_DIR/mesa"
pushd "$DEPS_DIR/mesa" > /dev/null
curl -L -o mesa_arm64.zip https://github.com/godotengine/godot-nir-static/releases/download/23.1.9-1/godot-nir-static-arm64-llvm-release.zip
curl -L -o mesa_x86_64.zip https://github.com/godotengine/godot-nir-static/releases/download/23.1.9-1/godot-nir-static-x86_64-gcc-release.zip
curl -L -o mesa_x86_32.zip https://github.com/godotengine/godot-nir-static/releases/download/23.1.9-1/godot-nir-static-x86_32-gcc-release.zip
unzip -o mesa_arm64.zip && rm -f mesa_arm64.zip
unzip -o mesa_x86_64.zip && rm -f mesa_x86_64.zip
unzip -o mesa_x86_32.zip && rm -f mesa_x86_32.zip
popd > /dev/null
log "Mesa/NIR libraries downloaded and extracted successfully."
else
log "Mesa/NIR libraries already exist. Skipping download."
fi

# Swappy libraries
if [ ! -d "$DEPS_DIR/swappy" ]; then
log "### Missing Swappy libraries, downloading them."
mkdir -p "$DEPS_DIR/swappy"
pushd "$DEPS_DIR/swappy" > /dev/null
curl -L -O https://github.com/darksylinc/godot-swappy/releases/download/v2023.3.0.0/godot-swappy.7z
7z x godot-swappy.7z && rm godot-swappy.7z
popd > /dev/null
log "Swappy libraries downloaded and extracted successfully."
else
log "Swappy libraries already exist. Skipping download."
fi

log "### Dependency download and setup completed successfully!"
16 changes: 11 additions & 5 deletions cicd/ubuntu/cmds/install-xar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ fi
log "### Navigating to source directory"
cd "$INSTALL_DIR/xar" || { log "Failed to navigate to $INSTALL_DIR/xar"; exit 1; }

#sed -i '332s/^.*$/AC_CHECK_LIB([crypto], [OPENSSL_init_crypto], , [have_libcrypto="0"])/' configure.ac;

# Check if configure script exists or run autogen.sh
if [[ ! -f ./configure ]]; then
log "Running autogen.sh to generate configure script..."
Expand All @@ -50,17 +52,21 @@ fi
log "### Configuring build"
./configure

log "### Building all components"
make

make install

# log "### Building all components"
make src_all
make lib_all

log "### Installing components"
# log "### Installing components"
make src_install
make lib_install

# Optional cleanup
log "### Cleaning up build artifacts"
make clean
# # Optional cleanup
# log "### Cleaning up build artifacts"
# make clean

# Verify installation
log "### Verifying Xar installation"
Expand Down
2 changes: 1 addition & 1 deletion cicd/ubuntu/cmds/setup-xcode-sdks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ log "Checking out commit $PBZX_COMMIT"
git checkout "$PBZX_COMMIT"

log "### Building pbzx"
clang -O3 -llzma -lxar -I /usr/local/include pbzx.c -o pbzx
clang -O3 -llzma -lxar -I /usr/local/include -I /usr/local/src/xar/xar/include pbzx.c -o pbzx

# Step 2: Extract Xcode XIP and build SDK tarballs
log "### Extracting Xcode XIP"
Expand Down
13 changes: 13 additions & 0 deletions cicd/ubuntu/linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM bioblaze/blazium-base:latest

WORKDIR /root

RUN download-project-deps

RUN install-llvm-mingw

RUN setup-android-sdk

RUN setup-godot-sdks

CMD ["/bin/bash"]

0 comments on commit 3c357b7

Please sign in to comment.