aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/buildbot/toolchain_mingw64.cmake8
-rwxr-xr-xutil/bump_version.sh23
-rwxr-xr-xutil/travis/before_install.sh37
-rwxr-xr-xutil/travis/script.sh32
-rw-r--r--util/travis/toolchain_mingw.cmake.in23
5 files changed, 83 insertions, 40 deletions
diff --git a/util/buildbot/toolchain_mingw64.cmake b/util/buildbot/toolchain_mingw64.cmake
index 52d06cdc3..9a7ed82d8 100644
--- a/util/buildbot/toolchain_mingw64.cmake
+++ b/util/buildbot/toolchain_mingw64.cmake
@@ -2,12 +2,12 @@
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
-SET(CMAKE_C_COMPILER x86_64-mingw32-gcc)
-SET(CMAKE_CXX_COMPILER x86_64-mingw32-g++)
-SET(CMAKE_RC_COMPILER x86_64-mingw32-windres)
+SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
+SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
+SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-mingw32)
+SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
diff --git a/util/bump_version.sh b/util/bump_version.sh
index b45c63664..5ff69c8af 100755
--- a/util/bump_version.sh
+++ b/util/bump_version.sh
@@ -87,7 +87,7 @@ sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEW_VERSION_MINOR
sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEW_VERSION_PATCH)/" CMakeLists.txt || die "Failed to update VERSION_PATCH"
-sed -i -re "s/^\tset\(VERSION_PATCH \\\$.VERSION_PATCH}-dev\)$/\t#set(VERSION_PATCH \${VERSION_PATCH}-dev)/" CMakeLists.txt || die "Failed to disable -dev suffix"
+sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt || die "Failed to unset DEVELOPMENT_BUILD"
sed -i -re "s/^ANDROID_VERSION_CODE = [0-9]+$/ANDROID_VERSION_CODE = $NEW_ANDROID_VERSION_CODE/" build/android/Makefile || die "Failed to update ANDROID_VERSION_CODE"
@@ -98,3 +98,24 @@ sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" doc/menu_lua_api.txt || di
git add -f CMakeLists.txt build/android/Makefile doc/lua_api.txt doc/menu_lua_api.txt || die "git add failed"
git commit -m "Bump version to $NEW_VERSION" || die "git commit failed"
+
+############
+# Create tag
+############
+
+echo "Tagging $NEW_VERSION"
+
+git tag -a "$NEW_VERSION" -m "$NEW_VERSION" || die 'Adding tag failed'
+
+######################
+# Create revert commit
+######################
+
+echo 'Creating "revert to development" commit'
+
+sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt || die 'Failed to set DEVELOPMENT_BUILD'
+
+git add -f CMakeLists.txt || die 'git add failed'
+
+git commit -m "Continue with $NEW_VERSION-dev" || die 'git commit failed'
+
diff --git a/util/travis/before_install.sh b/util/travis/before_install.sh
index 0b1332308..b61118044 100755
--- a/util/travis/before_install.sh
+++ b/util/travis/before_install.sh
@@ -1,6 +1,6 @@
#!/bin/bash -e
-if [ $CC = "clang" ]; then
+if [[ $CC == "clang" ]]; then
export PATH="/usr/bin/:$PATH"
sudo sh -c 'echo "deb http://ppa.launchpad.net/eudoxos/llvm-3.1/ubuntu precise main" >> /etc/apt/sources.list'
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 92DE8183
@@ -8,22 +8,25 @@ if [ $CC = "clang" ]; then
sudo apt-get install llvm-3.1
sudo apt-get install clang
fi
-if [ $WINDOWS = "no" ]; then
+sudo apt-get install p7zip-full
+if [[ $PLATFORM == "Linux" ]]; then
sudo apt-get install libirrlicht-dev cmake libbz2-dev libpng12-dev \
- libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev \
- libvorbis-dev libopenal-dev gettext
-else
- sudo apt-get install p7zip-full
- if [ $WINDOWS = "32" ]; then
- wget http://sfan5.pf-control.de/mingw_w64_i686_ubuntu12.04_4.9.1.7z -O mingw.7z
- sed -e "s|%PREFIX%|i686-w64-mingw32|" \
- -e "s|%ROOTPATH%|/usr/i686-w64-mingw32|" \
- < util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw.cmake
- elif [ $WINDOWS = "64" ]; then
- wget http://sfan5.pf-control.de/mingw_w64_x86_64_ubuntu12.04_4.9.1.7z -O mingw.7z
- sed -e "s|%PREFIX%|x86_64-w64-mingw32|" \
- -e "s|%ROOTPATH%|/usr/x86_64-w64-mingw32|" \
- < util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw64.cmake
- fi
+ libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \
+ libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev gettext
+ # Linking to LevelDB is broken, use a custom build
+ wget http://sfan5.pf-control.de/libleveldb-1.18-ubuntu12.04.7z
+ sudo 7z x -o/usr libleveldb-1.18-ubuntu12.04.7z
+elif [[ $PLATFORM == "Win32" ]]; then
+ wget http://sfan5.pf-control.de/mingw_w64_i686_ubuntu12.04_4.9.1.7z -O mingw.7z
+ sed -e "s|%PREFIX%|i686-w64-mingw32|" \
+ -e "s|%ROOTPATH%|/usr/i686-w64-mingw32|" \
+ < util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw.cmake
+ sudo 7z x -y -o/usr mingw.7z
+elif [[ $PLATFORM == "Win64" ]]; then
+ wget http://sfan5.pf-control.de/mingw_w64_x86_64_ubuntu12.04_4.9.1.7z -O mingw.7z
+ sed -e "s|%PREFIX%|x86_64-w64-mingw32|" \
+ -e "s|%ROOTPATH%|/usr/x86_64-w64-mingw32|" \
+ < util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw64.cmake
sudo 7z x -y -o/usr mingw.7z
fi
+
diff --git a/util/travis/script.sh b/util/travis/script.sh
index a8e2634e9..756cc1de8 100755
--- a/util/travis/script.sh
+++ b/util/travis/script.sh
@@ -1,12 +1,21 @@
#!/bin/bash -e
-if [ $WINDOWS = "no" ]; then
+if [[ $PLATFORM == "Linux" ]]; then
mkdir -p travisbuild
cd travisbuild
- cmake -DENABLE_GETTEXT=1 ..
+ CMAKE_FLAGS='-DCMAKE_BUILD_TYPE=Debug \
+ -DRUN_IN_PLACE=TRUE \
+ -DENABLE_GETTEXT=TRUE'
+ # Clang builds with FreeType fail on Travis
+ if [[ $CC == "clang" ]]; then
+ CMAKE_FLAGS+=' -DENABLE_FREETYPE=FALSE'
+ fi
+ cmake $CMAKE_FLAGS ..
make -j2
-else
- [ $CC = "clang" ] && exit 1 # Not supposed to happen
+ echo "Running unit tests."
+ ../bin/minetest --run-unittests && exit 0
+elif [[ $PLATFORM == Win* ]]; then
+ [[ $CC == "clang" ]] && exit 1 # Not supposed to happen
# We need to have our build directory outside of the minetest directory because
# CMake will otherwise get very very confused with symlinks and complain that
# something is not a subdirectory of something even if it actually is.
@@ -17,8 +26,17 @@ else
# \/ \/ \/
# /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest/travisbuild/minetest
# You get the idea.
- OLDDIR=`pwd`
+ OLDDIR=$(pwd)
cd ..
- [ $WINDOWS = "32" ] && EXISTING_MINETEST_DIR=$OLDDIR NO_MINETEST_GAME=1 $OLDDIR/util/buildbot/buildwin32.sh travisbuild && exit 0
- [ $WINDOWS = "64" ] && EXISTING_MINETEST_DIR=$OLDDIR NO_MINETEST_GAME=1 $OLDDIR/util/buildbot/buildwin64.sh travisbuild && exit 0
+ export EXISTING_MINETEST_DIR=$OLDDIR
+ export NO_MINETEST_GAME=1
+ if [[ $PLATFORM == "Win32" ]]; then
+ $OLDDIR/util/buildbot/buildwin32.sh travisbuild && exit 0
+ elif [[ $PLATFORM == "Win64" ]]; then
+ $OLDDIR/util/buildbot/buildwin64.sh travisbuild && exit 0
+ fi
+else
+ echo "Unknown platform \"${PLATFORM}\"."
+ exit 1
fi
+
diff --git a/util/travis/toolchain_mingw.cmake.in b/util/travis/toolchain_mingw.cmake.in
index 44830eb60..65f67517e 100644
--- a/util/travis/toolchain_mingw.cmake.in
+++ b/util/travis/toolchain_mingw.cmake.in
@@ -1,17 +1,18 @@
-# name of the target operating system
-SET(CMAKE_SYSTEM_NAME Windows)
+# Target operating system name
+set(CMAKE_SYSTEM_NAME Windows)
-# which compilers to use for C and C++
-SET(CMAKE_C_COMPILER %PREFIX%-gcc)
-SET(CMAKE_CXX_COMPILER %PREFIX%-g++)
-SET(CMAKE_RC_COMPILER %PREFIX%-windres)
+# Compilers to use
+set(CMAKE_C_COMPILER %PREFIX%-gcc)
+set(CMAKE_CXX_COMPILER %PREFIX%-g++)
+set(CMAKE_RC_COMPILER %PREFIX%-windres)
-# here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH %ROOTPATH%)
+# Location of the target environment
+set(CMAKE_FIND_ROOT_PATH %ROOTPATH%)
-# adjust the default behaviour of the FIND_XXX() commands:
-# search headers and libraries in the target environment, search
-# programs in the host environment
+# Adjust the default behaviour of the FIND_XXX() commands:
+# search for headers and libraries in the target environment,
+# search for 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)
+