Skip to content

Commit 07ee818

Browse files
committed
make libzmq build stage a script
so it's reusable outside Travis next step: run it as prepublish prior to build
1 parent 00bdcd4 commit 07ee818

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ binding.Makefile
1111
binding.target.gyp.mk
1212
gyp-mac-tool
1313
out/
14+
zmq

.travis.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,7 @@ before_install:
3030
- npm --version
3131
- test "$(uname)" = "Darwin" || export CXX=g++-4.8 CC=gcc-4.8
3232
- gcc --version
33-
- mkdir zmq
34-
- export ZMQ_PREFIX=`pwd`/zmq
35-
- export CFLAGS=-fPIC
36-
- export CXXFLAGS=-fPIC
37-
- export PKG_CONFIG_PATH=$ZMQ_PREFIX/lib/pkgconfig
38-
- echo $PKG_CONFIG_PATH
39-
- wget https://github.com/zeromq/zeromq4-1/archive/$ZMQ.tar.gz -O zeromq-$ZMQ.tar.gz
40-
- tar xzvf zeromq-$ZMQ.tar.gz
41-
- cd zeromq4-1-$ZMQ
42-
- ./autogen.sh
43-
- ./configure --prefix=$ZMQ_PREFIX --with-tweetnacl --with-relaxed --enable-static --disable-shared
44-
- V=1 make -j
45-
- make install
46-
- cd ..
33+
- sh build_libzmq.sh
4734

4835
install: env PKG_CONFIG_PATH=$ZMQ_PREFIX/lib/pkgconfig npm install
4936

build_libzmq.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
set -e
3+
4+
test -d zmq || mkdir zmq
5+
6+
export ZMQ=b539733cee0f47f9bf1a70dc7cb7ff20410d3380 # zeromq-4.1.5 prerelease for tweetnacl support
7+
realpath() {
8+
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
9+
}
10+
export ZMQ_PREFIX="$(dirname $(realpath $0))/zmq"
11+
export ZMQ_SRC_DIR=zeromq4-1-$ZMQ
12+
cd $ZMQ_PREFIX
13+
14+
export CFLAGS=-fPIC
15+
export CXXFLAGS=-fPIC
16+
export PKG_CONFIG_PATH=$ZMQ_PREFIX/lib/pkgconfig
17+
18+
test -f zeromq-$ZMQ.tar.gz || wget https://github.com/zeromq/zeromq4-1/archive/$ZMQ.tar.gz -O zeromq-$ZMQ.tar.gz
19+
test -d $ZMQ_SRC_DIR || tar xzf zeromq-$ZMQ.tar.gz
20+
cd $ZMQ_SRC_DIR
21+
22+
test -f configure || ./autogen.sh
23+
./configure --prefix=$ZMQ_PREFIX --with-tweetnacl --with-relaxed --enable-static --disable-shared
24+
V=1 make -j
25+
make install

0 commit comments

Comments
 (0)