Move SDL to official STK repo and update to 2.30.5 #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: win | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: {} | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: true | |
matrix: | |
arch: [i686, x86_64, armv7, aarch64] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2.5.0 | |
with: | |
fetch-depth: 1 | |
submodules: true | |
- name: Configure packaging name for git master branch | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: | | |
echo "release_name=preview" >> $GITHUB_ENV | |
- name: Configure packaging name for tag | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
echo "release_name=`basename $GITHUB_REF`" >> $GITHUB_ENV | |
- name: Exit otherwise | |
if: ${{ !(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) || | |
github.repository_owner != 'supertuxkart' }} | |
run: exit 1 | |
- name: Check for prerelease | |
if: ${{ github.ref == 'refs/heads/master' || contains(github.ref, 'rc') || contains(github.ref, 'beta') }} | |
run: | | |
echo "release_pre=true" >> $GITHUB_ENV | |
- name: Check for non-prerelease | |
if: ${{ github.ref != 'refs/heads/master' && !contains(github.ref, 'rc') && !contains(github.ref, 'beta') }} | |
run: | | |
echo "release_pre=false" >> $GITHUB_ENV | |
- name: Setting up llvm-dlltool arch for i686 | |
if: ${{ matrix.arch == 'i686' }} | |
run: | | |
echo "dlltool_arch=i386" >> $GITHUB_ENV | |
- name: Setting up llvm-dlltool arch for x86_64 | |
if: ${{ matrix.arch == 'x86_64' }} | |
run: | | |
echo "dlltool_arch=i386:x86-64" >> $GITHUB_ENV | |
- name: Setting up llvm-dlltool arch for armv7 | |
if: ${{ matrix.arch == 'armv7' }} | |
run: | | |
echo "dlltool_arch=arm" >> $GITHUB_ENV | |
- name: Setting up llvm-dlltool arch for aarch64 | |
if: ${{ matrix.arch == 'aarch64' }} | |
run: | | |
echo "dlltool_arch=arm64" >> $GITHUB_ENV | |
- name: Get LLVM MinGW | |
run: | | |
sudo cp build_tools/dll2lib.sh /usr/local/bin | |
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20210423/llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64.tar.xz -P $HOME | |
cd $HOME | |
tar xf llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64.tar.xz | |
mv llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64 llvm-mingw | |
- name: Set up MinGW for x86 or x64 | |
if: ${{ matrix.arch == 'i686' || matrix.arch == 'x86_64' }} | |
run: | | |
cd / | |
sudo mkdir -p /data/mxe/usr | |
cd /data/mxe/usr | |
# It's compiled from https://github.com/mxe/mxe | |
sudo wget https://github.com/supertuxkart/dependencies/releases/download/preview/mxe_static_mingw.zip | |
sudo unzip mxe_static_mingw.zip | |
sudo rm mxe_static_mingw.zip | |
# For libfl.so.2 | |
sudo apt install -y libfl-dev | |
- name: Restore timestamps | |
run: | | |
cd src | |
for dir in * | |
do | |
cd $dir | |
last_time=$(git log --date=local --pretty=format:"%cd" . | head -1) | |
find . -exec touch -d "$last_time" {} + | |
cd .. | |
done | |
- name: Build zlib | |
run: | | |
cd src/zlib | |
# zlib cmake will change the public header, install it first | |
mkdir -p $HOME/dependencies-win-${{ matrix.arch }}/bin | |
mkdir -p $HOME/dependencies-win-${{ matrix.arch }}/include | |
mkdir -p $HOME/dependencies-win-${{ matrix.arch }}/lib | |
cp -p zconf.h zlib.h $HOME/dependencies-win-${{ matrix.arch }}/include | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} libzlib.dll | |
cp libzlib.dll libzlib.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
# Windows finds only zlib.lib | |
cp libzlib.lib $HOME/dependencies-win-${{ matrix.arch }}/lib/zlib.lib | |
- name: Build Mbed TLS | |
run: | | |
cd src/mbedtls | |
# Fix C99 error | |
sed -i 's/set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")//g' CMakeLists.txt | |
# Windows XP compatibility | |
sed -i 's/if defined(_TRUNCATE)/if 0/g' library/platform.c | |
mkdir build | |
cd build | |
unset EXTRA_CFLAGS | |
if [ ${{ matrix.arch }} = "armv7" ]; then | |
# Required for armv7 build, otherwise including bn_mul.h fails | |
EXTRA_CFLAGS="-DMULADDC_CANNOT_USE_R7=0" | |
fi | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF \ | |
-DUSE_SHARED_MBEDTLS_LIBRARY=ON -DUSE_STATIC_MBEDTLS_LIBRARY=OFF \ | |
-DCMAKE_C_FLAGS=$EXTRA_CFLAGS | |
make -j4 | |
make install | |
rm -rf $HOME/dependencies-${{ matrix.sysroot }}/cmake | |
cd library | |
dll2lib.sh ${{ env.dlltool_arch }} libmbedcrypto.dll | |
dll2lib.sh ${{ env.dlltool_arch }} libmbedx509.dll | |
dll2lib.sh ${{ env.dlltool_arch }} libmbedtls.dll | |
cp *.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp *.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
- name: Build cURL | |
run: | | |
cd src/curl | |
mkdir build | |
cd build | |
# -DCURL_TARGET_WINDOWS_VERSION=0x0501 for Windows XP | |
# -DCURL_CA_BUNDLE=none -DCURL_CA_PATH=none because STK includes its own | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DBUILD_TESTING=OFF -DBUILD_CURL_EXE=OFF \ | |
-DCURL_STATIC_CRT=ON -DCURL_TARGET_WINDOWS_VERSION=0x0501 \ | |
-DCURL_USE_MBEDTLS=ON -DUSE_ZLIB=ON \ | |
-DCURL_USE_OPENSSL=OFF -DCURL_USE_LIBSSH=OFF -DCURL_USE_LIBSSH2=OFF \ | |
-DCURL_USE_GSSAPI=OFF -DUSE_NGHTTP2=OFF -DUSE_QUICHE=OFF \ | |
-DHTTP_ONLY=ON -DCURL_CA_BUNDLE=none -DCURL_CA_PATH=none | |
make -j4 | |
make install | |
cd lib | |
dll2lib.sh ${{ env.dlltool_arch }} libcurl.dll | |
cp libcurl.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libcurl.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/bin/curl-config | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/cmake | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/pkgconfig | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
- name: Build SQLite | |
run: | | |
cd src/sqlite | |
sed -i 's/Rpcrt4.lib/rpcrt4/g' CMakeLists.txt | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} | |
make | |
dll2lib.sh ${{ env.dlltool_arch }} libsqlite3.dll | |
cp -p ../sqlite3ext.h ../sqlite3.h $HOME/dependencies-win-${{ matrix.arch }}/include | |
cp libsqlite3.dll libsqlite3.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libsqlite3.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
- name: Build libpng | |
run: | | |
cd src/libpng | |
mkdir build | |
cd build | |
# -DPNG_INTEL_SSE=off for non-sse2 capable CPUs (at the moment it only get enabled | |
# in x86_64 only) | |
# -DPNG_ARM_NEON=off is required for successful compilation of aarch64 | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DPNG_STATIC=OFF -DPNG_TESTS=OFF -DPNG_ARM_NEON=off | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} libpng16.dll | |
make install | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/pkgconfig | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/libpng* | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/bin/*png* | |
cp libpng16.dll libpng16.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libpng16.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
touch -r ../README $HOME/dependencies-win-${{ matrix.arch }}/include/png* | |
touch -r ../README $HOME/dependencies-win-${{ matrix.arch }}/include/libpng16/* | |
- name: Build FreeType bootstrap | |
run: | | |
cd src/freetype | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DFT_WITH_ZLIB=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_BROTLI=OFF \ | |
-DFT_WITH_PNG=ON -DFT_WITH_HARFBUZZ=OFF -DBUILD_SHARED_LIBS=ON | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} libfreetype.dll | |
make install | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/cmake | |
cp libfreetype.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libfreetype.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
touch -r ../README $HOME/dependencies-win-${{ matrix.arch }}/include/freetype2/freetype/config/* | |
- name: Build HarfBuzz | |
run: | | |
cd src/harfbuzz | |
# Remove libwinpthread-1.dll dependency | |
sed -i '/add_definitions("-DHAVE_PTHREAD")/d' CMakeLists.txt | |
sed -i '/list(APPEND THIRD_PARTY_LIBS Threads::Threads)/d' CMakeLists.txt | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DHB_HAVE_CORETEXT=OFF -DHB_HAVE_FREETYPE=ON -DBUILD_SHARED_LIBS=ON \ | |
-DHB_BUILD_SUBSET=OFF | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} libharfbuzz.dll | |
make install | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/cmake | |
cp libharfbuzz.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libharfbuzz.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
- name: Build FreeType | |
run: | | |
cd src/freetype | |
git reset --hard | |
rm -rf build | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DFT_WITH_ZLIB=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_BROTLI=OFF \ | |
-DFT_WITH_PNG=ON -DFT_WITH_HARFBUZZ=ON -DBUILD_SHARED_LIBS=ON | |
make -j4 | |
# Don't make install again as the timestamp will be overwritten after git reset --hard | |
dll2lib.sh ${{ env.dlltool_arch }} libfreetype.dll | |
cp libfreetype.dll libfreetype.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libfreetype.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
- name: Build Ogg | |
run: | | |
cd src/libogg | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DINSTALL_DOCS=OFF \ | |
-DINSTALL_PKG_CONFIG_MODULE=OFF -DINSTALL_CMAKE_PACKAGE_MODULE=OFF | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} libogg.dll | |
make install | |
cp libogg.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libogg.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
touch -r ../README.md $HOME/dependencies-win-${{ matrix.arch }}/include/ogg/* | |
- name: Build Vorbis | |
run: | | |
cd src/libvorbis | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DBUILD_SHARED_LIBS=ON -DINSTALL_CMAKE_PACKAGE_MODULE=OFF | |
make -j4 | |
cd lib | |
dll2lib.sh ${{ env.dlltool_arch }} libvorbis.dll | |
dll2lib.sh ${{ env.dlltool_arch }} libvorbisenc.dll | |
dll2lib.sh ${{ env.dlltool_arch }} libvorbisfile.dll | |
cp libvorbis*.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libvorbis*.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
cd .. | |
make install | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/pkgconfig | |
- name: Build libjpeg-turbo | |
run: | | |
sudo apt install -y yasm | |
cd src/libjpeg | |
# Windows XP compatibility | |
sed -i 's/#ifndef NO_PUTENV/#define NO_PUTENV\n#ifndef NO_PUTENV/g' jinclude.h | |
mkdir build | |
cd build | |
# libjpeg install library to lib64 folder, override it | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DENABLE_SHARED=ON -DENABLE_STATIC=OFF -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} libjpeg-62.dll | |
# CMake detects only libjpeg.lib | |
mv libjpeg-62.lib libjpeg.lib | |
dll2lib.sh ${{ env.dlltool_arch }} libturbojpeg.dll | |
make install | |
cp libturbojpeg.pdb libjpeg-62.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libturbojpeg.lib libjpeg.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/bin/*.exe | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/cmake | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/pkgconfig | |
touch -r ../README.md $HOME/dependencies-win-${{ matrix.arch }}/include/jconfig.h | |
- name: Build libvpx | |
run: | | |
# We use clang only for aarch64 because staticially linking winpthread | |
# leads to GetTickCount64 which only available in > vista | |
cd src/libvpx | |
patch -p1 <../../patches/libvpx-win-configure.patch | |
# Fix for clang | |
sed -i 's/-Wl,-no-undefined//g' build/make/configure.sh | |
mkdir build-vpx | |
cd build-vpx | |
unset EXTRA_CFLAGS | |
if [ ${{ matrix.arch }} = "i686" ]; then | |
_targetarch="x86-win32-gcc" | |
# Required for 32bit build, otherwise crash when using | |
EXTRA_CFLAGS="-mstackrealign" | |
#EXTRA_CFLAGS="-mstackrealign -gcodeview" | |
_runtimecpu="--enable-runtime-cpu-detect" | |
_compiler=/data/mxe/usr/bin/${{ matrix.arch }}-w64-mingw32.static.posix.dw2- | |
elif [ ${{ matrix.arch }} = "armv7" ]; then | |
_targetarch="armv7-win32-gcc" | |
EXTRA_CFLAGS="-gcodeview" | |
# Arm doesn't support runtime cpu detection | |
_runtimecpu="--disable-runtime-cpu-detect" | |
_compiler=$HOME/llvm-mingw/bin/${{ matrix.arch }}-w64-mingw32- | |
elif [ ${{ matrix.arch }} = "aarch64" ]; then | |
_targetarch="arm64-win64-gcc" | |
EXTRA_CFLAGS="-gcodeview" | |
# Arm doesn't support runtime cpu detection | |
_runtimecpu="--disable-runtime-cpu-detect" | |
_compiler=$HOME/llvm-mingw/bin/${{ matrix.arch }}-w64-mingw32- | |
else | |
_targetarch="x86_64-win64-gcc" | |
#EXTRA_CFLAGS="-gcodeview" | |
_runtimecpu="--enable-runtime-cpu-detect" | |
_compiler=/data/mxe/usr/bin/${{ matrix.arch }}-w64-mingw32.static.posix.seh- | |
fi | |
LDFLAGS="-static" \ | |
CFLAGS="$EXTRA_CFLAGS -fno-asynchronous-unwind-tables" \ | |
CROSS=${_compiler} ../configure \ | |
--prefix=$HOME/dependencies-win-${{ matrix.arch }} \ | |
--target=${_targetarch} \ | |
--disable-docs \ | |
--disable-install-docs \ | |
--disable-install-srcs \ | |
--enable-pic \ | |
--enable-postproc \ | |
${_runtimecpu} \ | |
--enable-shared \ | |
--enable-vp8 \ | |
--enable-vp9 \ | |
--enable-vp9-highbitdepth \ | |
--enable-vp9-temporal-denoising | |
if [ ${{ matrix.arch }} = "armv7" ] || [ ${{ matrix.arch }} = "aarch64" ]; then | |
sed -i 's/-Wl,--no-undefined/-Wl,-undefined,error/g' Makefile | |
sed -i 's/-Wl,-soname,$$(SONAME)//g' Makefile | |
sed -i 's/-Wl,--version-script,$$(EXPORTS_FILE) /-Wl,-pdb=libvpx.pdb /g' Makefile | |
fi | |
make -j4 | |
make install | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/libvpx* | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/pkgconfig | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/bin/vpx* | |
cp libvpx.dll $HOME/dependencies-win-${{ matrix.arch }}/bin | |
if [ ${{ matrix.arch }} = "i686" ] || [ ${{ matrix.arch }} = "x86_64" ]; then | |
strip $HOME/dependencies-win-${{ matrix.arch }}/bin/libvpx.dll | |
fi | |
# 2>/dev/null || : to ignore missing .pdb if not aarch64 | |
cp libvpx.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin 2>/dev/null || : | |
VPXDEF=$(awk '!/:/' libvpx.ver | sed 's/;//g') | |
echo "EXPORTS" > libvpx.def | |
printf "${VPXDEF}" >> libvpx.def | |
$HOME/llvm-mingw/bin/llvm-dlltool -m ${{ env.dlltool_arch }} -d libvpx.def -D libvpx.dll -l libvpx.lib | |
cp libvpx.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
- name: Build SDL2 | |
run: | | |
cd src/sdl2 | |
# Windows XP compatibility | |
sed -i 's/defined(__WINRT__) || defined(__GDK__)/0/g' src/audio/wasapi/SDL_wasapi.c | |
mkdir build | |
cd build | |
# Sensor is causing problems in msvc debugger | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DBUILD_SHARED_LIBS=ON -DSDL_SENSOR=OFF | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} SDL2.dll | |
# Manually install the header for msvc usage | |
cp -rp ../include $HOME/dependencies-win-${{ matrix.arch }}/include/SDL2 | |
cp SDL2.dll SDL2.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp SDL2.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/cmake | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
- name: Build OpenAL | |
run: | | |
cd src/openal | |
cd build | |
if [ ${{ matrix.arch }} = "i686" ]; then | |
# OpenAL fails to compile with only -DALSOFT_ENABLE_SSE2_CODEGEN | |
# Need to disable all SSE completely | |
cmake .. -DMXE_PREFIX=/data/mxe/usr \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-mxe-${{ matrix.arch }}.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_NO_CONFIG_UTIL=ON \ | |
-DALSOFT_CPUEXT_SSE=OFF -DALSOFT_CPUEXT_SSE2=OFF -DALSOFT_CPUEXT_SSE3=OFF \ | |
-DALSOFT_CPUEXT_SSE4_1=OFF -DALSOFT_ENABLE_SSE_CODEGEN=OFF \ | |
-DALSOFT_ENABLE_SSE2_CODEGEN=OFF -DCMAKE_DLLTOOL="" -DALSOFT_BACKEND_PIPEWIRE=OFF | |
elif [ ${{ matrix.arch }} = "armv7" ] || [ ${{ matrix.arch }} = "aarch64" ]; then | |
# Without -DCMAKE_DLLTOOL="": error: no target machine specified when llvm-dlltool | |
# We generate .lib ourselves later anyway | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_NO_CONFIG_UTIL=ON \ | |
-DCMAKE_DLLTOOL="" -DALSOFT_BACKEND_PIPEWIRE=OFF | |
else | |
cmake .. -DMXE_PREFIX=/data/mxe/usr \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-mxe-${{ matrix.arch }}.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DALSOFT_UTILS=OFF -DALSOFT_EXAMPLES=OFF -DALSOFT_NO_CONFIG_UTIL=ON \ | |
-DCMAKE_DLLTOOL="" -DALSOFT_BACKEND_PIPEWIRE=OFF | |
fi | |
make -j4 | |
if [ ${{ matrix.arch }} = "i686" ] || [ ${{ matrix.arch }} = "x86_64" ]; then | |
# Without stripping it's 2xMB when using GNU Mingw | |
strip OpenAL32.dll | |
fi | |
dll2lib.sh ${{ env.dlltool_arch }} OpenAL32.dll | |
make install | |
cp OpenAL32.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin 2>/dev/null || : | |
cp OpenAL32.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/cmake | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/pkgconfig | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/*.a | |
- name: Build libopenglrecorder | |
run: | | |
cd src/libopenglrecorder | |
mkdir dependencies-mingw | |
cd dependencies-mingw | |
cp -r $HOME/dependencies-win-${{ matrix.arch }}/* . | |
cd .. | |
if [ ${{ matrix.arch }} = "x86_64" ] || [ ${{ matrix.arch }} = "aarch64" ]; then | |
mv dependencies-mingw dependencies-mingw-64bit | |
fi | |
mkdir build | |
cd build | |
if [ ${{ matrix.arch }} = "i686" ] || [ ${{ matrix.arch }} = "x86_64" ]; then | |
_toolchain_file=../../../cmake/Toolchain-mxe-${{ matrix.arch }}.cmake | |
else | |
_toolchain_file=../../../cmake/Toolchain-llvm-mingw.cmake | |
fi | |
cmake .. -DMXE_PREFIX=/data/mxe/usr \ | |
-DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=${_toolchain_file} \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} | |
make -j4 | |
if [ ${{ matrix.arch }} = "i686" ] || [ ${{ matrix.arch }} = "x86_64" ]; then | |
strip libopenglrecorder.dll | |
fi | |
# Use dll2lib.sh will export Unwind symbols which will conflict libc++.a | |
$HOME/llvm-mingw/bin/llvm-dlltool -m ${{ env.dlltool_arch }} -d ../openglrecorder.def -D libopenglrecorder.dll -l libopenglrecorder.lib | |
cp libopenglrecorder.dll $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libopenglrecorder.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin 2>/dev/null || : | |
cp libopenglrecorder.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
cp -p ../openglrecorder.h $HOME/dependencies-win-${{ matrix.arch }}/include | |
- name: Build libsamplerate | |
run: | | |
cd src/libsamplerate | |
mkdir build | |
cd build | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DLIBSAMPLERATE_EXAMPLES=OFF | |
make -j5 | |
cd src | |
dll2lib.sh ${{ env.dlltool_arch }} libsamplerate-0.dll | |
mv libsamplerate-0.lib libsamplerate.lib | |
cd .. | |
make install | |
cp src/libsamplerate-0.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp src/libsamplerate.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/pkgconfig | |
rm -rf $HOME/dependencies-win-${{ matrix.arch }}/lib/cmake | |
rm -f $HOME/dependencies-win-${{ matrix.arch }}/lib/libsamplerate.dll.a | |
- name: Build astc-encoder | |
run: | | |
cd src/astc-encoder | |
sed -i '/-Werror/d' Source/cmake_core.cmake | |
sed -i 's/${ASTCENC_TARGET}-shared/astcenc/g' Source/cmake_core.cmake | |
mkdir build | |
cd build | |
# We require SSE4.1 (x86) or NEON (arm*) for astc-encoder | |
if [ ${{ matrix.arch }} = "armv7" ]; then | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DASTCENC_ISA_NEON=OFF -DASTCENC_INVARIANCE=OFF -DASTCENC_CLI=OFF \ | |
-DASTCENC_SHAREDLIB=ON | |
elif [ ${{ matrix.arch }} = "aarch64" ]; then | |
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-llvm-mingw.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DASTCENC_ISA_NEON=ON -DASTCENC_INVARIANCE=OFF -DASTCENC_CLI=OFF \ | |
-DASTCENC_SHAREDLIB=ON | |
else | |
if [ ${{ matrix.arch }} = "i686" ]; then | |
sed -i 's/_mm_popcnt_u64/__builtin_popcountll/g' ../Source/astcenc_vecmathlib_sse_4.h | |
fi | |
sed -i 's/_mm_round_ps(a.m, flags)/_mm_round_ps(a.m, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC)/g' ../Source/astcenc_vecmathlib_sse_4.h | |
cmake .. -DMXE_PREFIX=/data/mxe/usr \ | |
-DCMAKE_TOOLCHAIN_FILE=../../../cmake/Toolchain-mxe-${{ matrix.arch }}.cmake \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DASTCENC_ISA_SSE41=ON -DASTCENC_INVARIANCE=OFF -DASTCENC_CLI=OFF \ | |
-DASTCENC_SHAREDLIB=ON -DCMAKE_C_FLAGS='-O2' -DCMAKE_CXX_FLAGS='-O2' | |
fi | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} Source/libastcenc.dll | |
cp Source/libastcenc.dll $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp Source/libastcenc.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin 2>/dev/null || : | |
cp Source/libastcenc.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
cp -p ../Source/astcenc.h $HOME/dependencies-win-${{ matrix.arch }}/include | |
- name: Build shaderc | |
run: | | |
cd src/shaderc | |
utils/git-sync-deps | |
if [ ${{ matrix.arch }} = "i686" ] || [ ${{ matrix.arch }} = "x86_64" ]; then | |
_toolchain_file=../../../cmake/Toolchain-mxe-${{ matrix.arch }}.cmake | |
sed -i 's/(defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API)/0/g' third_party/glslang/glslang/Include/Common.h | |
else | |
_toolchain_file=../../../cmake/Toolchain-llvm-mingw.cmake | |
fi | |
mkdir build | |
cd build | |
cmake .. -DMXE_PREFIX=/data/mxe/usr \ | |
-DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=$HOME/llvm-mingw \ | |
-DCMAKE_TOOLCHAIN_FILE=${_toolchain_file} \ | |
-DCMAKE_INSTALL_PREFIX=$HOME/dependencies-win-${{ matrix.arch }} \ | |
-DCMAKE_BUILD_TYPE=Release -DSHADERC_SKIP_INSTALL=1 \ | |
-DSHADERC_SKIP_TESTS=1 -DSHADERC_SKIP_EXAMPLES=1 \ | |
-DSPIRV_HEADERS_SKIP_INSTALL=1 -DSPIRV_HEADERS_SKIP_EXAMPLES=1 \ | |
-DSKIP_SPIRV_TOOLS_INSTALL=1 -DSPIRV_SKIP_TESTS=1 \ | |
-DSPIRV_SKIP_EXECUTABLES=1 -DENABLE_GLSLANG_BINARIES=0 \ | |
-DENABLE_CTEST=0 | |
make -j4 | |
dll2lib.sh ${{ env.dlltool_arch }} libshaderc/libshaderc_shared.dll | |
cp libshaderc/libshaderc_shared.dll $HOME/dependencies-win-${{ matrix.arch }}/bin | |
cp libshaderc/libshaderc_shared.pdb $HOME/dependencies-win-${{ matrix.arch }}/bin 2>/dev/null || : | |
cp libshaderc/libshaderc_shared.lib $HOME/dependencies-win-${{ matrix.arch }}/lib | |
cp -ra ../libshaderc/include/shaderc $HOME/dependencies-win-${{ matrix.arch }}/include | |
- name: Archive | |
run: | | |
FOLDER=$(pwd) | |
cd | |
rm -rf dependencies-win-${{ matrix.arch }}/share | |
zip -r $FOLDER/dependencies-win-${{ matrix.arch }}.zip dependencies-win-${{ matrix.arch }} | |
- name: Upload windows deps | |
uses: ncipollo/release-action@v1.11.2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "dependencies*.zip" | |
tag: ${{ env.release_name }} | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
allowUpdates: true | |
prerelease: ${{ env.release_pre }} |