From 2f7dbd746eb9e4fc740d665fe9df5f7525f63eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 8 Nov 2014 14:02:30 +0100 Subject: [PATCH] core: add Travis CI builds with Python 3 and without GnuTLS --- .travis.yml | 10 +++++++--- scripts/build.sh | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b329e53f6..9f85b31e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,17 @@ compiler: - clang env: - - BUILDTOOL=cmake - - BUILDTOOL=autotools + - BUILDTOOL="cmake" BUILDARGS="" + - BUILDTOOL="cmake" BUILDARGS="-DENABLE_PYTHON3=ON" + - BUILDTOOL="cmake" BUILDARGS="-DENABLE_GNUTLS=OFF" + - BUILDTOOL="autotools" BUILDARGS="" + - BUILDTOOL="autotools" BUILDARGS="--enable-python3" + - BUILDTOOL="autotools" BUILDARGS="--disable-gnutls" before_script: - echo 'APT::Install-Recommends "false";' | sudo tee -a /etc/apt/apt.conf - sudo apt-get update -qq - - sudo apt-get -y install devscripts equivs python-pip libenchant-dev autopoint asciidoc source-highlight xsltproc docbook-xsl docbook-xml cmake pkg-config libncursesw5-dev gem2deb libperl-dev python-dev libaspell-dev liblua5.1-0-dev tcl8.5-dev guile-2.0-dev libcurl4-gnutls-dev libgcrypt11-dev libgnutls-dev zlib1g-dev + - sudo apt-get -y install devscripts equivs python-pip libenchant-dev autopoint asciidoc source-highlight xsltproc docbook-xsl docbook-xml cmake pkg-config libncursesw5-dev gem2deb libperl-dev python-dev python3-dev libaspell-dev liblua5.1-0-dev tcl8.5-dev guile-2.0-dev libcurl4-gnutls-dev libgcrypt11-dev libgnutls-dev zlib1g-dev - wget http://weechat.org/files/tests/ubuntu/precise/amd64/libcpputest-dev_3.4-3_amd64.deb - sudo dpkg -i libcpputest-dev_3.4-3_amd64.deb - sudo pip install msgcheck pylint diff --git a/scripts/build.sh b/scripts/build.sh index df2dcd1c8..da68ea56f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -21,6 +21,16 @@ # # Build WeeChat with CMake or autotools, according to environment variable # $BUILDTOOL or first script argument (if given). +# The optional variable $BUILDARGS can be set with arguments for cmake or +# configure commands. +# +# Syntax to run the script with environment variables: +# BUILDTOOL=cmake|autotools ./build.sh +# BUILDTOOL=cmake|autotools BUILDARGS="arguments" ./build.sh +# +# Syntax to run the script with arguments on command line: +# ./build.sh cmake|autotools +# ./build.sh cmake|autotools arguments # # This script is used to build WeeChat in Travis CI environment. # @@ -38,7 +48,12 @@ run () BUILDDIR="build-tmp-$$" if [ $# -ge 1 ]; then - BUILDTOOL=$1 + BUILDTOOL="$1" + shift +fi + +if [ $# -ge 1 ]; then + BUILDARGS="$*" fi if [ -z "$BUILDTOOL" ]; then @@ -52,7 +67,7 @@ run "cd $BUILDDIR" if [ "$BUILDTOOL" = "cmake" ]; then # build with CMake - run "cmake .. -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON" + run "cmake .. -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON ${BUILDARGS}" run "make VERBOSE=1 -j$(nproc)" run "sudo make install" run "ctest -V" @@ -61,7 +76,7 @@ fi if [ "$BUILDTOOL" = "autotools" ]; then # build with autotools run "../autogen.sh" - run "../configure --enable-man --enable-doc --enable-tests" + run "../configure --enable-man --enable-doc --enable-tests ${BUILDARGS}" run "make -j$(nproc)" run "sudo make install" run "./tests/tests -v"