Skip to content

Commit 598e687

Browse files
committed
Move build_libzmq.sh -> scripts/build_libzmq.sh
1 parent 8eb41ec commit 598e687

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

build_libzmq.sh renamed to scripts/build_libzmq.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ ZMQ_REPO=zeromq/zeromq4-1
99
realpath() {
1010
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
1111
}
12-
export ZMQ_PREFIX="$(dirname $(realpath $0))/zmq"
12+
export MAIN_DIR="$(dirname $(realpath $0))/../"
13+
export ZMQ_PREFIX=$MAIN_DIR/zmq
1314
export ZMQ_SRC_DIR=zeromq-$ZMQ
1415
cd $ZMQ_PREFIX
1516

1617
export CFLAGS=-fPIC
1718
export CXXFLAGS=-fPIC
1819
export PKG_CONFIG_PATH=$ZMQ_PREFIX/lib/pkgconfig
1920

20-
test -f zeromq-$ZMQ.tar.gz || ZMQ=$ZMQ ZMQ_REPO=$ZMQ_REPO node ../scripts/download-zmq.js
21+
test -f zeromq-$ZMQ.tar.gz || ZMQ=$ZMQ ZMQ_REPO=$ZMQ_REPO node $MAIN_DIR/scripts/download-zmq.js
2122
test -d $ZMQ_SRC_DIR || tar xzf zeromq-$ZMQ.tar.gz
2223
cd $ZMQ_SRC_DIR
2324

scripts/preinstall.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
var download = require('./download').download;
2+
var spawn = require('child_process').spawn;
3+
var path = require('path');
4+
var fs = require('fs');
5+
16
if (process.platform === 'win32') {
27
console.log('Downloading libzmq for Windows')
3-
var download = require('./download').download;
4-
var path = require('path');
5-
var fs = require('fs');
68

79
var TAR_URL = 'https://github.com/nteract/libzmq-win/releases/download/v1.0.0/libzmq-' + process.arch + '.lib';
810
var DIR_NAME = path.join(__dirname, '..', 'windows', 'lib');
@@ -16,12 +18,11 @@ if (process.platform === 'win32') {
1618
} else {
1719
console.log('Building libzmq for ' + process.platform)
1820

19-
var spawn = require('child_process').spawn;
20-
var child = spawn('./build_libzmq.sh');
21+
var child = spawn('./scripts/build_libzmq.sh');
2122

2223
child.stdout.pipe(process.stdout);
2324
child.stderr.pipe(process.stderr);
2425
child.on('error', (err) => {
25-
console.log('Failed to start child process.');
26-
});
26+
console.log('Failed to start child process.');
27+
});
2728
}

0 commit comments

Comments
 (0)