From 9ec8eb923e5dc0d439d35ab3637223df8b4b14b0 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Sat, 17 Sep 2016 15:01:08 +0300 Subject: [PATCH 1/4] build: Build vendored libunbound for MacOS X --- get_libwallet_api.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index 881e0ace..22e0af59 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -31,7 +31,7 @@ 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 BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../.. + cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=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 BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../.. From 3cc318eb5d848099eacf9d1fe4cd5ac669dbfe16 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Mon, 19 Sep 2016 16:45:34 +0300 Subject: [PATCH 2/4] build: adjusted with bitmonero->monero renamings; build: temporary disabled link with 'libunwind' due Ubuntu issues --- build.sh | 4 ++-- get_libwallet_api.sh | 48 ++++++++++++++++++++++++-------------------- monero-core.pro | 5 +++-- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/build.sh b/build.sh index 7b0024d5..347f5aaa 100755 --- a/build.sh +++ b/build.sh @@ -2,9 +2,9 @@ pushd $(pwd) ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BITMOMERO_DIR=bitmonero +MONERO_DIR=monero -if [ ! -d $BITMOMERO_DIR ]; then +if [ ! -d $MONERO_DIR ]; then $SHELL get_libwallet_api.sh fi diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index 881e0ace..cbd4f021 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -1,8 +1,8 @@ #!/bin/bash -BITMONERO_URL=https://github.com/monero-project/bitmonero.git -BITMONERO_BRANCH=master +MONERO_URL=https://github.com/monero-project/monero.git +MONERO_BRANCH=master # 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) @@ -10,51 +10,55 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" INSTALL_DIR=$ROOT_DIR/wallet -BITMONERO_DIR=$ROOT_DIR/bitmonero +MONERO_DIR=$ROOT_DIR/monero -if [ ! -d $BITMONERO_DIR ]; then - git clone --depth=1 $BITMONERO_URL $BITMONERO_DIR --branch $BITMONERO_BRANCH --single-branch +if [ ! -d $MONERO_DIR ]; then + git clone --depth=1 $MONERO_URL $MONERO_DIR --branch $MONERO_BRANCH --single-branch else - cd $BITMONERO_DIR; - git checkout $BITMONERO_BRANCH + cd $MONERO_DIR; + git checkout $MONERO_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 +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 -mkdir -p $BITMONERO_DIR/build/release -pushd $BITMONERO_DIR/build/release +mkdir -p $MONERO_DIR/build/release +pushd $MONERO_DIR/build/release if [ "$(uname)" == "Darwin" ]; then # Do something under Mac OS X platform - cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../.. + cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_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 BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" ../.. + PLATFORM="Linux" + cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_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 BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" -G "MSYS Makefiles" ../.. + cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_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 BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$BITMONERO_DIR" -G "MSYS Makefiles" ../.. + cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" ../.. fi -pushd $BITMONERO_DIR/build/release/src/wallet +pushd $MONERO_DIR/build/release/src/wallet make -j$CPU_CORE_COUNT make install -j$CPU_CORE_COUNT popd # unbound is one more dependency. can't be merged to the wallet_merged # since filename conflict (random.c.obj) -pushd $BITMONERO_DIR/build/release/external/unbound -make -j$CPU_CORE_COUNT -make install -j$CPU_CORE_COUNT -popd +# 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 popd diff --git a/monero-core.pro b/monero-core.pro index 4b9a3fa0..c90960e4 100644 --- a/monero-core.pro +++ b/monero-core.pro @@ -2,7 +2,7 @@ TEMPLATE = app QT += qml quick widgets -WALLET_ROOT=$$PWD/bitmonero +WALLET_ROOT=$$PWD/monero CONFIG += c++11 @@ -86,7 +86,8 @@ linux { -lssl \ -lcrypto \ -Wl,-Bdynamic \ - -lunwind \ + # currently monero has an issue with "static" build and linunwind-dev + # -lunwind \ -ldl } From 740669a909d55e84e34217b57fd0224bb61bc0f1 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Mon, 19 Sep 2016 17:47:44 +0300 Subject: [PATCH 3/4] build: Building vendored libunbound for mingw builds --- get_libwallet_api.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index a17b0fec..3e6f4933 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -38,10 +38,10 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_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 BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" ../.. + cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON -D CMAKE_INSTALL_PREFIX="$MONERO_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 BUILD_GUI_DEPS=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" ../.. + cmake -D CMAKE_BUILD_TYPE=Release -D STATIC=ON -D BUILD_GUI_DEPS=ON -D INSTALL_VENDORED_LIBUNBOUND=ON -D CMAKE_INSTALL_PREFIX="$MONERO_DIR" -G "MSYS Makefiles" ../.. fi @@ -53,7 +53,8 @@ popd # unbound is one more dependency. can't be merged to the wallet_merged # since filename conflict (random.c.obj) # for Linux, we use libunbound from repository, so we don't need to build it -if [ $PLATFORM != "Linux" ]; then + +if [ "$PLATFORM" != "Linux" ]; then echo "Building libunbound..." pushd $MONERO_DIR/build/release/external/unbound make -j$CPU_CORE_COUNT From 778695b188499da252eeba4649e7d0951d938635 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Mon, 19 Sep 2016 17:55:34 +0300 Subject: [PATCH 4/4] build: clarified comment --- get_libwallet_api.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index 3e6f4933..b8c8d479 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -52,7 +52,7 @@ popd # unbound is one more dependency. can't be merged to the wallet_merged # since filename conflict (random.c.obj) -# for Linux, we use libunbound from repository, so we don't need to build it +# for Linux, we use libunbound shipped with the system, so we don't need to build it if [ "$PLATFORM" != "Linux" ]; then echo "Building libunbound..."