Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions build-scripts/docker/ProtonWineBuildImage.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM ubuntu:24.04 as ubuntu

RUN <<EOF
dpkg --add-architecture i386
apt-get update
apt-get install -y \
build-essential \
git \
wget \
curl \
unzip \
flex \
bison \
gettext \
autoconf \
automake \
libtool \
pkg-config \
mingw-w64 \
gcc-multilib \
g++-multilib \
libfreetype6-dev \
libfreetype6-dev:i386 \
libpng-dev \
libpng-dev:i386 \
zlib1g-dev \
zlib1g-dev:i386 \
python3 \
libpcap-dev:i386 \
libudev-dev:i386 \
dbus:i386 \
libpulse-dev:i386 \
ffmpeg:i386 \
libsdl2-dev:i386 \
fontconfig:i386 \
libusb-1.0-0-dev:i386 \
libv4l-dev:i386 \
libavcodec-dev:i386 \
libavformat-dev:i386 \
libavfilter-dev:i386 \
libswscale-dev:i386
EOF

RUN <<EOF
mkdir -p $HOME/termuxfs/aarch64
cd $HOME/termuxfs/aarch64
wget https://github.com/GameNative/termux-on-gha/releases/download/build-20260218/termuxfs-aarch64.tar
tar -xf termuxfs-aarch64.tar
ls -la $HOME/termuxfs/aarch64/

mkdir -p $HOME/termuxfs/x86_64
cd $HOME/termuxfs/x86_64
wget https://github.com/GameNative/termux-on-gha/releases/download/build-20260218/termuxfs-x86_64.tar
tar -xf termuxfs-x86_64.tar
ls -la $HOME/termuxfs/x86_64/
EOF

RUN <<EOF
mkdir -p $HOME/Android/Sdk/ndk
cd $HOME/Android/Sdk/ndk
wget https://dl.google.com/android/repository/android-ndk-r27d-linux.zip
unzip -q android-ndk-r27d-linux.zip
mv android-ndk-r27d 27.3.13750724
EOF

RUN <<EOF
mkdir -p $HOME/toolchains
cd $HOME/toolchains
wget https://github.com/bylaws/llvm-mingw/releases/download/20250920/llvm-mingw-20250920-ucrt-ubuntu-22.04-x86_64.tar.xz
tar -xf llvm-mingw-20250920-ucrt-ubuntu-22.04-x86_64.tar.xz
EOF

CMD ["/bin/bash"]
17 changes: 17 additions & 0 deletions build-scripts/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Instructions for use
1) run `podman build -f ProtonWineBuildImage.Dockerfile -t proton-wine:latest` or `docker build -f ProtonWineBuildImage.Dockerfile -t proton-wine:latest`. This will create the image that holds the android ndk, mingw llvm, and the necessary build tools in an ubuntu 24.04 image
2) Update `build.sh` to point to your source folder and output folder and also whether you are using Docker or Podman
3) run `build.sh` for the default build

The output will be a `*.wcp` file that you can then import into GameNative.

## Build Configuration
The default options are `--arm64 --game_native`.
If any of the below are present, only those will be built.

### Arch
--arm64 Build the `arm64` version
--x86_64 Build the `x86_64` version
### Version
--game_native Package the build for GameNative
--winlator Package the build for Winlator for CMOD & Ludashi
166 changes: 166 additions & 0 deletions build-scripts/docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
#!/bin/bash

if [[ "$CONTAINER" != "1" ]];
then
DOCKER=podman
SRC_PATH="$HOME/programming/proton-wine"
OUTPUT_PATH="$HOME/proton_builds"
RELEASE=10.0-2
fi
#This is overengineered and hacky.
#It's basically a 1-1 copy of the github workflow
#Could probably be made a lot simpler, but here we are

