Skip to content
7 changes: 7 additions & 0 deletions exonum-java-binding/package_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ function build-exonum-java-for-platform() {
}

function build-exonum-java-macos() {
# We use static linkage for RocksDB on Mac
export ROCKSDB_STATIC=1
# Check if ROCKSDB_LIB_DIR is set
if [ -z "${ROCKSDB_LIB_DIR:-}" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need these variables? It's always the same /usr/local/lib. Can we set them here instead of requiring that from users?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not requiring this from users, because our users will use the Homebrew package 😉
Setting this variable explicitly will allow you to choose what RocksDB version to use. Besides, it is also mentioned in Exonum install guide

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mb it'll be better to replace by the following (in pseudo-code):

export ROCKSDB_LIB_DIR={ROCKSDB_LIB_DIR:-/usr/local/lib}
IF $ROCKSDB_LIB_DIR/librocksdb.dylib not found THEN fail(RocksDB not installed)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, you can use a specific version of the rocksdb and use general path for snappy:

export ROCKSDB_LIB_DIR=/usr/local/Cellar/rocksdb/6.1.2/lib
or
export ROCKSDB_LIB_DIR=/usr/local/Cellar/rocksdb5/5.18.3/lib
and
export SNAPPY_LIB_DIR=/usr/local/lib

echo "Please set ROCKSDB_LIB_DIR"
exit 1
fi
build-exonum-java-for-platform "@loader_path" "libjava_bindings.dylib"
}

Expand Down