forked from monero-project/monero-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_libwallet_api.sh
executable file
·63 lines (40 loc) · 1.74 KB
/
get_libwallet_api.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
BITMONERO_URL=https://github.com/mbg033/bitmonero.git
BITMONERO_BRANCH=develop
# thanks to SO: http://stackoverflow.com/a/20283965/4118915
CPU_CORE_COUNT=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
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
git clone --depth=1 $BITMONERO_URL $BITMONERO_DIR --branch $BITMONERO_BRANCH --single-branch
else
cd $BITMONERO_DIR;
git checkout $BITMONERO_BRANCH
git pull;
fi
echo "cleaning up existing bitmonero build dir, libs and includes"
rm -fr $BITMONERO_DIR/build
rm -fr $BITMONERO_DIR/lib
rm -fr $BITMONERO_DIR/include
mkdir -p $BITMONERO_DIR/build/release
pushd $BITMONERO_DIR/build/release
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
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" -G "MSYS Makefiles" ../..
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
# Do something under Windows NT platform
cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" -G "MSYS Makefiles" ../..
fi
pushd $BITMONERO_DIR/build/release/src/wallet
make -j$CPU_CORE_COUNT
make install -j$CPU_CORE_COUNT
popd
popd