33set -eu
44set -o pipefail
55
6- # Point to or-tools upstream mason package commit until we have a
7- # new mason release. See https://github.com/mapbox/mason/pull/426
8- MASON_RELEASE=" ca9b4cb"
6+ MASON_RELEASE=" v0.19.0"
97SPARSEHASH_RELEASE=" 2.0.2"
108ORTOOLS_RELEASE=" 6.0"
119PROTOBUF_RELEASE=" 3.0.0"
@@ -17,8 +15,10 @@ if [[ ! -d ./third_party/mason ]]; then
1715 mkdir -p ./third_party/mason
1816 echo " Downloading Mason @${MASON_RELEASE} "
1917 curl -sSfL https://github.com/mapbox/mason/archive/${MASON_RELEASE} .tar.gz | tar --gunzip --extract --strip-components=1 --directory=./third_party/mason
18+ echo " Mason @${MASON_RELEASE} unpacked to ./third_party/mason"
2019fi
2120
21+ echo " Installing and linking Mason deps"
2222./third_party/mason/mason install protobuf ${PROTOBUF_RELEASE}
2323./third_party/mason/mason link protobuf ${PROTOBUF_RELEASE}
2424./third_party/mason/mason install sparsehash ${SPARSEHASH_RELEASE}
2727./third_party/mason/mason link gflags ${GFLAGS_RELEASE}
2828./third_party/mason/mason install or-tools ${ORTOOLS_RELEASE}
2929./third_party/mason/mason link or-tools ${ORTOOLS_RELEASE}
30+ echo " Done installing and linking Mason deps"
3031
3132
3233# We ship debug binaries with mason but for production builds we just strip debug symbols out.
3334# In case you need debug symbols just comment out the following line and `npm --build-from-source`.
34- find mason_packages/ -type f -name ' libortools.*' -exec strip --strip-unneeded {} \;
35+ if [ " $( uname -s) " == ' Darwin' ]; then
36+ STRIP_CMD=" strip -x"
37+ else
38+ STRIP_CMD=" strip --strip-unneeded"
39+ fi
40+
41+ for path in $( find $( pwd) /mason_packages -type f -name ' libortools.*' ) ; do
42+ echo " stripping debug symbols from ${path} "
43+ $STRIP_CMD $path
44+ done
0 commit comments