make_package() {
# $1 is arch
# $2 is platform
# $3 is arch_name
BIN_DIR="$HOME/compiled-files-$1"
echo "moving to $BIN_DIR ..."
wget https://github.com/GameNative/bionic-prefix-files/raw/main/prefixPack-$3.txz -O $BIN_DIR/prefixPack.txz
if [[ "$2" == "GN" ]];
then
cat > $BIN_DIR/profile.json <<-EPROFILE
{
"type": "Proton",
"versionName": "$RELEASE-$3",
"versionCode": 1,
"description": "Proton $RELEASE $3 - Windows compatibility layer with improved gaming support",
"files": [],
"wine": {
"binPath": "bin",
"libPath": "lib",
"prefixPack": "prefixPack.txz"
}
}
EPROFILE
cd $BIN_DIR
echo "Building Release..."
tar cJf proton-$RELEASE-$3.wcp bin lib share prefixPack.txz profile.json
mv proton-$RELEASE-$3.wcp "$OUTPUT_PATH/"
fi
if [[ "$2" == "WIN" ]];
then
cat > $BIN_DIR/profile-wine.json <<-EPROFILE
{
"type": "Wine",
"versionName": "$RELEASE-$3",
"versionCode": 0,
"description": "Proton $RELEASE $3 - Windows compatibility layer with improved gaming support",
"files": [],
"wine": {
"binPath": "bin",
"libPath": "lib",
"prefixPack": "prefixPack.txz"
}
}
EPROFILE
cd $BIN_DIR
echo "Building Release..."
tar cJf proton-wine-$RELEASE-$3.wcp.xz bin lib share prefixPack.txz profile-wine.json
mv proton-wine-$RELEASE-$3.wcp.xz $OUTPUT_PATH/
fi
}

if [[ "$CONTAINER" != "1" ]];
then

mkdir -p "$OUTPUT_PATH"
ARCH_ARM=yes
ARCH_x86=no
PLATFORM_GN=yes
PLATFORM_WIN=no

for arg in "$@"
do
if [ "$arg" == "--arm64" ];
then
ARCH_ARM=yes
arg_arm=yes
fi
if [ "$arg" == "--x86_64" ];
then
ARCH_x86=yes
if [ "$arg_arm" != "yes" ];
then
ARCH_ARM=no
fi
fi
if [ "$arg" == "--game_native" ];
then
PLATFORM_GN=yes
arg_gn=yes
fi
if [ "$arg" == "--winlator" ];
then
PLATFORM_WIN=yes
if [ "$arg_gn" != "yes" ];
then
PLATFORM_GN=no
fi
fi
done
echo "arm64 : $ARCH_ARM"
echo "x86_64 : $ARCH_x86"
echo "GameNative: $PLATFORM_GN"
echo "Winlator : $PLATFORM_WIN"
$DOCKER run --rm \
-v $OUTPUT_PATH:$OUTPUT_PATH \
-v $SRC_PATH:$SRC_PATH \
-w $OUTPUT_PATH \
-e SRC_PATH="$SRC_PATH" -e OUTPUT_PATH="$OUTPUT_PATH" \
-e PLATFORM_GN="$PLATFORM_GN" -e PLATFORM_WIN="$PLATFORM_WIN" \
-e ARCH_ARM="$ARCH_ARM" -e ARCH_x86="$ARCH_x86" \
-e RELEASE="$RELEASE" \
-e CONTAINER="1" \
localhost/proton-wine:latest \
bash $SRC_PATH/build-scripts/docker/build.sh

else

if [[ "$ARCH_ARM" == "yes" ]];
then
echo "moving to $SRC_PATH ..."
cd $SRC_PATH
bash autogen.sh
bash build-scripts/build-step0.sh
rm -rf "$HOME/compiled-files*"
bash build-scripts/build-step-arm64ec.sh --build-sysvshm
bash build-scripts/build-step-arm64ec.sh --configure
bash build-scripts/build-step-arm64ec.sh --build
bash build-scripts/build-step-arm64ec.sh --install

if [[ "$PLATFORM_GN" == "yes" ]];
then
make_package aarch64 GN arm64ec
fi

if [[ "$PLATFORM_WIN" == "yes" ]];
then
make_package aarch64 WIN arm64ec
fi
fi
if [[ "$ARCH_x86" == "yes" ]];
then
echo "moving to $SRC_PATH ..."
cd $SRC_PATH
bash autogen.sh
bash build-scripts/build-step0.sh
rm -rf "$HOME/compiled-files*"
bash build-scripts/build-step-x86_64.sh --build-sysvshm
bash build-scripts/build-step-x86_64.sh --configure
bash build-scripts/build-step-x86_64.sh --build
bash build-scripts/build-step-x86_64.sh --install

if [[ "$PLATFORM_GN" == "yes" ]];
then
make_package x86_64 GN x86_64
fi

if [[ "$PLATFORM_WIN" == "yes" ]];
then
make_package x86_64 WIN x86_64
fi
fi
fi