update gitlab-ci build CI/CD Windos process for packaged minners

This commit is contained in:
mckaygerhard 2023-09-12 22:23:58 -04:00
parent 2f2c13068c
commit 3a9313b0c3
6 changed files with 84 additions and 44 deletions

View File

@ -1,7 +1,7 @@
---
# Github repository is really at minetest.org using the poikilos git.minetest.io
# https://gitlab.com/minenux/minetest-engine-multicraft2
# Pipelines URL: https://gitlab.com/minenux/minetest-engine-multicraft2/pipelines
# https://gitlab.com/minenux/minetest-engine-minetest
# Pipelines URL: https://gitlab.com/minenux/minetest-engine-minetest/pipelines
# packages moved to https://build.opensuse.org/project/show/home:venenux:minenux
# in future we only build here, or made apk packs for alpine
@ -258,20 +258,20 @@ build:fedora-38:
artifacts:
expire_in: 1h
paths:
- build/multicraft/_build/*
- build/minetest/_build/*
.package_win_template:
extends: .generic_win_template
stage: package
script:
- unzip build/multicraft/_build/multicraft-*.zip
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll multicraft-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll multicraft-*-win*/bin/
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll multicraft-*-win*/bin/
- unzip build/minetest/_build/minetest-*.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:
expire_in: 90 day
paths:
- multicraft-*-win*/*
- minetest-*-win*/*
build:win32:
extends: .build_win_template

View File

