diff --git a/README.md b/README.md index 072c29b9..42c38b1f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# Monero Core - Copyright (c) 2014-2016, The Monero Project ## Development Resources @@ -144,4 +142,46 @@ TODO ### On Windows: -TODO +1. Install [msys2](http://msys2.github.io/), follow the instructions on that page on how to update packages to the latest versions +2. Install monero dependencies as described in [monero documentation](https://github.com/monero-project/monero) +3. Install git: + + ``` + pacman -S git + ``` +4. Install Qt5: + - if you need to build x86 application, install: + + ``` + pacman -S mingw-w64-i686-qt5 + ``` + + - if you need to build x64 application, install: + + ``` + pacman -S mingw-w64-x86_64-qt5 + ``` +5. Open ```mingw``` shell. MSYS2 will install start menu items for both mingw32 and mingw64 environments, so + you need to open appropriate one: + ```%MSYS_ROOT%\msys2_shell.cmd -mingw32``` for x86 targed + or + ```%MSYS_ROOT%\msys2_shell.cmd -mingw64``` for x64 targed + + Where ```%MSYS_ROOT%``` will be ```c:\msys32``` if your host OS is x86-based or ```c:\msys64``` if your host OS + is x64-based +6. Clone git repository: + ``` + git clone https://github.com/monero-project/monero-core.git + ``` + +7. Build the project: + ``` + cd monero-core + ./build.sh + ``` +8. Take result binary and dependencies in ```./build/release/bin``` + + **important: if you testing application within VirtualBox virtual machine, make sure 3D acceleration is enabled + in machine's settings: + Machine > Settings > Display > [v] Enable 3D Acceleration** + diff --git a/build.sh b/build.sh index a8c2a2c3..6ddcee10 100755 --- a/build.sh +++ b/build.sh @@ -1,17 +1,28 @@ #!/bin/bash +BUILD_TYPE=$1 +if [ -z $BUILD_TYPE ]; then + BUILD_TYPE=Release +fi + + source ./utils.sh pushd $(pwd) ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MONERO_DIR=monero if [ ! -d $MONERO_DIR ]; then - $SHELL get_libwallet_api.sh + $SHELL get_libwallet_api.sh $BUILD_TYPE fi if [ ! -d build ]; then mkdir build; fi -CONFIG="CONFIG+=release" +if [ "$BUILD_TYPE" == "Release" ]; then + CONFIG="CONFIG+=release"; +else + CONFIG="CONFIG+=debug" +fi + platform=$(get_platform) if [ "$platform" == "linux" ]; then @@ -24,19 +35,6 @@ fi cd build qmake ../monero-core.pro "$CONFIG" make -make deploy +# make deploy popd - - - - - - - - - - - - - diff --git a/get_libwallet_api.sh b/get_libwallet_api.sh index fbba689a..ea1d8b1c 100755 --- a/get_libwallet_api.sh +++ b/get_libwallet_api.sh @@ -84,13 +84,3 @@ fi popd - - - - - - - - - - diff --git a/monero-core.pro b/monero-core.pro index f433fd41..3121f109 100644 --- a/monero-core.pro +++ b/monero-core.pro @@ -73,6 +73,19 @@ win32 { -lwsock32 \ -lIphlpapi \ -lgdi32 + + + !contains(QMAKE_TARGET.arch, x86_64) { + message("x86 build") + ## Windows x86 (32bit) specific build here + ## there's 2Mb stack in libwallet allocated internally + ## this fixes app crash for x86 Windows build + QMAKE_LFLAGS += -Wl,--stack,4194304 + } else { + message("x64 build") + } + + } linux { diff --git a/windeploy_helper.sh b/windeploy_helper.sh index 7649db64..45a797c5 100644 --- a/windeploy_helper.sh +++ b/windeploy_helper.sh @@ -1,20 +1,42 @@ #!/bin/bash +ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source $ROOT_DIR/utils.sh + + TARGET=$1 -FILES="zlib1.dll libwinpthread-1.dll libtiff-5.dll libstdc++-6.dll libpng16-16.dll libpcre16-0.dll libpcre-1.dll libmng-2.dll liblzma-5.dll liblcms2-2.dll libjpeg-8.dll libjasper-1.dll libintl-8.dll libicuuc57.dll libicuin57.dll libicudt57.dll libiconv-2.dll libharfbuzz-0.dll libgraphite2.dll libglib-2.0-0.dll libgcc_s_seh-1.dll libfreetype-6.dll libbz2-1.dll" +BUILD_TYPE=$2 + + + + +if [[ -z $BUILD_TYPE ]]; then + BUILD_TYPE=Release +fi + +if [[ "$BUILD_TYPE" == "Release" ]]; then + echo "Release build" + ICU_FILES="libicuuc57.dll libicuin57.dll libicudt57.dll" +else + echo "Debug build" + ICU_FILES="libicuucd57.dll libicuind57.dll libicudtd57.dll" +fi + +FILES="zlib1.dll libwinpthread-1.dll libtiff-5.dll libstdc++-6.dll libpng16-16.dll libpcre16-0.dll libpcre-1.dll libmng-2.dll liblzma-5.dll liblcms2-2.dll libjpeg-8.dll libjasper-1.dll libintl-8.dll libiconv-2.dll libharfbuzz-0.dll libgraphite2.dll libglib-2.0-0.dll libfreetype-6.dll libbz2-1.dll" + +platform=$(get_platform) + +if [[ "$platform" == "mingw64" ]]; then + PLATFORM_FILES="libgcc_s_seh-1.dll" +elif [[ "$platform" == "mingw32" ]]; then + PLATFORM_FILES="libgcc_s_dw2-1.dll" +fi for f in $FILES; do cp $MSYSTEM_PREFIX/bin/$f $TARGET; done - - - - - - - - - - +for f in $ICU_FILES; do cp $MSYSTEM_PREFIX/bin/$f $TARGET; done + +for f in $PLATFORM_FILES; do cp $MSYSTEM_PREFIX/bin/$f $TARGET; done