Automatically package MinGW runtime in buildbot

This commit is contained in:
sfan5 2021-10-25 22:33:13 +02:00 committed by rubenwardy
parent ea1396f856
commit 0b95da7ad3
5 changed files with 34 additions and 39 deletions

@ -204,19 +204,6 @@ build:fedora-28:
.build_win_template: .build_win_template:
extends: .generic_win_template extends: .generic_win_template
stage: build stage: build
artifacts:
expire_in: 1h
paths:
- build/build/*.zip
.package_win_template:
extends: .generic_win_template
stage: package
script:
- unzip build/build/*.zip
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll minetest-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll minetest-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll minetest-*-win*/bin/
artifacts: artifacts:
expire_in: 90 day expire_in: 90 day
paths: paths:
@ -226,28 +213,15 @@ build:win32:
extends: .build_win_template extends: .build_win_template
script: script:
- EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh build - EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh build
- unzip -q build/build/*.zip
variables: variables:
WIN_ARCH: "i686" WIN_ARCH: "i686"
package:win32:
extends: .package_win_template
needs:
- build:win32
variables:
WIN_ARCH: "i686"
build:win64: build:win64:
extends: .build_win_template extends: .build_win_template
script: script:
- EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh build - EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh build
variables: - unzip -q build/build/*.zip
WIN_ARCH: "x86_64"
package:win64:
extends: .package_win_template
needs:
- build:win64
variables: variables:
WIN_ARCH: "x86_64" WIN_ARCH: "x86_64"

@ -269,6 +269,7 @@ Library specific options:
CURL_LIBRARY - Only if building with cURL; path to libcurl.a/libcurl.so/libcurl.lib CURL_LIBRARY - Only if building with cURL; path to libcurl.a/libcurl.so/libcurl.lib
EGL_INCLUDE_DIR - Only if building with GLES; directory that contains egl.h EGL_INCLUDE_DIR - Only if building with GLES; directory that contains egl.h
EGL_LIBRARY - Only if building with GLES; path to libEGL.a/libEGL.so EGL_LIBRARY - Only if building with GLES; path to libEGL.a/libEGL.so
EXTRA_DLL - Only on Windows; optional paths to additional DLLs that should be packaged
FREETYPE_INCLUDE_DIR_freetype2 - Only if building with FreeType 2; directory that contains an freetype directory with files such as ftimage.h in it FREETYPE_INCLUDE_DIR_freetype2 - Only if building with FreeType 2; directory that contains an freetype directory with files such as ftimage.h in it
FREETYPE_INCLUDE_DIR_ft2build - Only if building with FreeType 2; directory that contains ft2build.h FREETYPE_INCLUDE_DIR_ft2build - Only if building with FreeType 2; directory that contains ft2build.h
FREETYPE_LIBRARY - Only if building with FreeType 2; path to libfreetype.a/libfreetype.so/freetype.lib FREETYPE_LIBRARY - Only if building with FreeType 2; path to libfreetype.a/libfreetype.so/freetype.lib

@ -278,10 +278,12 @@ if(WIN32)
endif() endif()
set(PLATFORM_LIBS ws2_32.lib version.lib shlwapi.lib ${PLATFORM_LIBS}) set(PLATFORM_LIBS ws2_32.lib version.lib shlwapi.lib ${PLATFORM_LIBS})
set(EXTRA_DLL "" CACHE FILEPATH "Optional paths to additional DLLs that should be packaged")
# DLLs are automatically copied to the output directory by vcpkg when VCPKG_APPLOCAL_DEPS=ON # DLLs are automatically copied to the output directory by vcpkg when VCPKG_APPLOCAL_DEPS=ON
if(NOT VCPKG_APPLOCAL_DEPS) if(NOT VCPKG_APPLOCAL_DEPS)
find_file(ZLIB_DLL NAMES "" DOC "Path to Zlib DLL for installation (optional)") set(ZLIB_DLL "" CACHE FILEPATH "Path to Zlib DLL for installation (optional)")
find_file(ZSTD_DLL NAMES "" DOC "Path to Zstd DLL for installation (optional)") set(ZSTD_DLL "" CACHE FILEPATH "Path to Zstd DLL for installation (optional)")
if(ENABLE_SOUND) if(ENABLE_SOUND)
set(OPENAL_DLL "" CACHE FILEPATH "Path to OpenAL32.dll for installation (optional)") set(OPENAL_DLL "" CACHE FILEPATH "Path to OpenAL32.dll for installation (optional)")
set(OGG_DLL "" CACHE FILEPATH "Path to libogg.dll for installation (optional)") set(OGG_DLL "" CACHE FILEPATH "Path to libogg.dll for installation (optional)")
@ -294,7 +296,6 @@ if(WIN32)
set(LUA_DLL "" CACHE FILEPATH "Path to luajit-5.1.dll for installation (optional)") set(LUA_DLL "" CACHE FILEPATH "Path to luajit-5.1.dll for installation (optional)")
endif() endif()
endif() endif()
else() else()
# Unix probably # Unix probably
if(BUILD_CLIENT) if(BUILD_CLIENT)
@ -794,6 +795,9 @@ endif()
# Installation # Installation
if(WIN32) if(WIN32)
if(EXTRA_DLL)
install(FILES ${EXTRA_DLL} DESTINATION ${BINDIR})
endif()
if(VCPKG_APPLOCAL_DEPS) if(VCPKG_APPLOCAL_DEPS)
# Collect the dll's from the output path # Collect the dll's from the output path
install(DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/Release/ install(DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/Release/

@ -20,16 +20,24 @@ libdir=$builddir/libs
# Test which win32 compiler is present # Test which win32 compiler is present
command -v i686-w64-mingw32-gcc >/dev/null && command -v i686-w64-mingw32-gcc >/dev/null &&
toolchain_file=$dir/toolchain_i686-w64-mingw32.cmake compiler=i686-w64-mingw32-gcc
command -v i686-w64-mingw32-gcc-posix >/dev/null && command -v i686-w64-mingw32-gcc-posix >/dev/null &&
toolchain_file=$dir/toolchain_i686-w64-mingw32-posix.cmake compiler=i686-w64-mingw32-gcc-posix
if [ -z "$toolchain_file" ]; then if [ -z "$compiler" ]; then
echo "Unable to determine which mingw32 compiler to use" echo "Unable to determine which mingw32 compiler to use"
exit 1 exit 1
fi fi
toolchain_file=$dir/toolchain_${compiler%-gcc}.cmake
echo "Using $toolchain_file" echo "Using $toolchain_file"
tmp=$(dirname "$(command -v $compiler)")/../i686-w64-mingw32/bin
runtime_dlls=
[ -d "$tmp" ] && runtime_dlls=$(echo $tmp/lib{gcc_,stdc++-,winpthread-}*.dll | tr ' ' ';')
[ -z "$runtime_dlls" ] &&
echo "The compiler runtime DLLs could not be found, they might be missing in the final package."
# Get stuff
irrlicht_version=1.9.0mt3 irrlicht_version=1.9.0mt3
ogg_version=1.3.4 ogg_version=1.3.4
vorbis_version=1.3.7 vorbis_version=1.3.7
@ -63,7 +71,6 @@ download () {
fi fi
} }
# Get stuff
cd $libdir cd $libdir
download "https://github.com/minetest/irrlicht/releases/download/$irrlicht_version/win32.zip" irrlicht-$irrlicht_version.zip download "https://github.com/minetest/irrlicht/releases/download/$irrlicht_version/win32.zip" irrlicht-$irrlicht_version.zip
download "http://minetest.kitsunemimi.pw/zlib-$zlib_version-win32.zip" download "http://minetest.kitsunemimi.pw/zlib-$zlib_version-win32.zip"
@ -108,6 +115,7 @@ cmake -S $sourcedir -B . \
-DCMAKE_INSTALL_PREFIX=/tmp \ -DCMAKE_INSTALL_PREFIX=/tmp \
-DVERSION_EXTRA=$git_hash \ -DVERSION_EXTRA=$git_hash \
-DBUILD_CLIENT=1 -DBUILD_SERVER=0 \ -DBUILD_CLIENT=1 -DBUILD_SERVER=0 \
-DEXTRA_DLL="$runtime_dll" \
\ \
-DENABLE_SOUND=1 \ -DENABLE_SOUND=1 \
-DENABLE_CURL=1 \ -DENABLE_CURL=1 \

@ -20,16 +20,24 @@ libdir=$builddir/libs
# Test which win64 compiler is present # Test which win64 compiler is present
command -v x86_64-w64-mingw32-gcc >/dev/null && command -v x86_64-w64-mingw32-gcc >/dev/null &&
toolchain_file=$dir/toolchain_x86_64-w64-mingw32.cmake compiler=x86_64-w64-mingw32
command -v x86_64-w64-mingw32-gcc-posix >/dev/null && command -v x86_64-w64-mingw32-gcc-posix >/dev/null &&
toolchain_file=$dir/toolchain_x86_64-w64-mingw32-posix.cmake compiler=x86_64-w64-mingw32-posix
if [ -z "$toolchain_file" ]; then if [ -z "$compiler" ]; then
echo "Unable to determine which mingw32 compiler to use" echo "Unable to determine which mingw32 compiler to use"
exit 1 exit 1
fi fi
toolchain_file=$dir/toolchain_${compiler%-gcc}.cmake
echo "Using $toolchain_file" echo "Using $toolchain_file"
tmp=$(dirname "$(command -v $compiler)")/../x86_64-w64-mingw32/bin
runtime_dlls=
[ -d "$tmp" ] && runtime_dlls=$(echo $tmp/lib{gcc_,stdc++-,winpthread-}*.dll | tr ' ' ';')
[ -z "$runtime_dlls" ] &&
echo "The compiler runtime DLLs could not be found, they might be missing in the final package."
# Get stuff
irrlicht_version=1.9.0mt3 irrlicht_version=1.9.0mt3
ogg_version=1.3.4 ogg_version=1.3.4
vorbis_version=1.3.7 vorbis_version=1.3.7
@ -63,7 +71,6 @@ download () {
fi fi
} }
# Get stuff
cd $libdir cd $libdir
download "https://github.com/minetest/irrlicht/releases/download/$irrlicht_version/win64.zip" irrlicht-$irrlicht_version.zip download "https://github.com/minetest/irrlicht/releases/download/$irrlicht_version/win64.zip" irrlicht-$irrlicht_version.zip
download "http://minetest.kitsunemimi.pw/zlib-$zlib_version-win64.zip" download "http://minetest.kitsunemimi.pw/zlib-$zlib_version-win64.zip"
@ -108,6 +115,7 @@ cmake -S $sourcedir -B . \
-DCMAKE_INSTALL_PREFIX=/tmp \ -DCMAKE_INSTALL_PREFIX=/tmp \
-DVERSION_EXTRA=$git_hash \ -DVERSION_EXTRA=$git_hash \
-DBUILD_CLIENT=1 -DBUILD_SERVER=0 \ -DBUILD_CLIENT=1 -DBUILD_SERVER=0 \
-DEXTRA_DLL="$runtime_dll" \
\ \
-DENABLE_SOUND=1 \ -DENABLE_SOUND=1 \
-DENABLE_CURL=1 \ -DENABLE_CURL=1 \