Drop the MXE SDL2 fetch and mark the cross-compile unsupported
This commit is contained in:
@@ -23,9 +23,9 @@ RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
|
||||
|
||||
# [Optional] Uncomment this section to install additional packages.
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends libsdl2-dev libsdl2-ttf-dev libharfbuzz-dev \
|
||||
libsdl2-image-dev libjpeg-turbo8-dev libtiff-dev libwebp-dev libzip-dev libzstd-dev \
|
||||
libsdl2-mixer-dev libflac-dev libasound2-dev libfreetype6-dev build-essential astyle ccache
|
||||
&& apt-get -y install --no-install-recommends libncursesw5-dev libharfbuzz-dev \
|
||||
libjpeg-turbo8-dev libtiff-dev libwebp-dev libzip-dev libzstd-dev \
|
||||
libflac-dev libasound2-dev libfreetype6-dev build-essential astyle ccache
|
||||
|
||||
# [Optional] comment out this section unless you want to cross-compile from Linux to Windows
|
||||
# This section should align with doc/c++/COMPILING.md#cross-compile-to-windows-from-linux
|
||||
@@ -44,9 +44,11 @@ WORKDIR /opt/mxe
|
||||
|
||||
# because of https://github.com/mxe/mxe/issues/2659, we have to link python 3 to python
|
||||
RUN ln /usr/bin/python3 /usr/bin/python
|
||||
# Builds windows version of SDL2 which is required to later cross-compile CDDA.
|
||||
# SDL2 support was removed. MXE does package sdl3, sdl3_image and sdl3_ttf, but
|
||||
# no sdl3_mixer, and nobody has tried a tiles cross-build on them yet, so only
|
||||
# gettext is built here.
|
||||
RUN make -j4 MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static' \
|
||||
MXE_PLUGIN_DIRS=plugins/gcc12 sdl2 sdl2_ttf sdl2_image sdl2_mixer gettext
|
||||
MXE_PLUGIN_DIRS=plugins/gcc12 gettext
|
||||
WORKDIR /opt/libbacktrace
|
||||
RUN wget https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-x86_64-w64-mingw32.tar.gz
|
||||
RUN wget https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-i686-w64-mingw32.tar.gz
|
||||
|
||||
@@ -205,13 +205,10 @@ jobs:
|
||||
ZSTD_CLEVEL: 17
|
||||
CMAKE: ${{ matrix.cmake }}
|
||||
COMPILER: ${{ matrix.compiler }}
|
||||
MXE_TARGET: ${{ matrix.mxe_target }}
|
||||
WINE: ${{ matrix.wine }}
|
||||
ANDROID: ${{ matrix.android }}
|
||||
OS: ${{ matrix.os }}
|
||||
TILES: ${{ matrix.tiles }}
|
||||
SOUND: ${{ matrix.sound }}
|
||||
SDL3: ${{ matrix.sdl3 }}
|
||||
LOCALIZE: ${{ matrix.localize }}
|
||||
MODS: ${{ matrix.mods }}
|
||||
SANITIZE: ${{ matrix.sanitize }}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
fd2b7ac21d1c487b87fd6c0a9fc87cfb6936c528c3ec197f6127bf925eb38356 *SDL2-devel-2.26.2-mingw.tar.gz
|
||||
@@ -80,20 +80,9 @@ if [ -n "${MXE_TARGET}" ]; then
|
||||
export CXX="$COMPILER"
|
||||
export CCACHE=1
|
||||
|
||||
set +e
|
||||
retry=0
|
||||
until [[ "$retry" -ge 5 ]]; do
|
||||
curl -L -o SDL2-devel-2.26.2-mingw.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.26.2/SDL2-devel-2.26.2-mingw.tar.gz && shasum -a 256 -c ./build-scripts/SDL2-devel-2.26.2-mingw.tar.gz.sha256 && break
|
||||
retry=$((retry+1))
|
||||
rm -f SDL2-devel-2.26.2-mingw.tar.gz
|
||||
sleep 10
|
||||
done
|
||||
if [[ "$retry" -ge 5 ]]; then
|
||||
echo "Error downloading or checksum failed for SDL2-devel-2.26.2-mingw.tar.gz"
|
||||
exit 1
|
||||
fi
|
||||
set -e
|
||||
sudo tar -xzf SDL2-devel-2.26.2-mingw.tar.gz -C ${MXE_DIR}/usr/${MXE_TARGET} --strip-components=2 SDL2-2.26.2/x86_64-w64-mingw32
|
||||
# The SDL2 development package this used to fetch is gone. MXE does package
|
||||
# sdl3, sdl3_image and sdl3_ttf, but no sdl3_mixer, and nobody has tried a
|
||||
# tiles cross-build on them yet. The toolchain setup above is kept as it was.
|
||||
|
||||
set +e
|
||||
retry=0
|
||||
|
||||
+11
-11
@@ -261,6 +261,13 @@ Run:
|
||||
|
||||
## Cross-compile to Windows from Linux
|
||||
|
||||
> **The MXE cross-compile is unsupported.** Its CI job was removed on
|
||||
> 2024-12-11 in commit `39a3e408e4` (PR #78495), and SDL2 support has since been
|
||||
> removed from the code base. MXE packages sdl3, sdl3_image and sdl3_ttf but no
|
||||
> sdl3_mixer, so a sound build is out and nobody has tried the rest. The scripts
|
||||
> and the section below are kept deliberately, in the state they bit-rotted
|
||||
> into, for anyone who wants to revive the path.
|
||||
|
||||
To cross-compile to Windows from Linux, you will need MXE, which changes your `make` command slightly. These instructions were written from Ubuntu 20.04, but should be applicable to any Debian-based environment. Please adjust all package manager instructions to match your environment.
|
||||
|
||||
Dependencies:
|
||||
@@ -280,7 +287,7 @@ cd ~/src
|
||||
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
git clone https://github.com/mxe/mxe.git
|
||||
cd mxe
|
||||
make -j$((`nproc`+0)) MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static' MXE_PLUGIN_DIRS=plugins/gcc11 sdl2 sdl2_ttf sdl2_image sdl2_mixer gettext
|
||||
make -j$((`nproc`+0)) MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static' MXE_PLUGIN_DIRS=plugins/gcc11 gettext
|
||||
cd ../libbacktrace/
|
||||
wget https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-x86_64-w64-mingw32.tar.gz
|
||||
wget https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-i686-w64-mingw32.tar.gz
|
||||
@@ -303,16 +310,9 @@ This is to ensure that the variables for the `make` command will not get reset a
|
||||
|
||||
### Building (SDL)
|
||||
|
||||
These MXE instructions build the SDL2 fallback. SDL3 cross-compilation requires equivalent SDL3, SDL3_image, SDL3_ttf, SDL3_mixer, and shader toolchain packages.
|
||||
|
||||
cd ~/src/Cataclysm-DDA
|
||||
|
||||
Run one of the following commands based on your targeted environment:
|
||||
|
||||
```bash
|
||||
make -j$((`nproc`+0)) CROSS="${PLATFORM_32}" TILES=1 SOUND=1 SDL3=0 RELEASE=1 LOCALIZE=1 bindist
|
||||
make -j$((`nproc`+0)) CROSS="${PLATFORM_64}" TILES=1 SOUND=1 SDL3=0 RELEASE=1 LOCALIZE=1 bindist
|
||||
```
|
||||
Untested. MXE packages sdl3, sdl3_image and sdl3_ttf, so the pieces for a
|
||||
no-sound tiles cross-build exist, but nobody has built CDDA against them. There
|
||||
is no sdl3_mixer package, so `SOUND=1` needs one added upstream in MXE first.
|
||||
|
||||
|
||||
<!-- Building ncurses for Windows is a nonstarter, so the directions were removed. -->
|
||||
|
||||
Reference in New Issue
Block a user