mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
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
This commit is contained in:
parent
4b8209d9a4
commit
4d0fef8ae8
@ -55,7 +55,7 @@ if(NOT USE_CURL)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
option(ENABLE_GETTEXT "Use GetText for internationalization" TRUE)
|
option(ENABLE_GETTEXT "Use GetText for internationalization" ${BUILD_CLIENT})
|
||||||
set(USE_GETTEXT FALSE)
|
set(USE_GETTEXT FALSE)
|
||||||
|
|
||||||
if(ENABLE_GETTEXT)
|
if(ENABLE_GETTEXT)
|
||||||
@ -120,13 +120,13 @@ endif()
|
|||||||
option(ENABLE_FREETYPE "Enable FreeType2 (TrueType fonts and basic unicode support)" TRUE)
|
option(ENABLE_FREETYPE "Enable FreeType2 (TrueType fonts and basic unicode support)" TRUE)
|
||||||
set(USE_FREETYPE FALSE)
|
set(USE_FREETYPE FALSE)
|
||||||
|
|
||||||
if(ENABLE_FREETYPE)
|
if(BUILD_CLIENT AND ENABLE_FREETYPE)
|
||||||
find_package(Freetype)
|
find_package(Freetype)
|
||||||
if(FREETYPE_FOUND)
|
if(FREETYPE_FOUND)
|
||||||
message(STATUS "Freetype enabled.")
|
message(STATUS "Freetype enabled.")
|
||||||
set(USE_FREETYPE TRUE)
|
set(USE_FREETYPE TRUE)
|
||||||
endif()
|
endif()
|
||||||
endif(ENABLE_FREETYPE)
|
endif()
|
||||||
|
|
||||||
option(ENABLE_CURSES "Enable ncurses console" TRUE)
|
option(ENABLE_CURSES "Enable ncurses console" TRUE)
|
||||||
set(USE_CURSES FALSE)
|
set(USE_CURSES FALSE)
|
||||||
@ -526,8 +526,11 @@ if(USE_CURL)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
|
# When cross-compiling assume the user doesn't want to run the executable anyway,
|
||||||
|
# otherwise place it in <source dir>/bin/ since Minetest can only run from there.
|
||||||
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(BUILD_CLIENT)
|
if(BUILD_CLIENT)
|
||||||
add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS})
|
add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS})
|
||||||
|
@ -85,36 +85,36 @@ cd $libdir
|
|||||||
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
|
[ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
|
||||||
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
|
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
|
||||||
|
|
||||||
# Get minetest
|
# Set source dir, downloading Minetest as needed
|
||||||
cd $builddir
|
if [ -n "$EXISTING_MINETEST_DIR" ]; then
|
||||||
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
|
sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )"
|
||||||
cd /$EXISTING_MINETEST_DIR # must be absolute path
|
|
||||||
else
|
else
|
||||||
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
|
sourcedir=$PWD/$CORE_NAME
|
||||||
cd $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
|
fi
|
||||||
git_hash=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
# Get minetest_game
|
git_hash=$(cd $sourcedir && git rev-parse --short HEAD)
|
||||||
if [ "x$NO_MINETEST_GAME" = "x" ]; then
|
|
||||||
cd games
|
# Build the thing
|
||||||
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
|
cd $builddir
|
||||||
cd ..
|
[ -d build ] && rm -rf build
|
||||||
fi
|
mkdir build
|
||||||
|
cd build
|
||||||
|
|
||||||
irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';')
|
irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';')
|
||||||
vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';')
|
vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';')
|
||||||
gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';')
|
gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';')
|
||||||
|
|
||||||
# Build the thing
|
cmake -S $sourcedir -B . \
|
||||||
[ -d _build ] && rm -Rf _build/
|
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
||||||
mkdir _build
|
|
||||||
cd _build
|
|
||||||
cmake .. \
|
|
||||||
-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 \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
|
||||||
\
|
\
|
||||||
-DENABLE_SOUND=1 \
|
-DENABLE_SOUND=1 \
|
||||||
-DENABLE_CURL=1 \
|
-DENABLE_CURL=1 \
|
||||||
@ -170,7 +170,7 @@ cmake .. \
|
|||||||
|
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
[ "x$NO_PACKAGE" = "x" ] && make package
|
[ -z "$NO_PACKAGE" ] && make package
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
# EOF
|
# EOF
|
||||||
|
@ -60,7 +60,6 @@ cd $builddir
|
|||||||
[ -e $packagedir/openal_stripped.zip ] || wget http://minetest.kitsunemimi.pw/openal_stripped64.zip \
|
[ -e $packagedir/openal_stripped.zip ] || wget http://minetest.kitsunemimi.pw/openal_stripped64.zip \
|
||||||
-c -O $packagedir/openal_stripped.zip
|
-c -O $packagedir/openal_stripped.zip
|
||||||
|
|
||||||
|
|
||||||
# Extract stuff
|
# Extract stuff
|
||||||
cd $libdir
|
cd $libdir
|
||||||
[ -d irrlicht ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip -d irrlicht
|
[ -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 luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
|
||||||
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
|
[ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
|
||||||
|
|
||||||
# Get minetest
|
# Set source dir, downloading Minetest as needed
|
||||||
cd $builddir
|
if [ -n "$EXISTING_MINETEST_DIR" ]; then
|
||||||
if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
|
sourcedir="$( cd "$EXISTING_MINETEST_DIR" && pwd )"
|
||||||
cd /$EXISTING_MINETEST_DIR # must be absolute path
|
|
||||||
else
|
else
|
||||||
[ -d $CORE_NAME ] && (cd $CORE_NAME && git pull) || (git clone -b $CORE_BRANCH $CORE_GIT)
|
sourcedir=$PWD/$CORE_NAME
|
||||||
cd $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
|
fi
|
||||||
git_hash=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
# Get minetest_game
|
git_hash=$(cd $sourcedir && git rev-parse --short HEAD)
|
||||||
if [ "x$NO_MINETEST_GAME" = "x" ]; then
|
|
||||||
cd games
|
# Build the thing
|
||||||
[ -d $GAME_NAME ] && (cd $GAME_NAME && git pull) || (git clone -b $GAME_BRANCH $GAME_GIT)
|
cd $builddir
|
||||||
cd ..
|
[ -d build ] && rm -rf build
|
||||||
fi
|
mkdir build
|
||||||
|
cd build
|
||||||
|
|
||||||
irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';')
|
irr_dlls=$(echo $libdir/irrlicht/bin/*.dll | tr ' ' ';')
|
||||||
vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';')
|
vorbis_dlls=$(echo $libdir/libvorbis/bin/libvorbis{,file}-*.dll | tr ' ' ';')
|
||||||
gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';')
|
gettext_dlls=$(echo $libdir/gettext/bin/lib{intl,iconv}-*.dll | tr ' ' ';')
|
||||||
|
|
||||||
# Build the thing
|
cmake -S $sourcedir -B . \
|
||||||
[ -d _build ] && rm -Rf _build/
|
|
||||||
mkdir _build
|
|
||||||
cd _build
|
|
||||||
cmake .. \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
|
||||||
-DCMAKE_INSTALL_PREFIX=/tmp \
|
-DCMAKE_INSTALL_PREFIX=/tmp \
|
||||||
-DVERSION_EXTRA=$git_hash \
|
-DVERSION_EXTRA=$git_hash \
|
||||||
@ -160,7 +159,7 @@ cmake .. \
|
|||||||
|
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
[ "x$NO_PACKAGE" = "x" ] && make package
|
[ -z "$NO_PACKAGE" ] && make package
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
# EOF
|
# EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user