2016-05-17 16:03:59 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
2016-09-19 16:45:34 +03:00
|
|
|
MONERO_URL=https://github.com/monero-project/monero.git
|
|
|
|
MONERO_BRANCH=master
|
2016-07-06 16:24:14 +03:00
|
|
|
# thanks to SO: http://stackoverflow.com/a/20283965/4118915
|
2016-07-13 10:30:12 +03:00
|
|
|
CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
|
2016-05-17 16:03:59 +03:00
|
|
|
pushd $(pwd)
|
|
|
|
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
|
|
|
|
INSTALL_DIR=$ROOT_DIR/wallet
|
2016-09-19 16:45:34 +03:00
|
|
|
MONERO_DIR=$ROOT_DIR/monero
|
2016-05-17 16:03:59 +03:00
|
|
|
|
|
|
|
|
2016-09-19 16:45:34 +03:00
|
|
|
if [ ! -d $MONERO_DIR ]; then
|
|
|
|
git clone --depth=1 $MONERO_URL $MONERO_DIR --branch $MONERO_BRANCH --single-branch
|
2016-06-10 16:41:13 +03:00
|
|
|
else
|
2016-09-19 16:45:34 +03:00
|
|
|
cd $MONERO_DIR;
|
|
|
|
git checkout $MONERO_BRANCH
|
2016-06-10 16:41:13 +03:00
|
|
|
git pull;
|
2016-05-17 16:03:59 +03:00
|
|
|
fi
|
|
|
|
|
2016-09-19 16:45:34 +03:00
|
|
|
echo "cleaning up existing monero build dir, libs and includes"
|
|
|
|
rm -fr $MONERO_DIR/build
|
|
|
|
rm -fr $MONERO_DIR/lib
|
|
|
|
rm -fr $MONERO_DIR/include
|
2016-08-24 21:31:43 +03:00
|
|
|
|
2016-09-19 16:45:34 +03:00
|
|
|
mkdir -p $MONERO_DIR/build/release
|
|
|
|
pushd $MONERO_DIR/build/release
|
2016-05-17 16:03:59 +03:00
|
|
|
|
2016-07-01 15:02:19 +03:00
|
|
|
if [ "$(uname)" == "Darwin" ]; then
|
|
|
|
# Do something under Mac OS X platform
|
2016-09-19 16:45:34 +03:00
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
|
2016-07-01 15:02:19 +03:00
|
|
|
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
|
|
|
# Do something under GNU/Linux platform
|
2016-09-19 16:45:34 +03:00
|
|
|
PLATFORM="Linux"
|
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" ../..
|
2016-07-01 15:02:19 +03:00
|
|
|
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
|
|
|
# Do something under Windows NT platform
|
2016-09-19 16:45:34 +03:00
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" ../..
|
2016-07-01 15:02:19 +03:00
|
|
|
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
|
|
|
|
# Do something under Windows NT platform
|
2016-09-19 16:45:34 +03:00
|
|
|
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" ../..
|
2016-07-01 15:02:19 +03:00
|
|
|
fi
|
|
|
|
|
2016-05-17 16:03:59 +03:00
|
|
|
|
2016-09-19 16:45:34 +03:00
|
|
|
pushd $MONERO_DIR/build/release/src/wallet
|
2016-05-17 16:03:59 +03:00
|
|
|
make -j$CPU_CORE_COUNT
|
|
|
|
make install -j$CPU_CORE_COUNT
|
|
|
|
popd
|
2016-09-03 13:06:44 +03:00
|
|
|
|
|
|
|
# unbound is one more dependency. can't be merged to the wallet_merged
|
|
|
|
# since filename conflict (random.c.obj)
|
2016-09-19 16:45:34 +03:00
|
|
|
# for Linux, we use libunbound from repository, so we don't need to build it
|
|
|
|
if [ $PLATFORM != "Linux" ]; then
|
|
|
|
pushd $MONERO_DIR/build/release/external/unbound
|
|
|
|
make -j$CPU_CORE_COUNT
|
|
|
|
make install -j$CPU_CORE_COUNT
|
|
|
|
popd
|
|
|
|
fi
|
2016-09-03 13:06:44 +03:00
|
|
|
|
2016-05-17 16:03:59 +03:00
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|