monero-gui/get_libwallet_api.sh

64 lines
1.8 KiB
Bash
Raw Normal View History

2016-05-17 13:03:59 +00:00
#!/bin/bash
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
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
else
cd $BITMONERO_DIR;
git checkout $BITMONERO_BRANCH
git pull;
2016-05-17 13:03:59 +00:00
fi
echo "cleaning up existing bitmonero build dir, libs and includes"
2016-05-17 13:03:59 +00:00
rm -fr $BITMONERO_DIR/build
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