aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-04-11 17:10:06 +0200
committerGitHub <noreply@github.com>2021-04-11 17:10:06 +0200
commit4d0fef8ae87aa7b940d43485e7f6466eaa3d111e (patch)
tree24a270c7ff3071ab50b9a4e3e9f111695eaf0f9a /util
parent4b8209d9a44425156ba89a4763f63ea088daccb3 (diff)
downloadminetest-4d0fef8ae87aa7b940d43485e7f6466eaa3d111e.tar.gz
minetest-4d0fef8ae87aa7b940d43485e7f6466eaa3d111e.tar.bz2
minetest-4d0fef8ae87aa7b940d43485e7f6466eaa3d111e.zip
Buildbot changes to allow out-of-tree builds (#11180)
* Do proper out-of-tree builds with buildbot * Don't write to bin/ for cross builds * This allows safely building multiple builds from the same source dir, e.g. with the buildbot. * Disable Gettext (by default) and Freetype (entirely) for server builds
Diffstat (limited to 'util')
-rwxr-xr-xutil/buildbot/buildwin32.sh40
-rwxr-xr-xutil/buildbot/buildwin64.sh39
2 files changed, 39 insertions, 40 deletions
diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh
index 1a66a9764..df62062c9 100755
--- a/util/buildbot/buildwin32.sh
+++ b/util/buildbot/buildwin32.sh
@@ -85,36 +85,36 @@ cd $libdir
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
-# Get minetest
-cd $builddir
-if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
- cd /$EXISTING_MINETEST_DIR # must be absolute path
+# Set source dir, downloading Minetest as needed
+if [ -n "$EXISTING_MINETEST_DIR" ]; then
+ sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )"
else
- [ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
- cd $CORE_NAME
+ sourcedir=$PWD/$CORE_NAME
+ [ -d $CORE_NAME ] && { pushd $CORE_NAME; git pull; popd; } || \
+ git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME
+ if [ -z "$NO_MINETEST_GAME" ]; then
+ [ -d games/$GAME_NAME ] && { pushd games/$GAME_NAME; git pull; popd; } || \
+ git clone -b $GAME_BRANCH $GAME_GIT games/$GAME_NAME
+ fi
fi
-git_hash=$(git rev-parse --short HEAD)
-# Get minetest_game
-if [ "x$NO_MINETEST_GAME" = "x" ]; then
- cd games
- [ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
- cd ..
-fi
+git_hash=$(cd $sourcedir && git rev-parse --short HEAD)
+
+# Build the thing
+cd $builddir
+[ -d build ] && rm -rf build
+mkdir build
+cd build
irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';')
vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';')
gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';')
-# Build the thing
-[ -d _build ] && rm -Rf _build/
-mkdir _build
-cd _build
-cmake .. \
+cmake -S $sourcedir -B . \
+ -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
-DCMAKE_INSTALL_PREFIX=/tmp \
-DVERSION_EXTRA=$git_hash \
-DBUILD_CLIENT=1 -DBUILD_SERVER=0 \
- -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
\
-DENABLE_SOUND=1 \
-DENABLE_CURL=1 \
@@ -170,7 +170,7 @@ cmake .. \
make -j$(nproc)
-[ "x$NO_PACKAGE" = "x" ] && make package
+[ -z "$NO_PACKAGE" ] && make package
exit 0
# EOF
diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh
index 54bfbef69..c35ece35b 100755
--- a/util/buildbot/buildwin64.sh
+++ b/util/buildbot/buildwin64.sh
@@ -60,7 +60,6 @@ cd $builddir
[ -e $packagedir/openal_stripped.zip ] || wget http://minetest.kitsunemimi.pw/openal_stripped64.zip \
-c -O $packagedir/openal_stripped.zip
-
# Extract stuff
cd $libdir
[ -d irrlicht ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip -d irrlicht
@@ -75,32 +74,32 @@ cd $libdir
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
-# Get minetest
-cd $builddir
-if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
- cd /$EXISTING_MINETEST_DIR # must be absolute path
+# Set source dir, downloading Minetest as needed
+if [ -n "$EXISTING_MINETEST_DIR" ]; then
+ sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )"
else
- [ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
- cd $CORE_NAME
+ sourcedir=$PWD/$CORE_NAME
+ [ -d $CORE_NAME ] && { pushd $CORE_NAME; git pull; popd; } || \
+ git clone -b $CORE_BRANCH $CORE_GIT $CORE_NAME
+ if [ -z "$NO_MINETEST_GAME" ]; then
+ [ -d games/$GAME_NAME ] && { pushd games/$GAME_NAME; git pull; popd; } || \
+ git clone -b $GAME_BRANCH $GAME_GIT games/$GAME_NAME
+ fi
fi
-git_hash=$(git rev-parse --short HEAD)
-# Get minetest_game
-if [ "x$NO_MINETEST_GAME" = "x" ]; then
- cd games
- [ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
- cd ..
-fi
+git_hash=$(cd $sourcedir && git rev-parse --short HEAD)
+
+# Build the thing
+cd $builddir
+[ -d build ] && rm -rf build
+mkdir build
+cd build
irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';')
vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';')
gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';')
-# Build the thing
-[ -d _build ] && rm -Rf _build/
-mkdir _build
-cd _build
-cmake .. \
+cmake -S $sourcedir -B . \
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
-DCMAKE_INSTALL_PREFIX=/tmp \
-DVERSION_EXTRA=$git_hash \
@@ -160,7 +159,7 @@ cmake .. \
make -j$(nproc)
-[ "x$NO_PACKAGE" = "x" ] && make package
+[ -z "$NO_PACKAGE" ] && make package
exit 0
# EOF