@ -1,6 +1,13 @@
#!/bin/bash
set -e
CORE_GIT=https://gitlab.com/minenux/minetest-engine-minetest
CORE_BRANCH=stable-4.X-namespace
CORE_NAME=minetest
GAME_GIT=https://gitlab.com/minenux/minetest-game-minetest
GAME_BRANCH=stable-5.2
GAME_NAME=minetest
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $# -ne 1 ]; then
echo "Usage: $0 <build directory>"
@ -12,17 +19,26 @@ builddir="$( cd "$builddir" && pwd )"
packagedir=$builddir/packages
libdir=$builddir/libs
toolchain_file=$dir/toolchain_mingw.cmake
# Test which win32 compiler is present
which i586-mingw32msvc-windres &>/dev/null && toolchain_file=$dir/toolchain_i586-mingw32msvc.cmake
which i686-w64-mingw32-windres &>/dev/null && toolchain_file=$dir/toolchain_i646-w64-mingw32.cmake
if [ -z "$toolchain_file" ]; then
echo "Unable to determine which mingw32 compiler to use"
exit 1
fi
echo "Using $toolchain_file"
irrlicht_version=1.8.4
ogg_version=1.3.2
vorbis_version=1.3.5
curl_version=7.54.0
gettext_version=0.19.8.1
freetype_version=2.8
sqlite3_version=3.19.2
luajit_version=2.1.0-beta3
leveldb_version=1.19
zlib_version=1.2.11
ogg_version=1.3.5
vorbis_version=1.3.7
curl_version=8.0.1
gettext_version=0.20.2
freetype_version=2.12.1
sqlite3_version=3.41.2
luajit_version=20230221
leveldb_version=1.23
zlib_version=1.2.13
mkdir -p $packagedir
mkdir -p $libdir
@ -42,8 +58,8 @@ cd $builddir
-c -O $packagedir/curl-$curl_version.zip
[ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version-win32.zip \
-c -O $packagedir/gettext-$gettext_version.zip
[ -e $packagedir/freetype2-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win32.zip \
-c -O $packagedir/freetype2-$freetype_version.zip
[ -e $packagedir/freetype-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype-$freetype_version-win32.zip \
-c -O $packagedir/freetype-$freetype_version.zip
[ -e $packagedir/sqlite3-$sqlite3_version.zip ] || wget http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win32.zip \
-c -O $packagedir/sqlite3-$sqlite3_version.zip
[ -e $packagedir/luajit-$luajit_version.zip ] || wget http://minetest.kitsunemimi.pw/luajit-$luajit_version-win32.zip \
@ -61,7 +77,7 @@ cd $libdir
[ -d libvorbis ] || unzip -o $packagedir/libvorbis-$vorbis_version.zip -d libvorbis
[ -d libcurl ] || unzip -o $packagedir/curl-$curl_version.zip -d libcurl
[ -d gettext ] || unzip -o $packagedir/gettext-$gettext_version.zip -d gettext
[ -d freetype ] || unzip -o $packagedir/freetype2-$freetype_version.zip -d freetype
[ -d freetype ] || unzip -o $packagedir/freetype-$freetype_version.zip -d freetype
[ -d sqlite3 ] || unzip -o $packagedir/sqlite3-$sqlite3_version.zip -d sqlite3
[ -d openal_stripped ] || unzip -o $packagedir/openal_stripped.zip
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
@ -70,17 +86,17 @@ cd $libdir
# Get minetest
cd $builddir
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
ln -s $EXISTING_MINETEST_DIR minetest
cd /$EXISTING_MINETEST_DIR # must be absolute path
else
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME)
cd $CORE_NAME
fi
cd minetest
git_hash=$(git rev-parse --short HEAD)
# Get minetest_game
cd games
if [ "x$NO_MINETEST_GAME" = "x" ]; then
[ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT $GAME_NAME)
fi
cd ../..
@ -149,7 +165,7 @@ cmake .. \
-DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \
-DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll
make -j2
make -j$(nproc)
[ "x$NO_PACKAGE" = "x" ] && make package

View File

@ -1,6 +1,13 @@
#!/bin/bash
set -e
CORE_GIT=https://gitlab.com/minenux/minetest-engine-minetest
CORE_BRANCH=stable-4.X-namespace
CORE_NAME=minetest
GAME_GIT=https://gitlab.com/minenux/minetest-game-minetest
GAME_BRANCH=stable-5.2
GAME_NAME=minetest
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $# -ne 1 ]; then
echo "Usage: $0 <build directory>"
@ -12,17 +19,17 @@ builddir="$( cd "$builddir" && pwd )"
packagedir=$builddir/packages
libdir=$builddir/libs
toolchain_file=$dir/toolchain_mingw64.cmake
toolchain_file=$dir/toolchain_x86_64-w64-mingw32.cmake
irrlicht_version=1.8.4
ogg_version=1.3.2
vorbis_version=1.3.5
curl_version=7.54.0
gettext_version=0.19.8.1
freetype_version=2.8
sqlite3_version=3.19.2
luajit_version=2.1.0-beta3
leveldb_version=1.19
zlib_version=1.2.11
ogg_version=1.3.5
vorbis_version=1.3.7
curl_version=8.0.1
gettext_version=0.20.2
freetype_version=2.12.1
sqlite3_version=3.41.2
luajit_version=20230221
leveldb_version=1.23
zlib_version=1.2.13
mkdir -p $packagedir
mkdir -p $libdir
@ -42,8 +49,8 @@ cd $builddir
-c -O $packagedir/curl-$curl_version.zip
[ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version-win64.zip \
-c -O $packagedir/gettext-$gettext_version.zip
[ -e $packagedir/freetype2-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win64.zip \
-c -O $packagedir/freetype2-$freetype_version.zip
[ -e $packagedir/freetype-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype-$freetype_version-win64.zip \
-c -O $packagedir/freetype-$freetype_version.zip
[ -e $packagedir/sqlite3-$sqlite3_version.zip ] || wget http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win64.zip \
-c -O $packagedir/sqlite3-$sqlite3_version.zip
[ -e $packagedir/luajit-$luajit_version.zip ] || wget http://minetest.kitsunemimi.pw/luajit-$luajit_version-win64.zip \
@ -62,7 +69,7 @@ cd $libdir
[ -d libvorbis ] || unzip -o $packagedir/libvorbis-$vorbis_version.zip -d libvorbis
[ -d libcurl ] || unzip -o $packagedir/curl-$curl_version.zip -d libcurl
[ -d gettext ] || unzip -o $packagedir/gettext-$gettext_version.zip -d gettext
[ -d freetype ] || unzip -o $packagedir/freetype2-$freetype_version.zip -d freetype
[ -d freetype ] || unzip -o $packagedir/freetype-$freetype_version.zip -d freetype
[ -d sqlite3 ] || unzip -o $packagedir/sqlite3-$sqlite3_version.zip -d sqlite3
[ -d openal_stripped ] || unzip -o $packagedir/openal_stripped.zip
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
@ -71,17 +78,17 @@ cd $libdir
# Get minetest
cd $builddir
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
ln -s $EXISTING_MINETEST_DIR minetest
cd /$EXISTING_MINETEST_DIR # must be absolute path
else
[ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME)
cd $CORE_NAME
fi
cd minetest
git_hash=$(git rev-parse --short HEAD)
# Get minetest_game
cd games
if [ "x$NO_MINETEST_GAME" = "x" ]; then
[ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT $GAME_NAME)
fi
cd ../..
@ -150,7 +157,7 @@ cmake .. \
-DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \
-DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll
make -j2
make -j$(nproc)
[ "x$NO_PACKAGE" = "x" ] && make package

View File

@ -0,0 +1,17 @@
# name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)