Skip to content

Commit

Permalink
naev-windows: Switch to UCRT Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectSynchro committed Aug 20, 2024
1 parent f0e427f commit 359b4e5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
### v1.10.6
- `naev-macos`: Disable hacks and workaround upstream OSXCross issue. (https://github.com/tpoechtrager/osxcross/pull/428)
- `naev-steamruntime`: Build our own static ffmpeg binary to avoid broken dependencies.

- `naev-windows`: Use our own build UCRT packages based on upstream sources for UCRT builds on Windows.

### v1.10.5
- Remove ruby and bundler from `naev-docs` in favour of using Github Actions bundled tool.
Expand Down
20 changes: 12 additions & 8 deletions naev-windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,30 @@ ENV IMAGE_NAME "naev-windows"

WORKDIR /tmp
# Install build requirements
RUN microdnf --nodocs --setopt=install_weak_deps=0 -y install gcc gettext git meson ninja-build python3-pyyaml tar texinfo xz unzip zip \
# Add COPR repository for missing upstream UCRT64 packages.
COPY _copr:copr.fedorainfracloud.org:jackgreiner:ucrt64-libraries.repo /etc/yum.repos.d

RUN microdnf update -y && \
microdnf --nodocs --setopt=install_weak_deps=0 -y install gcc gettext git meson ninja-build python3-pyyaml tar texinfo xz unzip zip \
# Install mingw64 packages
# Note to selves: mingw64-dlfcn is:
# - to be added with great caution in any case: Fedora's hardened build flags make it depend on libssp-0.dll,
# and test-runs under Wine 7.12 showed a startup hang if libssp-0.dll was bundled (as our installer does).
mingw64-llvm mingw64-gcc mingw64-gcc-c++ mingw64-dlfcn mingw64-freetype mingw64-libvorbis mingw64-libxml2 \
mingw64-openal-soft mingw64-SDL2 mingw64-SDL2_image mingw64-libpng mingw32-nsis mingw64-pcre2 mingw64-physfs && \
ucrt64-gcc ucrt64-gcc-c++ ucrt64-dlfcn ucrt64-freetype ucrt64-libvorbis ucrt64-libxml2 \
ucrt64-openal-soft ucrt64-SDL2 ucrt64-SDL2_image ucrt64-libpng mingw32-nsis ucrt64-pcre2 ucrt64-physfs && \
microdnf clean all && \
# Install openblas for mingw (building this from source is an option but probably painful)
curl -L -O https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.26/OpenBLAS-0.3.26-x64.zip && \
unzip OpenBLAS-0.3.26-x64.zip -d /usr/x86_64-w64-mingw32/sys-root/mingw && \
rm -rf OpenBLAS-0.3.26-x64.zip && \
curl -L -O https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.28/OpenBLAS-0.3.28-x64-64.zip && \
unzip OpenBLAS-0.3.28-x64-64.zip -d /usr/x86_64-w64-mingw32ucrt/sys-root/mingw && \
rm -rf OpenBLAS-0.3.28-x64-64.zip && \
# Install cross-build of enet
curl -L -O http://enet.bespin.org/download/enet-1.3.17.tar.gz && \
tar zxf enet-1.3.17.tar.gz && \
cd enet-1.3.17 && \
./configure --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw --host=x86_64-w64-mingw32 && \
./configure --prefix=/usr/x86_64-w64-mingw32ucrt/sys-root/mingw --host=x86_64-w64-mingw32ucrt && \
make -j && \
make install && \
sed -i 's/-lenet/-lenet -lws2_32 -lwinmm/' /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/libenet.pc && \
sed -i 's/-lenet/-lenet -lws2_32 -lwinmm/' /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/lib/pkgconfig/libenet.pc && \
cd .. && \
rm -rf enet-1.3.17 enet-1.3.17.tar.gz

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[copr:copr.fedorainfracloud.org:jackgreiner:ucrt64-libraries]
name=Copr repo for ucrt64-libraries owned by jackgreiner
baseurl=https://download.copr.fedorainfracloud.org/results/jackgreiner/ucrt64-libraries/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://download.copr.fedorainfracloud.org/results/jackgreiner/ucrt64-libraries/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1
module_hotfixes=1

0 comments on commit 359b4e5

Please sign in to comment.