Skip to content

Commit

Permalink
Build ØMQ 4.0.1 with and without CZMQ 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
phuedx committed Oct 8, 2014
1 parent 8f4886f commit 1090d82
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ env:
- ZEROMQ_VERSION=v3.2.4
- ZEROMQ_VERSION=v4.0.0
- ZEROMQ_VERSION=v4.0.1

- ZEROMQ_VERSION=v4.0.1 WITH_CZMQ=true
before_install:
- sudo apt-get update
- sudo apt-get install uuid-dev
script: travis/script.sh $ZEROMQ_VERSION
script: travis/script.sh $ZEROMQ_VERSION $WITH_CZMQ
61 changes: 57 additions & 4 deletions travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,40 @@ install_zeromq() {
}


# Installs libsodium v0.7.0.
#
# Parameters:
#
# 1 - The directory to install libsodium to
install_libsodium() {
local libsodium_dir=$1

if test ! -d "/tmp/php-zmq-travis-support"
then
git clone https://github.com/phuedx/php-zmq-travis-support /tmp/php-zmq-travis-support
fi

ln -s "/tmp/php-zmq-travis-support/libsodium/libsodium-0.7.0" $libsodium_dir
}


# Installs CZMQ v2.2.0.
#
# Parameters:
#
# 1 - The directory to install CZMQ to
install_czmq() {
local czmq_dir=$1

if test ! -d "/tmp/php-zmq-travis-support"
then
git clone https://github.com/phuedx/php-zmq-travis-support /tmp/php-zmq-travis-support
fi

ln -s "/tmp/php-zmq-travis-support/czmq/czmq-2.2.0" $czmq_dir
}


# Ensures that the build directory exists and contains the extension and its
# tests by packaging and then extracting it to the build directory.
#
Expand All @@ -74,16 +108,24 @@ init_build_dir() {
#
# 1 - The directory of the extension and its tests
# 2 - The directory of the ØMQ library
# 3 - Whether or not to build the extension with CZMQ support
#
# Returns: the exit code of the test runner
make_test() {
local build_dir=$1
local zeromq_dir=$2
local with_czmq=$3
local with_czmq_option=""

if test $with_czmq = "true"
then
with_czmq_option="--with-czmq=/tmp/czmq"
fi

pushd $build_dir

phpize
./configure --with-zmq="$zeromq_dir"
./configure --with-zmq="$zeromq_dir" $with_czmq_option
make

NO_INTERACTION=1 \
Expand Down Expand Up @@ -121,14 +163,25 @@ for test_file in tests/*.phpt; do
done

zeromq_version=$1
with_czmq=$2

# NOTE (phuedx, 2014/07/07): This must be kept in sync with the configure
# command used to build ØMQ in phuedx/php-zmq-travis-support.
# NOTE (phuedx, 2014/07/07): These must be kept in sync with the configure
# command used to build libsodium, ØMQ and CZMQ in
# phuedx/php-zmq-travis-support.
libsodium_dir=/tmp/libsodium
zeromq_dir=/tmp/zeromq
czmq_dir=/tmp/czmq

build_dir=/tmp/build

install_libsodium $libsodium_dir
install_zeromq $zeromq_version $zeromq_dir

if test $with_czmq = "true"
then
install_czmq $czmq_dir
fi

init_build_dir $build_dir

make_test $build_dir $zeromq_dir
make_test $build_dir $zeromq_dir $with_czmq

0 comments on commit 1090d82

Please sign in to comment.