From 27908c81cfc40fd1c11f8a7a1500261a98f5571d Mon Sep 17 00:00:00 2001 From: neodix42 Date: Tue, 16 Apr 2024 05:56:52 -0500 Subject: [PATCH] Update automated build scripts (#52) * update: wip * try win with updated tonlib * add secp256k1 for win tonlib * adjust Visual Studio for github runner * add sodium to win build * test tonlib testnet compilation * test tonlib testnet compilation * test tonlib testnet compilation * back to newton-blockchain/ton:wallets branch * back to newton-blockchain/ton:wallets branch * back to newton-blockchain/ton:wallets branch * back to newton-blockchain/ton:wallets branch * adding macos runner; wip * adding macos runner; wip * adding macos runner; wip * patch qtbase for macos 12 * Update wallet-desktop repo. Remove outdated macOS github action + escape s * Update wallet-desktop repo. Remove outdated macOS github action + replace * macos sed differences :/ * typo * install python-setuptools for macos * symlink to python * symlink to python * alias python=python3 * try macos 12.7.1 * back to macos 11.7 with patched gyp * fix brew upgrade * force python 2.7 * disable brew update (very slow on GH) * target macos 10.11 * openssl arch typo * use newer crashpad * Revert "use newer crashpad" This reverts commit be32aa523f07c1afad0b982dd69950f3437afe6a. * rollback crashpad, use macos target 10.8 * disable warning errors for crashpad * rename auto-build folder for macos --------- Co-authored-by: neodiX --- .github/workflows/macos-wallet-compile.yml | 25 ++ .../workflows/ubuntu-20.04-wallet-compile.yml | 4 +- .github/workflows/windows-wallet-compile.yml | 3 +- .../{macos-10.15 => macos-11.7}/compile.sh | 73 +++- .../crashpad.patch | 0 .../{macos-10.15 => macos-11.7}/wallet.patch | 0 auto-build/ubuntu-20.04/build-wallet.sh | 34 +- auto-build/windows/compile.bat | 398 ++++++++++++------ docs/building-xcode.md | 2 +- 9 files changed, 388 insertions(+), 151 deletions(-) create mode 100644 .github/workflows/macos-wallet-compile.yml rename auto-build/{macos-10.15 => macos-11.7}/compile.sh (58%) rename auto-build/{macos-10.15 => macos-11.7}/crashpad.patch (100%) rename auto-build/{macos-10.15 => macos-11.7}/wallet.patch (100%) diff --git a/.github/workflows/macos-wallet-compile.yml b/.github/workflows/macos-wallet-compile.yml new file mode 100644 index 0000000..3d7e301 --- /dev/null +++ b/.github/workflows/macos-wallet-compile.yml @@ -0,0 +1,25 @@ +name: MacOS 11.7 TON Desktop wallet compile +on: [push,pull_request,workflow_dispatch] +jobs: + build: + runs-on: macos-11 + steps: + - name: Check out current repository + uses: actions/checkout@v2 + with: + path: wallet-desktop + - name: Compile macos desktop wallet + run: | + cd wallet-desktop/auto-build/macos-11.7 + chmod +x compile.sh + ./compile.sh + - name: Find & copy binaries + run: | + mkdir artifacts + chmod -R 777 wallet-desktop/auto-build/macos-11.7/wallet-desktop/out/Release/Wallet.app + cp -R wallet-desktop/auto-build/macos-11.7/wallet-desktop/out/Release/Wallet.app artifacts + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-macos-desktop-wallet + path: artifacts \ No newline at end of file diff --git a/.github/workflows/ubuntu-20.04-wallet-compile.yml b/.github/workflows/ubuntu-20.04-wallet-compile.yml index 75a5eed..54173ff 100644 --- a/.github/workflows/ubuntu-20.04-wallet-compile.yml +++ b/.github/workflows/ubuntu-20.04-wallet-compile.yml @@ -1,6 +1,6 @@ name: C/C++ CI Ubuntu 20.04 x86-64 TON Desktop wallet compile -on: [pull_request,workflow_dispatch] +on: [push,pull_request,workflow_dispatch] jobs: build: @@ -11,6 +11,8 @@ jobs: uses: actions/checkout@v2 with: path: wallet-desktop + submodules: 'recursive' + - name: Compile linux desktop wallet run: | cd wallet-desktop/auto-build/ubuntu-20.04 diff --git a/.github/workflows/windows-wallet-compile.yml b/.github/workflows/windows-wallet-compile.yml index 62466cc..e4848db 100644 --- a/.github/workflows/windows-wallet-compile.yml +++ b/.github/workflows/windows-wallet-compile.yml @@ -1,6 +1,6 @@ name: C/C++ CI Windows TON Desktop wallet compile -on: [pull_request,workflow_dispatch] +on: [push,pull_request,workflow_dispatch] defaults: run: @@ -15,6 +15,7 @@ jobs: uses: actions/checkout@v2 with: path: wallet-desktop + submodules: 'recursive' - name: Setup msbuild.exe uses: microsoft/setup-msbuild@v1.0.2 diff --git a/auto-build/macos-10.15/compile.sh b/auto-build/macos-11.7/compile.sh similarity index 58% rename from auto-build/macos-10.15/compile.sh rename to auto-build/macos-11.7/compile.sh index 2a4bfff..afcc16b 100644 --- a/auto-build/macos-10.15/compile.sh +++ b/auto-build/macos-11.7/compile.sh @@ -1,10 +1,31 @@ #!/bin/bash MAKE_THREADS_CNT=-j8 -MACOSX_DEPLOYMENT_TARGET=10.12 +MACOSX_DEPLOYMENT_TARGET=10.8 + +# echo | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +brew install automake cmake fdk-aac git lame libass libtool libvorbis libvpx ninja opus sdl shtool texi2html theora wget x264 xvid yasm pkg-config python-setuptools + + +which python +which python3 + +#sudo mkdir -p /usr/local/bin +#export PATH=/usr/local/bin:$PATH +#echo "alias python=python3" >> ~/.zshrc +#source ~/.zshrc + +brew install pyenv +echo | pyenv install 2.7.18 +pyenv global 2.7.18 +PATH=$(pyenv root)/shims:$PATH + +which python +which python3 +python -V + +echo $PATH -ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -brew install automake cmake fdk-aac git lame libass libtool libvorbis libvpx ninja opus sdl shtool texi2html theora wget x264 xvid yasm pkg-config sudo xcode-select -s /Applications/Xcode.app/Contents/Developer @@ -32,7 +53,9 @@ export PATH="$PWD/depot_tools:$PATH" cd gyp git checkout 9f2a7bb1 git apply ../patches/gyp.diff +#sed -i -e 's/python/python3/g' setup.py ./setup.py build +test $? -eq 0 || { echo "Can't setup gyp"; exit 1; } sudo ./setup.py install cd ../.. @@ -51,23 +74,27 @@ cd .. git clone --branch 0.10.0 https://github.com/ericniebler/range-v3 cd xz-5.0.5 -CFLAGS="-mmacosx-version-min=10.12" LDFLAGS="-mmacosx-version-min=10.12" ./configure --prefix=/usr/local/macos +CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure --prefix=/usr/local/macos make $MAKE_THREADS_CNT +test $? -eq 0 || { echo "Can't compile xz-5.0.5"; exit 1; } sudo make install cd .. git clone https://github.com/desktop-app/zlib.git cd zlib -CFLAGS="-mmacosx-version-min=10.12 -Werror=unguarded-availability-new" LDFLAGS="-mmacosx-version-min=10.12" ./configure --prefix=/usr/local/macos +CFLAGS="-mmacosx-version-min=10.8 -Werror=unguarded-availability-new" LDFLAGS="-mmacosx-version-min=10.8" ./configure --prefix=/usr/local/macos make $MAKE_THREADS_CNT +test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } sudo make install cd .. git clone https://github.com/openssl/openssl openssl_1_1_1 cd openssl_1_1_1 git checkout OpenSSL_1_1_1-stable -./Configure --prefix=/usr/local/macos darwin64-x86_64-cc -static -mmacosx-version-min=10.12 +./Configure --prefix=/usr/local/macos darwin64-x86_64-cc -static -mmacosx-version-min=10.8 +test $? -eq 0 || { echo "Can't configure openssl_1_1_1"; exit 1; } make build_libs $MAKE_THREADS_CNT +test $? -eq 0 || { echo "Can't compile openssl_1_1_1"; exit 1; } cd .. @@ -80,29 +107,43 @@ git clone https://chromium.googlesource.com/chromium/mini_chromium cd mini_chromium git checkout 7c5b0c1ab4 git apply ../../../../patches/mini_chromium.diff +test $? -eq 0 || { echo "Can't apply mini_chromium.diff"; exit 1; } cd ../../gtest git clone https://chromium.googlesource.com/external/github.com/google/googletest gtest cd gtest git checkout d62d6c6556 cd ../../.. -git apply $rootPath/wallet-desktop/auto-build/macos-10.15/crashpad.patch +git apply $rootPath/wallet-desktop/auto-build/macos-11.7/crashpad.patch +test $? -eq 0 || { echo "Can't apply crashpad.patch"; exit 1; } -build/gyp_crashpad.py -Dmac_deployment_target=10.10 +build/gyp_crashpad.py -Dmac_deployment_target=10.8 +test $? -eq 0 || { echo "Can't prepare gyp_crashpad"; exit 1; } +find out/Debug -type f -name "*.ninja" -print0 | xargs -0 sed -i '' -e 's/-Werror//g' ninja -C out/Debug +test $? -eq 0 || { echo "Can't configure debug gyp_crashpad"; exit 1; } +find out/Release -type f -name "*.ninja" -print0 | xargs -0 sed -i '' -e 's/-Werror//g' ninja -C out/Release +test $? -eq 0 || { echo "Can't configure release gyp_crashpad"; exit 1; } + cd .. git clone git://code.qt.io/qt/qt5.git qt5_12_8 cd qt5_12_8 -perl init-repository --module-subset=qtbase,qtimageformats git checkout v5.12.8 +perl init-repository --module-subset=qtbase,qtimageformats git submodule update qtbase git submodule update qtimageformats cd qtbase git apply ../../patches/qtbase_5_12_8.diff +cat src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h +sed -i -e 's@qcore_mac_p.h>@qcore_mac_p.h>\n#include \n@g' src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h +cat src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h + cd .. + + ./configure -prefix "/usr/local/desktop-app/Qt-5.12.8" \ -debug-and-release \ -force-debug-info \ @@ -117,6 +158,7 @@ cd .. -platform macx-clang make $MAKE_THREADS_CNT +test $? -eq 0 || { echo "Can't compile qt5_12_8"; exit 1; } sudo make install cd .. @@ -128,19 +170,24 @@ git submodule init git submodule update third-party/crc32c mkdir build-debug cd build-debug -cmake -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=$LibrariesPath/openssl_1_1_1/include -DOPENSSL_CRYPTO_LIBRARY=$LibrariesPath/openssl_1_1_1/libcrypto.a -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=$LibrariesPath/zlib -DZLIB_LIBRARY=/usr/local/macos/lib/libz.a -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.12 -DCMAKE_CXX_FLAGS="-stdlib=libc++" .. +cmake -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=$LibrariesPath/openssl_1_1_1/include -DOPENSSL_CRYPTO_LIBRARY=$LibrariesPath/openssl_1_1_1/libcrypto.a -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=$LibrariesPath/zlib -DZLIB_LIBRARY=/usr/local/macos/lib/libz.a -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.8 -DCMAKE_CXX_FLAGS="-stdlib=libc++" .. +test $? -eq 0 || { echo "Can't configure debug ton"; exit 1; } make $MAKE_THREADS_CNT tonlib +test $? -eq 0 || { echo "Can't compile debug ton"; exit 1; } cd .. mkdir build cd build -cmake -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=$LibrariesPath/openssl_1_1_1/include -DOPENSSL_CRYPTO_LIBRARY=$LibrariesPath/openssl_1_1_1/libcrypto.a -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=$LibrariesPath/zlib -DZLIB_LIBRARY=/usr/local/macos/lib/libz.a -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.12 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=Release .. +cmake -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=$LibrariesPath/openssl_1_1_1/include -DOPENSSL_CRYPTO_LIBRARY=$LibrariesPath/openssl_1_1_1/libcrypto.a -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=$LibrariesPath/zlib -DZLIB_LIBRARY=/usr/local/macos/lib/libz.a -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.8 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=Release .. +test $? -eq 0 || { echo "Can't configure release ton"; exit 1; } make $MAKE_THREADS_CNT tonlib +test $? -eq 0 || { echo "Can't compile release ton"; exit 1; } cd $rootPath/wallet-desktop/Wallet/ ./configure.sh -D DESKTOP_APP_USE_PACKAGED=OFF +test $? -eq 0 || { echo "Can't configure wallet"; exit 1; } -git apply $rootPath/wallet-desktop/auto-build/macos-10.15/wallet.patch - +git apply $rootPath/wallet-desktop/auto-build/macos-11.7/wallet.patch +test $? -eq 0 || { echo "Can't apply wallet.patch"; exit 1; } cd ../out xcodebuild -list -project Wallet.xcodeproj diff --git a/auto-build/macos-10.15/crashpad.patch b/auto-build/macos-11.7/crashpad.patch similarity index 100% rename from auto-build/macos-10.15/crashpad.patch rename to auto-build/macos-11.7/crashpad.patch diff --git a/auto-build/macos-10.15/wallet.patch b/auto-build/macos-11.7/wallet.patch similarity index 100% rename from auto-build/macos-10.15/wallet.patch rename to auto-build/macos-11.7/wallet.patch diff --git a/auto-build/ubuntu-20.04/build-wallet.sh b/auto-build/ubuntu-20.04/build-wallet.sh index 92c4629..2ec6739 100644 --- a/auto-build/ubuntu-20.04/build-wallet.sh +++ b/auto-build/ubuntu-20.04/build-wallet.sh @@ -17,7 +17,7 @@ function grn() { echo -e -n "\033[1;32m$1\033[0m\n"; } function blu() { echo -e -n "\033[1;34m$1\033[0m\n"; } if [ ! -f "system-deps-installed" ]; then - yel "Installing neccessary system dependencies" + yel "Installing necessary system dependencies" apt update && apt install git && \ apt install python2.7 python2.7-minimal libpython2.7-minimal libpython2.7-stdlib -y && \ update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10 && \ @@ -31,7 +31,7 @@ if [ ! -f "system-deps-installed" ]; then libxcb-render-util0-dev libxcb-util0-dev libxcb-xkb-dev libxrender-dev \ libasound-dev libpulse-dev libxcb-sync0-dev libxcb-randr0-dev libegl1-mesa-dev \ libx11-xcb-dev libffi-dev libncurses5-dev pkg-config texi2html bison yasm \ - zlib1g-dev xutils-dev chrpath gperf -y && \ + zlib1g-dev xutils-dev chrpath gperf libsodium-dev liblz4-dev libsecp256k1-dev -y && \ add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ apt-get update && \ apt-get install gcc-8 g++-8 -y && \ @@ -49,10 +49,11 @@ if [ ! -f "system-deps-installed" ]; then fi if [ ! -d 'wallet-desktop' ]; then - yel "Cloning $WALLET_REPO_ACCOUNT/wallet-desktop:$WALLET_BRANCH" - git clone -b "$WALLET_BRANCH" --recursive "https://github.com/$WALLET_REPO_ACCOUNT/wallet-desktop.git" + mkdir wallet-desktop cd wallet-desktop || exit - git submodule update --remote Wallet/lib_wallet + cp -R ../../../Wallet . + cp -R ../../../cmake . + cp -R ../../../CMakeLists.txt . cd .. # wallet-desktop grn "wallet-desktop completed" else @@ -66,7 +67,7 @@ if [ ! -d 'cmake' ]; then yel "Cloning and building cmake" git clone https://github.com/Kitware/CMake cmake cd cmake || exit - git checkout v3.16.0 + git checkout v3.21.0 ./bootstrap make $MAKE_THREADS_CNT make install @@ -102,6 +103,7 @@ if [ ! -d 'openssl_1_1_1' ]; then git checkout OpenSSL_1_1_1-stable ./config --prefix=/usr/local/desktop-app/openssl-1.1.1 make $MAKE_THREADS_CNT + test $? -eq 0 || { red "Can't compile openssl-1.1.1"; exit 1; } make install cd .. # openssl_1_1_1 grn "openssl completed" @@ -116,6 +118,7 @@ if [ ! -d 'libxkbcommon' ]; then git checkout xkbcommon-0.8.4 ./autogen.sh --disable-x11 make $MAKE_THREADS_CNT + test $? -eq 0 || { red "Can't compile libxkbcommon"; exit 1; } make install cd .. # libxkbcommon grn "libxkbcommon completed" @@ -131,6 +134,7 @@ if [ ! -d 'googletest' ]; then cd build || exit cmake .. make + test $? -eq 0 || { red "Can't compile googletest"; exit 1; } cp lib/*.a /usr/lib cd .. # build cd .. # googletest @@ -143,8 +147,8 @@ if [ ! -d 'qt_5_12_8' ]; then yel "Cloning and building qt 5.12.8" git clone git://code.qt.io/qt/qt5.git qt_5_12_8 cd qt_5_12_8 || exit - perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg git checkout v5.12.8 + perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg git submodule update qtbase git submodule update qtwayland git submodule update qtimageformats @@ -168,6 +172,7 @@ if [ ! -d 'qt_5_12_8' ]; then -nomake examples -nomake tests make $MAKE_THREADS_CNT + test $? -eq 0 || { red "Can't compile QT"; exit 1; } make install cd .. # qt_5_12_8 grn "qt completed" @@ -207,6 +212,7 @@ if [ ! -d 'breakpad' ]; then sed -i 's/static int tgkill/int tgkill/g' src/client/linux/handler/exception_handler.cc make $MAKE_THREADS_CNT + test $? -eq 0 || { red "Can't compile breakpad"; exit 1; } make install cd src/tools || exit ../../../gyp/gyp --depth=. --generator-output=.. -Goutput_dir=../out tools.gyp --format=cmake @@ -214,6 +220,7 @@ if [ ! -d 'breakpad' ]; then cd out/Default || exit cmake . make $MAKE_THREADS_CNT dump_syms + test $? -eq 0 || { red "Can't compile dump_syms"; exit 1; } cd ../.. # out/Default cd .. # breakpad grn "breakpad completed" @@ -223,10 +230,9 @@ fi if [ ! -d 'ton' ]; then yel "Cloning and building $TONLIB_REPO_ACCOUNT/ton:$TONLIB_BRANCH" - git clone --single-branch --branch "$TONLIB_BRANCH" "https://github.com/$TONLIB_REPO_ACCOUNT/ton.git" + git clone --recursive "https://github.com/$TONLIB_REPO_ACCOUNT/ton.git" cd ton || exit - git submodule init - git submodule update third-party/crc32c + git checkout $TONLIB_BRANCH mkdir build-debug mkdir build cd build-debug || exit @@ -234,12 +240,14 @@ if [ ! -d 'ton' ]; then -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=/usr/local/desktop-app/openssl-1.1.1/include \ -DOPENSSL_CRYPTO_LIBRARY=/usr/local/desktop-app/openssl-1.1.1/lib/libcrypto.a \ -DTON_ARCH="$(uname -m | sed --expression='s/_/-/g')" .. + test $? -eq 0 || { red "Can't configure debug tonlib"; exit 1; } cd .. # build-debug cd build || exit cmake -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ONLY_TONLIB=ON \ -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=/usr/local/desktop-app/openssl-1.1.1/include \ -DOPENSSL_CRYPTO_LIBRARY=/usr/local/desktop-app/openssl-1.1.1/lib/libcrypto.a \ -DTON_ARCH="$(uname -m | sed --expression='s/_/-/g')" -DCMAKE_BUILD_TYPE=Release .. + test $? -eq 0 || { red "Can't configure release tonlib"; exit 1; } cd .. # build cd .. # ton grn "ton (tonlib) completed" @@ -250,6 +258,7 @@ fi cd ton/build || exit yel "Building tonlib" make $MAKE_THREADS_CNT tonlib + test $? -eq 0 || { red "Can't build tonlib"; exit 1; } grn "tonlib build completed" cd ../.. # ton/build @@ -274,12 +283,14 @@ cd wallet-desktop || exit cd Wallet || exit yel "Configuring Wallet" ./configure.sh -D DESKTOP_APP_USE_PACKAGED=OFF - grn "Confugration done" + test $? -eq 0 || { red "Can't configure Wallet"; exit 1; } + grn "Configuration done" cd .. cd out/Release || exit yel "Building Wallet (Release)" make $MAKE_THREADS_CNT + test $? -eq 0 || { red "Can't build Wallet"; exit 1; } grn "Build done" cd ../.. # out/Release @@ -288,4 +299,5 @@ cd .. # wallet-desktop blu "Stripping symbols" cp wallet-desktop/out/Release/bin/Wallet ./ strip ./Wallet +test $? -eq 0 || { red "Can't strip Wallet"; exit 1; } grn "All done!" \ No newline at end of file diff --git a/auto-build/windows/compile.bat b/auto-build/windows/compile.bat index b8abd1a..f84c6fe 100644 --- a/auto-build/windows/compile.bat +++ b/auto-build/windows/compile.bat @@ -1,149 +1,299 @@ REM Execute this batch file in "x86 Native Tools Command Prompt for VS 2019" console REM If you have a Professional or Community edition then update the path below C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise +echo off + set root=%cd% +rd /s /q ThirdParty +rd /s /q Libraries mkdir ThirdParty mkdir Libraries cd ThirdParty -curl -o strawberry.zip -LO https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit-portable.zip -unzip -q strawberry.zip -d Strawberry -del strawberry.zip - -curl -o install.msi https://www.python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi -msiexec /i install.msi /quiet /qn /norestart TARGETDIR="%cd%\Python27" -del install.msi - -curl -o cmake.zip -LO https://github.com/Kitware/CMake/releases/download/v3.19.4/cmake-3.19.4-win64-x64.zip -unzip -q cmake.zip -d cmake -del cmake.zip - -curl -o nasm.zip https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-win64.zip -unzip -q nasm.zip -d NASM -del nasm.zip -curl -o yasm.zip http://www.tortall.net/projects/yasm/releases/vsyasm-1.3.0-win64.zip -unzip -q yasm.zip -d yasm -del yasm.zip +if not exist "Strawberry" ( + echo Downloading perl... + curl -o strawberry.zip -LO https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit-portable.zip + unzip -q strawberry.zip -d Strawberry + del strawberry.zip +) else ( + echo Using Strawberry... +) + +if not exist "%cd%\Python27" ( + echo Downloading python... + curl -o install.msi https://www.python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi + msiexec /i install.msi /quiet /qn /norestart TARGETDIR="%cd%\Python27" + del install.msi +) else ( + echo Using "%cd%\Python27"... +) +if not exist "cmake" ( + echo Downloading cmake... + curl -o cmake.zip -LO https://github.com/Kitware/CMake/releases/download/v3.19.4/cmake-3.19.4-win64-x64.zip + unzip -q cmake.zip -d cmake + del cmake.zip +) else ( + echo Using cmake... +) + +if not exist "NASM" ( + echo Downloading nasm... + curl -o nasm.zip https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-win64.zip + unzip -q nasm.zip -d NASM + del nasm.zip +) else ( + echo Using NASM... +) + +if not exist "yasm" ( + echo Downloading yasm... + curl -o yasm.zip http://www.tortall.net/projects/yasm/releases/vsyasm-1.3.0-win64.zip + unzip -q yasm.zip -d yasm + del yasm.zip +) else ( + echo Using yasm... +) + +if not exist "Ninja" ( + echo Downloading ninja... + curl -o ninja.zip -LO https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip + unzip -q ninja.zip -d Ninja + del ninja.zip +) else ( + echo Using Ninja... +) + +if not exist "jom" ( + echo Downloading jom... + curl -o jom.zip http://www.mirrorservice.org/sites/download.qt-project.org/official_releases/jom/jom_1_1_3.zip + unzip -q jom.zip -d jom + del jom.zip +) else ( + echo Using jom... +) + +if not exist "patches" ( + echo Cloning patches... + git clone https://github.com/desktop-app/patches.git + cd patches + git checkout 10aeaf6 + cd .. + git clone https://chromium.googlesource.com/external/gyp + cd gyp + git checkout 9f2a7bb1 + git apply ../patches/gyp.diff + cd .. +) else ( + echo Using patches... +) -curl -o ninja.zip -LO https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -unzip -q ninja.zip -d Ninja -del ninja.zip - -curl -o jom.zip http://www.mirrorservice.org/sites/download.qt-project.org/official_releases/jom/jom_1_1_3.zip -unzip -q jom.zip -d jom -del jom.zip - -git clone https://github.com/desktop-app/patches.git -cd patches -git checkout 10aeaf6 cd .. -git clone https://chromium.googlesource.com/external/gyp -cd gyp -git checkout 9f2a7bb1 -git apply ../patches/gyp.diff -cd ..\.. SET PATH=%cd%\ThirdParty\Strawberry\perl\bin;%cd%\ThirdParty\NASM\nasm-2.15.05;%cd%\ThirdParty\Python27;%cd%\ThirdParty\jom;%cd%\ThirdParty\cmake\cmake-3.19.4-win64-x64\bin;%cd%\ThirdParty\yasm;%cd%\ThirdParty\gyp;%cd%\ThirdParty\Ninja;%PATH% +echo %PATH% + cd Libraries SET LibrariesPath=%cd% SET GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise SET GYP_MSVS_VERSION=2019 -git clone https://github.com/desktop-app/patches.git -cd patches -git checkout 10aeaf6 -cd .. - -git clone --branch 0.10.0 https://github.com/ericniebler/range-v3 range-v3 - -git clone https://github.com/openssl/openssl.git openssl_1_1_1 -cd openssl_1_1_1 -git checkout OpenSSL_1_1_1i - -perl Configure no-shared debug-VC-WIN32 -nmake -mkdir out32.dbg -move libcrypto.lib out32.dbg -move libssl.lib out32.dbg -move ossl_static.pdb out32.dbg\ossl_static -nmake clean -move out32.dbg\ossl_static out32.dbg\ossl_static.pdb - -perl Configure no-shared VC-WIN32 -nmake -mkdir out32 -move libcrypto.lib out32 -move libssl.lib out32 -move ossl_static.pdb out32 -cd .. - - -git clone https://github.com/desktop-app/zlib.git -cd zlib\contrib\vstudio\vc14 -msbuild zlibstat.vcxproj /property:Configuration=Debug /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 -msbuild zlibstat.vcxproj /property:Configuration=ReleaseWithoutAsm /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 -cd ..\..\..\.. - +if not exist "openssl_1_1_1" ( + git clone https://github.com/openssl/openssl.git openssl_1_1_1 + cd openssl_1_1_1 + git checkout OpenSSL_1_1_1i + + perl Configure no-shared debug-VC-WIN32 + nmake + mkdir out32.dbg + move libcrypto.lib out32.dbg + move libssl.lib out32.dbg + move ossl_static.pdb out32.dbg\ossl_static + nmake clean + move out32.dbg\ossl_static out32.dbg\ossl_static.pdb + + perl Configure no-shared VC-WIN32 + nmake + mkdir out32 + move libcrypto.lib out32 + move libssl.lib out32 + move ossl_static.pdb out32 + cd .. +) else ( + echo Using openssl_1_1_1... +) + + +if not exist "patches" ( + git clone https://github.com/desktop-app/patches.git + cd patches + git checkout 10aeaf6 + cd .. +) else ( + echo Using patches... +) + + +if not exist "range-v3" ( + git clone --branch 0.10.0 https://github.com/ericniebler/range-v3 range-v3 +) else ( + echo Using range-v3... +) + + +if not exist "zlib" ( + git clone https://github.com/desktop-app/zlib.git + cd zlib\contrib\vstudio\vc14 + msbuild zlibstat.vcxproj /property:Configuration=Debug /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 + msbuild zlibstat.vcxproj /property:Configuration=ReleaseWithoutAsm /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 + cd ..\..\..\.. +) else ( + echo Using zlib... +) + +if not exist "secp256k1" ( + git clone https://github.com/bitcoin-core/secp256k1.git + cd secp256k1 + git checkout v0.3.2 + cmake -G "Visual Studio 16 2019" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DBUILD_SHARED_LIBS=OFF + cmake --build build --config Debug + cmake --build build --config Release + cd .. +) else ( + echo Using secp256k1... +) + + +if not exist "lz4" ( + git clone https://github.com/lz4/lz4.git + cd lz4 + git checkout v1.9.4 + cd build\VS2017\liblz4 + msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142 + IF %errorlevel% NEQ 0 ( + echo Can't install lz4 + exit /b %errorlevel% + ) + cd ..\..\..\.. +) else ( + echo Using lz4... +) + + +if not exist "libsodium" ( + curl -Lo libsodium-1.0.18-stable-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip + IF %errorlevel% NEQ 0 ( + echo Can't download libsodium + exit /b %errorlevel% + ) + unzip libsodium-1.0.18-stable-msvc.zip +) else ( + echo Using libsodium... +) + +SET SODIUM_DIR=%LibrariesPath%\libsodium + + +if not exist "lzma" ( + git clone https://github.com/desktop-app/lzma.git + cd lzma\C\Util\LzmaLib + msbuild LzmaLib.sln /property:Configuration=Debug /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 + msbuild LzmaLib.sln /property:Configuration=Release /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 + cd ..\..\..\.. +) else ( + echo Using lzma... +) + +if not exist "breakpad" ( + git clone https://github.com/google/breakpad + cd breakpad + git checkout a1dbcdcb43 + git apply ../patches/breakpad.diff + cd src + git clone https://github.com/google/googletest testing + cd client\windows + call gyp --no-circular-check breakpad_client.gyp --format=ninja + cd ..\.. + ninja -C out/Debug common crash_generation_client exception_handler + ninja -C out/Release common crash_generation_client exception_handler + cd tools\windows\dump_syms + call gyp dump_syms.gyp + msbuild dump_syms.vcxproj /property:Configuration=Debug /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 + msbuild dump_syms.vcxproj /property:Configuration=Release /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 + cd ..\..\..\..\.. +) else ( + echo Using breakpad... +) + +if not exist "qt_5_12_8" ( + git clone git://code.qt.io/qt/qt5.git qt_5_12_8 + cd qt_5_12_8 + perl init-repository --module-subset=qtbase,qtimageformats + git checkout v5.12.8 + git submodule update --init qtbase + git submodule update --init qtimageformats + + call configure -prefix "%LibrariesPath%\Qt-5.12.8" -debug-and-release -force-debug-info -opensource -confirm-license -static -static-runtime -I "%LibrariesPath%\openssl_1_1_1\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%LibrariesPath%\openssl_1_1_1\out32.dbg\libssl.lib %LibrariesPath%\openssl_1_1_1\out32.dbg\libcrypto.lib Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" OPENSSL_LIBS_RELEASE="%LibrariesPath%\openssl_1_1_1\out32\libssl.lib %LibrariesPath%\openssl_1_1_1\out32\libcrypto.lib Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" -mp -nomake examples -nomake tests -platform win32-msvc + + call jom -j4 + call jom -j4 install + cd .. +) else ( + echo Using qt_5_12_8... +) + +if not exist "ton" ( + git clone --recursive https://github.com/newton-blockchain/ton.git + REM git clone --recursive https://github.com/ton-blockchain/ton.git + cd ton + git checkout wallets + mkdir build-debug + cd build-debug + cmake -A Win32 -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON ^ + -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=%LibrariesPath%\openssl_1_1_1\include ^ + -DOPENSSL_CRYPTO_LIBRARY=%LibrariesPath%\openssl_1_1_1\out32.dbg\libcrypto.lib ^ + -DSODIUM_USE_STATIC_LIBS=1 ^ + -DLZ4_FOUND=1 ^ + -DLZ4_INCLUDE_DIRS=%LibrariesPath%\lz4\lib ^ + -DLZ4_LIBRARIES=%LibrariesPath%\lz4\build\VS2017\liblz4\bin\x64_Debug\liblz4_static.lib ^ + -DSECP256K1_FOUND=1 ^ + -DSECP256K1_INCLUDE_DIR=%LibrariesPath%\secp256k1\include ^ + -DSECP256K1_LIBRARY=%LibrariesPath%\secp256k1\build\src\Debug\libsecp256k1.lib ^ + -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=%LibrariesPath%\zlib ^ + -DZLIB_LIBRARY=%LibrariesPath%\zlib\contrib\vstudio\vc14\x86\ZlibStatDebug\zlibstat.lib ^ + -DCMAKE_CXX_FLAGS_DEBUG="/DZLIB_WINAPI /DNDEBUG /MTd /Zi /Od /Ob0" ^ + -DCMAKE_C_FLAGS_DEBUG="/DNDEBUG /MTd /Zi /Od /Ob0" ^ + -DCMAKE_EXE_LINKER_FLAGS="/SAFESEH:NO Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" .. + + cmake --build . --target tonlib --config Debug + + cd .. + mkdir build + cd build + cmake -A Win32 -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON ^ + -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=%LibrariesPath%\openssl_1_1_1\include ^ + -DOPENSSL_CRYPTO_LIBRARY=%LibrariesPath%\openssl_1_1_1\out32\libcrypto.lib ^ + -DSODIUM_USE_STATIC_LIBS=1 ^ + -DLZ4_FOUND=1 ^ + -DLZ4_INCLUDE_DIRS=%LibrariesPath%\lz4\lib ^ + -DLZ4_LIBRARIES=%LibrariesPath%\lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^ + -DSECP256K1_FOUND=1 ^ + -DSECP256K1_INCLUDE_DIR=%LibrariesPath%\secp256k1\include ^ + -DSECP256K1_LIBRARY=%LibrariesPath%\secp256k1\build\src\Release\libsecp256k1.lib ^ + -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=%LibrariesPath%\zlib ^ + -DZLIB_LIBRARY=%LibrariesPath%\zlib\contrib\vstudio\vc14\x86\ZlibStatReleaseWithoutAsm\zlibstat.lib ^ + -DCMAKE_CXX_FLAGS_RELEASE="/DZLIB_WINAPI /MT /Ob2" ^ + -DCMAKE_C_FLAGS_RELEASE="/MT /Ob2" ^ + -DCMAKE_EXE_LINKER_FLAGS="/SAFESEH:NO Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" .. + + cmake --build . --target tonlib --config Release +) else ( + echo Using ton... +) -git clone https://github.com/desktop-app/lzma.git -cd lzma\C\Util\LzmaLib -msbuild LzmaLib.sln /property:Configuration=Debug /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 -msbuild LzmaLib.sln /property:Configuration=Release /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 -cd ..\..\..\.. - - -git clone https://github.com/google/breakpad -cd breakpad -git checkout a1dbcdcb43 -git apply ../patches/breakpad.diff -cd src -git clone https://github.com/google/googletest testing -cd client\windows -call gyp --no-circular-check breakpad_client.gyp --format=ninja -cd ..\.. -ninja -C out/Debug common crash_generation_client exception_handler -ninja -C out/Release common crash_generation_client exception_handler -cd tools\windows\dump_syms -call gyp dump_syms.gyp -msbuild dump_syms.vcxproj /property:Configuration=Debug /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 -msbuild dump_syms.vcxproj /property:Configuration=Release /p:PlatformToolset=v142 /p:platform=x86 /p:WindowsTargetPlatformVersion=10.0.19041.0 -cd ..\..\..\..\.. - - -git clone git://code.qt.io/qt/qt5.git qt_5_12_8 -cd qt_5_12_8 -perl init-repository --module-subset=qtbase,qtimageformats -git checkout v5.12.8 -git submodule update --init qtbase -git submodule update --init qtimageformats - - -call configure -prefix "%LibrariesPath%\Qt-5.12.8" -debug-and-release -force-debug-info -opensource -confirm-license -static -static-runtime -I "%LibrariesPath%\openssl_1_1_1\include" -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="%LibrariesPath%\openssl_1_1_1\out32.dbg\libssl.lib %LibrariesPath%\openssl_1_1_1\out32.dbg\libcrypto.lib Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" OPENSSL_LIBS_RELEASE="%LibrariesPath%\openssl_1_1_1\out32\libssl.lib %LibrariesPath%\openssl_1_1_1\out32\libcrypto.lib Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" -mp -nomake examples -nomake tests -platform win32-msvc - -call jom -j4 - -call jom -j4 install - -cd .. - -git clone --single-branch --branch wallets --recursive https://github.com/newton-blockchain/ton.git -cd ton -git submodule init -git submodule update third-party/crc32c -mkdir build-debug -cd build-debug -cmake -A Win32 -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=%LibrariesPath%\openssl_1_1_1\include -DOPENSSL_CRYPTO_LIBRARY=%LibrariesPath%\openssl_1_1_1\out32.dbg\libcrypto.lib -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=%LibrariesPath%\zlib -DZLIB_LIBRARY=%LibrariesPath%\zlib\contrib\vstudio\vc14\x86\ZlibStatDebug\zlibstat.lib -DCMAKE_CXX_FLAGS_DEBUG="/DZLIB_WINAPI /DNDEBUG /MTd /Zi /Od /Ob0" -DCMAKE_C_FLAGS_DEBUG="/DNDEBUG /MTd /Zi /Od /Ob0" -DCMAKE_EXE_LINKER_FLAGS="/SAFESEH:NO Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" .. -cmake --build . --target tonlib --config Debug - -cd .. -mkdir build -cd build -cmake -A Win32 -DTON_USE_ROCKSDB=OFF -DTON_USE_ABSEIL=OFF -DTON_ARCH= -DTON_ONLY_TONLIB=ON -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=%LibrariesPath%\openssl_1_1_1\include -DOPENSSL_CRYPTO_LIBRARY=%LibrariesPath%\openssl_1_1_1\out32\libcrypto.lib -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=%LibrariesPath%\zlib -DZLIB_LIBRARY=%LibrariesPath%\zlib\contrib\vstudio\vc14\x86\ZlibStatReleaseWithoutAsm\zlibstat.lib -DCMAKE_CXX_FLAGS_RELEASE="/DZLIB_WINAPI /MT /Ob2" -DCMAKE_C_FLAGS_RELEASE="/MT /Ob2" -DCMAKE_EXE_LINKER_FLAGS="/SAFESEH:NO Ws2_32.lib Gdi32.lib Advapi32.lib Crypt32.lib User32.lib" .. -cmake --build . --target tonlib --config Release cd %LibrariesPath%\.. git clone --recursive https://github.com/ton-blockchain/wallet-desktop.git diff --git a/docs/building-xcode.md b/docs/building-xcode.md index a0ec8f1..fd84c18 100644 --- a/docs/building-xcode.md +++ b/docs/building-xcode.md @@ -1,5 +1,5 @@ ## Automatic build -You can try an auto-build script for macOS 10.15 [compile.sh](../auto-build/macos-10.15/compile.sh). +You can try an auto-build script for macOS 11.7 [compile.sh](../auto-build/macos-11.7/compile.sh). The latest compiled TON Wallet can also be downloaded from our [Git actions](https://github.com/newton-blockchain/wallet-desktop/actions/workflows/macos-wallet-compile.yml). Do not forget to apply following commands after you have extracted the artifact: