From 112dc7b154cfee57bd0233a8847996edc8cf460f Mon Sep 17 00:00:00 2001 From: Joel Barker Date: Tue, 17 Jan 2017 12:51:38 +0000 Subject: [PATCH] added script to make static binaries for mac --- README-mac.md | 3 +++ makeDistrib.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 makeDistrib.sh diff --git a/README-mac.md b/README-mac.md index f6b6f8a10..c085cb617 100644 --- a/README-mac.md +++ b/README-mac.md @@ -26,6 +26,9 @@ cd komodo git checkout dev ./zcutil/build-mac.sh ``` + +To build a distributable version of komodo then run the makeDistrib.sh script after building. + When you are done building, you need to do a few things in the [Configuration](https://github.com/zcash/zcash/wiki/1.0-User-Guide#configuration) section of the Zcash User Guide differently because we are on the Mac. All instances of `~/.zcash` need to be replaced by `~/Library/Application\ Support/Zcash` The fetch-params.sh script, however, has already been altered to fetch the proving keys into the correct directory to conform to Mac specific naming conventions. diff --git a/makeDistrib.sh b/makeDistrib.sh new file mode 100755 index 000000000..ad72fbb16 --- /dev/null +++ b/makeDistrib.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +TMP_DIR=~/tmp/komodo + +# make a tmp directory +mkdir -p $TMP_DIR +echo "making $TMP_DIR" + +binaries=("komodo-cli" "komodod") + +for binary in "${binaries[@]}"; +do + echo "copying $binary to $TMP_DIR" + + cp src/$binary $TMP_DIR + + # find the dylibs to copy for komodod + DYLIBS=`otool -L $TMP_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` + echo "copying $DYLIBS to $TMP_DIR" + + # copy the dylibs to the tmpdir + for dylib in $DYLIBS; do cp -rf $dylib $TMP_DIR/; done + + # modify komodod to point to dylibs + echo "modifying $binary to use local libraries" + for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $TMP_DIR/$binary; done; +done + + + + + + + +