2016-05-17 13:03:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
2016-09-01 21:10:21 +00:00
|
|
|
BITMONERO_URL=https://github.com/monero-project/bitmonero.git
|
2016-09-01 20:22:06 +00:00
|
|
|
BITMONERO_BRANCH=master
|
2016-07-06 13:24:14 +00:00
|
|
|
# thanks to SO: http://stackoverflow.com/a/20283965/4118915
|
2016-07-13 07:30:12 +00:00
|
|
|
CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
|
2016-05-17 13:03:59 +00:00
|
|
|
pushd $(pwd)
|
|
|
|
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
|
|
|
|
INSTALL_DIR=$ROOT_DIR/wallet
|
|
|
|
BITMONERO_DIR=$ROOT_DIR/bitmonero
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -d $BITMONERO_DIR ]; then
|
2016-07-01 12:02:19 +00:00
|
|
|
git clone --depth=1 $BITMONERO_URL $BITMONERO_DIR --branch $BITMONERO_BRANCH --single-branch
|
2016-06-10 13:41:13 +00:00
|
|
|
else
|
|
|
|
cd $BITMONERO_DIR;
|
2016-08-24 18:31:43 +00:00
|
|
|
git checkout $BITMONERO_BRANCH
|
2016-06-10 13:41:13 +00:00
|
|
|
git pull;
|
2016-05-17 13:03:59 +00:00
|
|
|
fi
|
|
|
|
|
2016-08-24 18:31:43 +00:00
|
|
|
echo "cleaning up existing bitmonero build dir, libs and includes"
|
2016-05-17 13:03:59 +00:00
|
|
|
rm -fr $BITMONERO_DIR/build
|
2016-08-24 18:31:43 +00:00
|
|
|
rm -fr $BITMONERO_DIR/lib
|
|
|
|
rm -fr $BITMONERO_DIR/include
|
|
|
|
|
2016-05-17 13:03:59 +00:00
|
|
|
mkdir -p $BITMONERO_DIR/build/release
|
|
|
|
pushd $BITMONERO_DIR/build/release
|
|
|
|
|
2016-07-01 12:02:19 +00:00
|
|
|
|
|
|
|
if [ "$(uname)" == "Darwin" ]; then
|
|
|
|
# Do something under Mac OS X platform
|
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../..
|
|
|
|
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
|
|
|
# Do something under GNU/Linux platform
|
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../..
|
|
|
|
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
|
|
|
# Do something under Windows NT platform
|
2016-07-04 15:17:26 +00:00
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" -G "MSYS Makefiles" ../..
|
2016-07-01 12:02:19 +00:00
|
|
|
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
|
|
|
|
# Do something under Windows NT platform
|
2016-07-04 15:17:26 +00:00
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" -G "MSYS Makefiles" ../..
|
2016-07-01 12:02:19 +00:00
|
|
|
fi
|
|
|
|
|
2016-05-17 13:03:59 +00:00
|
|
|
|
|
|
|
pushd $BITMONERO_DIR/build/release/src/wallet
|
|
|
|
make -j$CPU_CORE_COUNT
|
|
|
|
make install -j$CPU_CORE_COUNT
|
|
|
|
popd
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|