diff --git a/assembly/android/build-android-tonlib.sh b/assembly/android/build-android-tonlib.sh deleted file mode 100644 index e470f6022..000000000 --- a/assembly/android/build-android-tonlib.sh +++ /dev/null @@ -1,55 +0,0 @@ -with_artifacts=false - -while getopts 'a' flag; do - case "${flag}" in - a) with_artifacts=true ;; - *) break - ;; - esac -done - -if [ ! -d android-ndk-r25b ]; then - rm android-ndk-r25b-linux.zip - wget -q https://dl.google.com/android/repository/android-ndk-r25b-linux.zip - unzip -q android-ndk-r25b-linux.zip - test $? -eq 0 || { echo "Can't unzip android-ndk-r25b-linux.zip"; exit 1; } - echo Android NDK extracted -else - echo Using extracted Android NDK -fi - -export JAVA_AWT_LIBRARY=NotNeeded -export JAVA_JVM_LIBRARY=NotNeeded -export JAVA_INCLUDE_PATH=${JAVA_HOME}/include -export JAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -export JAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux - -export ANDROID_NDK_ROOT=$(pwd)/android-ndk-r25b -export NDK_PLATFORM="android-21" -export ANDROID_PLATFORM="android-21" -export OPENSSL_DIR=$(pwd)/example/android/third_party/crypto - -rm -rf example/android/src/drinkless/org/ton/TonApi.java -cd example/android/ - -rm CMakeCache.txt .ninja_* -cmake -GNinja -DTON_ONLY_TONLIB=ON . - -test $? -eq 0 || { echo "Can't configure TON"; exit 1; } - -ninja prepare_cross_compiling - -test $? -eq 0 || { echo "Can't compile prepare_cross_compiling"; exit 1; } - -rm CMakeCache.txt .ninja_* - -. ./build-all.sh - -find . -name "*.debug" -type f -delete - -if [ "$with_artifacts" = true ]; then - cd ../.. - mkdir -p artifacts/tonlib-android-jni - cp example/android/src/drinkless/org/ton/TonApi.java artifacts/tonlib-android-jni/ - cp -R example/android/libs/* artifacts/tonlib-android-jni/ -fi diff --git a/assembly/cicd/jenkins/test-builds.groovy b/assembly/cicd/jenkins/test-builds.groovy deleted file mode 100644 index 07dd21aae..000000000 --- a/assembly/cicd/jenkins/test-builds.groovy +++ /dev/null @@ -1,236 +0,0 @@ -pipeline { - agent none - stages { - stage('Run Builds') { - parallel { - stage('Ubuntu 20.04 x86-64 (shared)') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-ubuntu-shared.sh . - chmod +x build-ubuntu-shared.sh - ./build-ubuntu-shared.sh -t -a - ''' - sh ''' - cd artifacts - zip -9r ton-x86_64-linux-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86_64-linux-shared.zip' - } - } - } - stage('Ubuntu 20.04 x86-64 (portable)') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-linux-x86-64-nix.sh . - chmod +x build-linux-x86-64-nix.sh - ./build-linux-x86-64-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-x86-64-linux-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-linux-portable.zip' - } - } - } - stage('Ubuntu 20.04 aarch64 (shared)') { - agent { - label 'Ubuntu_arm64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-ubuntu-shared.sh . - chmod +x build-ubuntu-shared.sh - ./build-ubuntu-shared.sh -t -a - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-linux-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-linux-shared.zip' - } - } - } - stage('Ubuntu 20.04 aarch64 (portable)') { - agent { - label 'Ubuntu_arm64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-linux-arm64-nix.sh . - chmod +x build-linux-arm64-nix.sh - ./build-linux-arm64-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-linux-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-linux-portable.zip' - } - } - } - stage('macOS 12.7 x86-64 (shared)') { - agent { - label 'macOS_12.7_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-macos-shared.sh . - chmod +x build-macos-shared.sh - ./build-macos-shared.sh -t -a - ''' - sh ''' - cd artifacts - zip -9r ton-x86-64-macos-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-macos-shared.zip' - } - } - } - stage('macOS 12.7 x86-64 (portable)') { - agent { - label 'macOS_12.7_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-macos-nix.sh . - chmod +x build-macos-nix.sh - ./build-macos-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-x86-64-macos-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-macos-portable.zip' - } - } - } - stage('macOS 12.6 aarch64 (shared)') { - agent { - label 'macOS_12.6-arm64-m1' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-macos-shared.sh . - chmod +x build-macos-shared.sh - ./build-macos-shared.sh -t -a - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-macos-m1-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-macos-m1-shared.zip' - } - } - } - stage('macOS 12.6 aarch64 (portable)') { - agent { - label 'macOS_12.6-arm64-m1' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-macos-nix.sh . - chmod +x build-macos-nix.sh - ./build-macos-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-macos-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-macos-portable.zip' - } - } - } - stage('macOS 13.2 aarch64 (shared)') { - agent { - label 'macOS_13.2-arm64-m2' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-macos-shared.sh . - chmod +x build-macos-shared.sh - ./build-macos-shared.sh -t -a - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-macos-m2-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-macos-m2-shared.zip' - } - } - } - stage('Windows Server 2022 x86-64') { - agent { - label 'Windows_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - bat ''' - copy assembly\\native\\build-windows.bat . - build-windows.bat -t - ''' - bat ''' - cd artifacts - zip -9r ton-x86-64-windows ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-windows.zip' - } - } - } - stage('Android Tonlib') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/android/build-android-tonlib.sh . - chmod +x build-android-tonlib.sh - ./build-android-tonlib.sh -a - ''' - sh ''' - cd artifacts/tonlib-android-jni - zip -9r ton-android-tonlib ./* - ''' - archiveArtifacts artifacts: 'artifacts/tonlib-android-jni/ton-android-tonlib.zip' - } - } - } - stage('WASM fift func emulator') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cd assembly/wasm - chmod +x fift-func-wasm-build-ubuntu.sh - ./fift-func-wasm-build-ubuntu.sh -a - ''' - sh ''' - cd artifacts - zip -9r ton-wasm-binaries ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-wasm-binaries.zip' - } - } - } - } - } - } -} \ No newline at end of file diff --git a/assembly/native/build-macos-portable.sh b/assembly/native/build-macos-portable.sh deleted file mode 100644 index 32a09e452..000000000 --- a/assembly/native/build-macos-portable.sh +++ /dev/null @@ -1,225 +0,0 @@ -#/bin/bash - -with_tests=false -with_artifacts=false -OSX_TARGET=10.15 - - -while getopts 'tao:' flag; do - case "${flag}" in - t) with_tests=true ;; - a) with_artifacts=true ;; - o) OSX_TARGET=${OPTARG} ;; - *) break - ;; - esac -done - -if [ ! -d "build" ]; then - mkdir build - cd build -else - cd build - rm -rf .ninja* CMakeCache.txt -fi - -export NONINTERACTIVE=1 -brew install ninja pkg-config automake libtool autoconf -brew install llvm@16 - - -if [ -f /opt/homebrew/opt/llvm@16/bin/clang ]; then - export CC=/opt/homebrew/opt/llvm@16/bin/clang - export CXX=/opt/homebrew/opt/llvm@16/bin/clang++ -else - export CC=/usr/local/opt/llvm@16/bin/clang - export CXX=/usr/local/opt/llvm@16/bin/clang++ -fi -export CCACHE_DISABLE=1 - -if [ ! -d "lz4" ]; then -git clone https://github.com/lz4/lz4.git -cd lz4 -lz4Path=`pwd` -git checkout v1.9.4 -make -j12 -test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } -cd .. -# ./lib/liblz4.a -# ./lib -else - lz4Path=$(pwd)/lz4 - echo "Using compiled lz4" -fi - -if [ ! -d "secp256k1" ]; then -git clone https://github.com/bitcoin-core/secp256k1.git -cd secp256k1 -secp256k1Path=`pwd` -git checkout v0.3.2 -./autogen.sh -./configure --enable-module-recovery --enable-static --disable-tests --disable-benchmark --with-pic -make -j12 -test $? -eq 0 || { echo "Can't compile secp256k1"; exit 1; } -cd .. -else - secp256k1Path=$(pwd)/secp256k1 - echo "Using compiled secp256k1" -fi - -if [ ! -d "libsodium" ]; then - export LIBSODIUM_FULL_BUILD=1 - git clone https://github.com/jedisct1/libsodium.git - cd libsodium - sodiumPath=`pwd` - git checkout 1.0.18 - ./autogen.sh - ./configure --with-pic --enable-static - make -j12 - test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } - cd .. -else - sodiumPath=$(pwd)/libsodium - echo "Using compiled libsodium" -fi - -if [ ! -d "openssl_3" ]; then - git clone https://github.com/openssl/openssl openssl_3 - cd openssl_3 - opensslPath=`pwd` - git checkout openssl-3.1.4 - ./config -static - make build_libs -j12 - test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd .. -else - opensslPath=$(pwd)/openssl_3 - echo "Using compiled openssl_3" -fi - -if [ ! -d "zlib" ]; then - git clone https://github.com/madler/zlib.git - cd zlib - zlibPath=`pwd` - ./configure --static - make -j12 - test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd .. -else - zlibPath=$(pwd)/zlib - echo "Using compiled zlib" -fi - -if [ ! -d "libmicrohttpd" ]; then - git clone https://git.gnunet.org/libmicrohttpd.git - cd libmicrohttpd - libmicrohttpdPath=`pwd` - ./autogen.sh - ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic - make -j12 - test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } - cd .. -else - libmicrohttpdPath=$(pwd)/libmicrohttpd - echo "Using compiled libmicrohttpd" -fi - -cmake -GNinja .. \ --DPORTABLE=1 \ --DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=$OSX_TARGET \ --DCMAKE_CXX_FLAGS="-stdlib=libc++" \ --DCMAKE_BUILD_TYPE=Release \ --DOPENSSL_FOUND=1 \ --DOPENSSL_INCLUDE_DIR=$opensslPath/include \ --DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.a \ --DZLIB_FOUND=1 \ --DZLIB_INCLUDE_DIR=$zlibPath \ --DZLIB_LIBRARIES=$zlibPath/libz.a \ --DSECP256K1_FOUND=1 \ --DSECP256K1_INCLUDE_DIR=$secp256k1Path/include \ --DSECP256K1_LIBRARY=$secp256k1Path/.libs/libsecp256k1.a \ --DSODIUM_FOUND=1 \ --DSODIUM_INCLUDE_DIR=$sodiumPath/src/libsodium/include \ --DSODIUM_LIBRARY_RELEASE=$sodiumPath/src/libsodium/.libs/libsodium.a \ --DMHD_FOUND=1 \ --DMHD_INCLUDE_DIR=$libmicrohttpdPath/src/include \ --DMHD_LIBRARY=$libmicrohttpdPath/src/microhttpd/.libs/libmicrohttpd.a \ --DLZ4_FOUND=1 \ --DLZ4_INCLUDE_DIRS=$lz4Path/lib \ --DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a - - -test $? -eq 0 || { echo "Can't configure ton"; exit 1; } - -if [ "$with_tests" = true ]; then - ninja storage-daemon storage-daemon-cli blockchain-explorer \ - tonlib tonlibjson tonlib-cli validator-engine func fift \ - lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server \ - http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \ - test-ed25519 test-ed25519-crypto test-bigint test-vm test-fift test-cells test-smartcont \ - test-net test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \ - test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -else - ninja storage-daemon storage-daemon-cli blockchain-explorer \ - tonlib tonlibjson tonlib-cli validator-engine func fift \ - lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server \ - http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -fi - -strip storage/storage-daemon/storage-daemon -strip storage/storage-daemon/storage-daemon-cli -strip blockchain-explorer/blockchain-explorer -strip crypto/fift -strip crypto/func -strip crypto/create-state -strip crypto/tlbc -strip validator-engine-console/validator-engine-console -strip tonlib/tonlib-cli -strip http/http-proxy -strip rldp-http-proxy/rldp-http-proxy -strip dht-server/dht-server -strip lite-client/lite-client -strip validator-engine/validator-engine -strip utils/generate-random-id -strip utils/json2tlo -strip adnl/adnl-proxy - -cd .. - -if [ "$with_artifacts" = true ]; then - echo Creating artifacts... - rm -rf artifacts - mkdir artifacts - cp crypto/fift/lib artifacts/ - cp -R crypto/smartcont/ artifacts/ - cp build/storage/storage-daemon/storage-daemon artifacts/ - cp build/storage/storage-daemon/storage-daemon-cli artifacts/ - cp build/blockchain-explorer/blockchain-explorer artifacts/ - cp build/crypto/fift artifacts/ - cp build/crypto/func artifacts/ - cp build/crypto/create-state artifacts/ - cp build/crypto/tlbc artifacts/ - cp build/validator-engine-console/validator-engine-console artifacts/ - cp build/tonlib/tonlib-cli artifacts/ - cp build/tonlib/libtonlibjson.0.5.dylib artifacts/libtonlibjson.dylib - cp build/http/http-proxy artifacts/ - cp build/rldp-http-proxy/rldp-http-proxy artifacts/ - cp build/dht-server/dht-server artifacts/ - cp build/lite-client/lite-client artifacts/ - cp build/validator-engine/validator-engine artifacts/ - cp build/utils/generate-random-id artifacts/ - cp build/utils/json2tlo artifacts/ - cp build/adnl/adnl-proxy artifacts/ - cp build/emulator/libemulator.dylib artifacts/ - chmod +x artifacts/* - rsync -r crypto/smartcont artifacts/ - rsync -r crypto/fift/lib artifacts/ -fi - -if [ "$with_tests" = true ]; then - cd build -# ctest --output-on-failure -E "test-catchain|test-actors" - ctest --output-on-failure -fi diff --git a/assembly/native/build-macos-shared.sh b/assembly/native/build-macos-shared.sh deleted file mode 100644 index 0f16eeda6..000000000 --- a/assembly/native/build-macos-shared.sh +++ /dev/null @@ -1,152 +0,0 @@ -#/bin/bash - -with_tests=false -with_artifacts=false -OSX_TARGET=10.15 - - -while getopts 'tao:' flag; do - case "${flag}" in - t) with_tests=true ;; - a) with_artifacts=true ;; - o) OSX_TARGET=${OPTARG} ;; - *) break - ;; - esac -done - -if [ ! -d "build" ]; then - mkdir build - cd build -else - cd build - rm -rf .ninja* CMakeCache.txt -fi - -export NONINTERACTIVE=1 -brew install ninja libsodium libmicrohttpd pkg-config automake libtool autoconf gnutls -brew install llvm@16 - -if [ -f /opt/homebrew/opt/llvm@16/bin/clang ]; then - export CC=/opt/homebrew/opt/llvm@16/bin/clang - export CXX=/opt/homebrew/opt/llvm@16/bin/clang++ -else - export CC=/usr/local/opt/llvm@16/bin/clang - export CXX=/usr/local/opt/llvm@16/bin/clang++ -fi -export CCACHE_DISABLE=1 - -if [ ! -d "secp256k1" ]; then - git clone https://github.com/bitcoin-core/secp256k1.git - cd secp256k1 - secp256k1Path=`pwd` - git checkout v0.3.2 - ./autogen.sh - ./configure --enable-module-recovery --enable-static --disable-tests --disable-benchmark - make -j12 - test $? -eq 0 || { echo "Can't compile secp256k1"; exit 1; } - cd .. -else - secp256k1Path=$(pwd)/secp256k1 - echo "Using compiled secp256k1" -fi - -if [ ! -d "lz4" ]; then - git clone https://github.com/lz4/lz4 - cd lz4 - lz4Path=`pwd` - git checkout v1.9.4 - make -j12 - test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } - cd .. -else - lz4Path=$(pwd)/lz4 - echo "Using compiled lz4" -fi - -brew unlink openssl@1.1 -brew install openssl@3 -brew unlink openssl@3 && brew link --overwrite openssl@3 - -cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. \ --DCMAKE_CXX_FLAGS="-stdlib=libc++" \ --DSECP256K1_FOUND=1 \ --DSECP256K1_INCLUDE_DIR=$secp256k1Path/include \ --DSECP256K1_LIBRARY=$secp256k1Path/.libs/libsecp256k1.a \ --DLZ4_FOUND=1 \ --DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a \ --DLZ4_INCLUDE_DIRS=$lz4Path/lib - -test $? -eq 0 || { echo "Can't configure ton"; exit 1; } - -if [ "$with_tests" = true ]; then - ninja storage-daemon storage-daemon-cli blockchain-explorer \ - tonlib tonlibjson tonlib-cli validator-engine func fift \ - lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server \ - http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \ - test-ed25519 test-ed25519-crypto test-bigint test-vm test-fift test-cells test-smartcont \ - test-net test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \ - test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -else - ninja storage-daemon storage-daemon-cli blockchain-explorer \ - tonlib tonlibjson tonlib-cli validator-engine func fift \ - lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server \ - http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -fi - - -strip storage/storage-daemon/storage-daemon -strip storage/storage-daemon/storage-daemon-cli -strip blockchain-explorer/blockchain-explorer -strip crypto/fift -strip crypto/func -strip crypto/create-state -strip crypto/tlbc -strip validator-engine-console/validator-engine-console -strip tonlib/tonlib-cli -strip http/http-proxy -strip rldp-http-proxy/rldp-http-proxy -strip dht-server/dht-server -strip lite-client/lite-client -strip validator-engine/validator-engine -strip utils/generate-random-id -strip utils/json2tlo -strip adnl/adnl-proxy - -cd .. - -if [ "$with_artifacts" = true ]; then - echo Creating artifacts... - rm -rf artifacts - mkdir artifacts - cp build/storage/storage-daemon/storage-daemon artifacts/ - cp build/storage/storage-daemon/storage-daemon-cli artifacts/ - cp build/blockchain-explorer/blockchain-explorer artifacts/ - cp build/crypto/fift artifacts/ - cp build/crypto/func artifacts/ - cp build/crypto/create-state artifacts/ - cp build/crypto/tlbc artifacts/ - cp build/validator-engine-console/validator-engine-console artifacts/ - cp build/tonlib/tonlib-cli artifacts/ - cp build/tonlib/libtonlibjson.0.5.dylib artifacts/libtonlibjson.dylib - cp build/http/http-proxy artifacts/ - cp build/rldp-http-proxy/rldp-http-proxy artifacts/ - cp build/dht-server/dht-server artifacts/ - cp build/lite-client/lite-client artifacts/ - cp build/validator-engine/validator-engine artifacts/ - cp build/utils/generate-random-id artifacts/ - cp build/utils/json2tlo artifacts/ - cp build/adnl/adnl-proxy artifacts/ - cp build/emulator/libemulator.dylib artifacts/ - chmod +x artifacts/* - rsync -r crypto/smartcont artifacts/ - rsync -r crypto/fift/lib artifacts/ -fi - -if [ "$with_tests" = true ]; then - cd build -# ctest --output-on-failure -E "test-catchain|test-actors" - ctest --output-on-failure --timeout 1800 -fi diff --git a/assembly/native/build-ubuntu-portable.sh b/assembly/native/build-ubuntu-portable.sh deleted file mode 100644 index a3a11f1b2..000000000 --- a/assembly/native/build-ubuntu-portable.sh +++ /dev/null @@ -1,216 +0,0 @@ -#/bin/bash - -#sudo apt-get update -#sudo apt-get install -y build-essential git cmake ninja-build automake libtool texinfo autoconf - -with_tests=false -with_artifacts=false - - -while getopts 'ta' flag; do - case "${flag}" in - t) with_tests=true ;; - a) with_artifacts=true ;; - *) break - ;; - esac -done - -if [ ! -d "build" ]; then - mkdir build - cd build -else - cd build - rm -rf .ninja* CMakeCache.txt -fi - -export CC=$(which clang-16) -export CXX=$(which clang++-16) -export CCACHE_DISABLE=1 - -if [ ! -d "lz4" ]; then -git clone https://github.com/lz4/lz4.git -cd lz4 -lz4Path=`pwd` -git checkout v1.9.4 -make -j12 -test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } -cd .. -# ./lib/liblz4.a -# ./lib -else - lz4Path=$(pwd)/lz4 - echo "Using compiled lz4" -fi - -if [ ! -d "secp256k1" ]; then -git clone https://github.com/bitcoin-core/secp256k1.git -cd secp256k1 -secp256k1Path=`pwd` -git checkout v0.3.2 -./autogen.sh -./configure --enable-module-recovery --enable-static --disable-tests --disable-benchmark --with-pic -make -j12 -test $? -eq 0 || { echo "Can't compile secp256k1"; exit 1; } -cd .. -# ./.libs/libsecp256k1.a -# ./include -else - secp256k1Path=$(pwd)/secp256k1 - echo "Using compiled secp256k1" -fi - -if [ ! -d "libsodium" ]; then - export LIBSODIUM_FULL_BUILD=1 - git clone https://github.com/jedisct1/libsodium.git - cd libsodium - sodiumPath=`pwd` - git checkout 1.0.18 - ./autogen.sh - ./configure --with-pic --enable-static - make -j12 - test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } - cd .. -else - sodiumPath=$(pwd)/libsodium - echo "Using compiled libsodium" -fi - -if [ ! -d "openssl_3" ]; then - git clone https://github.com/openssl/openssl openssl_3 - cd openssl_3 - opensslPath=`pwd` - git checkout openssl-3.1.4 - ./config -static - make build_libs -j12 - test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd .. -else - opensslPath=$(pwd)/openssl_3 - echo "Using compiled openssl_3" -fi - -if [ ! -d "zlib" ]; then - git clone https://github.com/madler/zlib.git - cd zlib - zlibPath=`pwd` - ./configure --static - make -j12 - test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd .. -else - zlibPath=$(pwd)/zlib - echo "Using compiled zlib" -fi - -if [ ! -d "libmicrohttpd" ]; then - git clone https://git.gnunet.org/libmicrohttpd.git - cd libmicrohttpd - libmicrohttpdPath=`pwd` - ./autogen.sh - ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic - make -j12 - test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } - cd .. -else - libmicrohttpdPath=$(pwd)/libmicrohttpd - echo "Using compiled libmicrohttpd" -fi - -cmake -GNinja .. \ --DPORTABLE=1 \ --DCMAKE_BUILD_TYPE=Release \ --DOPENSSL_FOUND=1 \ --DOPENSSL_INCLUDE_DIR=$opensslPath/include \ --DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.a \ --DZLIB_FOUND=1 \ --DZLIB_INCLUDE_DIR=$zlibPath \ --DZLIB_LIBRARIES=$zlibPath/libz.a \ --DSECP256K1_FOUND=1 \ --DSECP256K1_INCLUDE_DIR=$secp256k1Path/include \ --DSECP256K1_LIBRARY=$secp256k1Path/.libs/libsecp256k1.a \ --DSODIUM_FOUND=1 \ --DSODIUM_INCLUDE_DIR=$sodiumPath/src/libsodium/include \ --DSODIUM_LIBRARY_RELEASE=$sodiumPath/src/libsodium/.libs/libsodium.a \ --DMHD_FOUND=1 \ --DMHD_INCLUDE_DIR=$libmicrohttpdPath/src/include \ --DMHD_LIBRARY=$libmicrohttpdPath/src/microhttpd/.libs/libmicrohttpd.a \ --DLZ4_FOUND=1 \ --DLZ4_INCLUDE_DIRS=$lz4Path/lib \ --DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a - - - -test $? -eq 0 || { echo "Can't configure ton"; exit 1; } - -if [ "$with_tests" = true ]; then -ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \ - validator-engine lite-client pow-miner validator-engine-console blockchain-explorer \ - generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ - adnl-proxy create-state emulator test-ed25519 test-ed25519-crypto test-bigint \ - test-vm test-fift test-cells test-smartcont test-net test-tdactor test-tdutils \ - test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain \ - test-fec test-tddb test-db test-validator-session-state - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -else -ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \ - validator-engine lite-client pow-miner validator-engine-console blockchain-explorer \ - generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ - adnl-proxy create-state emulator - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -fi - -strip -g storage/storage-daemon/storage-daemon \ - storage/storage-daemon/storage-daemon-cli \ - blockchain-explorer/blockchain-explorer \ - crypto/fift \ - crypto/tlbc \ - crypto/func \ - crypto/create-state \ - validator-engine-console/validator-engine-console \ - tonlib/tonlib-cli \ - tonlib/libtonlibjson.so.0.5 \ - http/http-proxy \ - rldp-http-proxy/rldp-http-proxy \ - dht-server/dht-server \ - lite-client/lite-client \ - validator-engine/validator-engine \ - utils/generate-random-id \ - utils/json2tlo \ - adnl/adnl-proxy \ - emulator/libemulator.* - -test $? -eq 0 || { echo "Can't strip final binaries"; exit 1; } - -# simple binaries' test -./storage/storage-daemon/storage-daemon -V || exit 1 -./validator-engine/validator-engine -V || exit 1 -./lite-client/lite-client -V || exit 1 -./crypto/fift -V || exit 1 - -cd .. - -if [ "$with_artifacts" = true ]; then - rm -rf artifacts - mkdir artifacts - cp crypto/fift/lib artifacts/ - cp -R crypto/smartcont/ artifacts/ - mv build/tonlib/libtonlibjson.so.0.5 build/tonlib/libtonlibjson.so - cp build/storage/storage-daemon/storage-daemon build/storage/storage-daemon/storage-daemon-cli \ - build/crypto/fift build/crypto/tlbc build/crypto/func build/crypto/create-state build/blockchain-explorer/blockchain-explorer \ - build/validator-engine-console/validator-engine-console build/tonlib/tonlib-cli \ - build/tonlib/libtonlibjson.so build/http/http-proxy build/rldp-http-proxy/rldp-http-proxy \ - build/dht-server/dht-server build/lite-client/lite-client build/validator-engine/validator-engine \ - build/utils/generate-random-id build/utils/json2tlo build/adnl/adnl-proxy build/emulator/libemulator.so \ - artifacts - test $? -eq 0 || { echo "Can't copy final binaries"; exit 1; } - chmod +x artifacts/* - cp -R crypto/smartcont artifacts - cp -R crypto/fift/lib artifacts -fi - -if [ "$with_tests" = true ]; then - cd build -# ctest --output-on-failure -E "test-catchain|test-actors|test-smartcont|test-adnl|test-validator-session-state|test-dht|test-rldp" - ctest --output-on-failure -E "test-adnl" -fi diff --git a/assembly/native/build-ubuntu-shared.sh b/assembly/native/build-ubuntu-shared.sh deleted file mode 100644 index ec868ecd2..000000000 --- a/assembly/native/build-ubuntu-shared.sh +++ /dev/null @@ -1,124 +0,0 @@ -#/bin/bash - -#sudo apt-get update -#sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev - -with_tests=false -with_artifacts=false - - -while getopts 'ta' flag; do - case "${flag}" in - t) with_tests=true ;; - a) with_artifacts=true ;; - *) break - ;; - esac -done - -if [ ! -d "build" ]; then - mkdir build - cd build -else - cd build - rm -rf .ninja* CMakeCache.txt -fi - -export CC=$(which clang-16) -export CXX=$(which clang++-16) -export CCACHE_DISABLE=1 - -if [ ! -d "openssl_3" ]; then - git clone https://github.com/openssl/openssl openssl_3 - cd openssl_3 - opensslPath=`pwd` - git checkout openssl-3.1.4 - ./config - make build_libs -j12 - test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd .. -else - opensslPath=$(pwd)/openssl_3 - echo "Using compiled openssl_3" -fi - -cmake -GNinja -DTON_USE_JEMALLOC=ON .. \ --DCMAKE_BUILD_TYPE=Release \ --DOPENSSL_ROOT_DIR=$opensslPath \ --DOPENSSL_INCLUDE_DIR=$opensslPath/include \ --DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.so - - -test $? -eq 0 || { echo "Can't configure ton"; exit 1; } - -if [ "$with_tests" = true ]; then -ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \ - validator-engine lite-client pow-miner validator-engine-console blockchain-explorer \ - generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ - adnl-proxy create-state emulator test-ed25519 test-ed25519-crypto test-bigint \ - test-vm test-fift test-cells test-smartcont test-net test-tdactor test-tdutils \ - test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain \ - test-fec test-tddb test-db test-validator-session-state - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -else -ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \ - validator-engine lite-client pow-miner validator-engine-console blockchain-explorer \ - generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ - adnl-proxy create-state emulator - test $? -eq 0 || { echo "Can't compile ton"; exit 1; } -fi - -strip -g storage/storage-daemon/storage-daemon \ - storage/storage-daemon/storage-daemon-cli \ - blockchain-explorer/blockchain-explorer \ - crypto/fift \ - crypto/tlbc \ - crypto/func \ - crypto/create-state \ - validator-engine-console/validator-engine-console \ - tonlib/tonlib-cli \ - tonlib/libtonlibjson.so.0.5 \ - http/http-proxy \ - rldp-http-proxy/rldp-http-proxy \ - dht-server/dht-server \ - lite-client/lite-client \ - validator-engine/validator-engine \ - utils/generate-random-id \ - utils/json2tlo \ - adnl/adnl-proxy \ - emulator/libemulator.* - -test $? -eq 0 || { echo "Can't strip final binaries"; exit 1; } - -# simple binaries' test -./storage/storage-daemon/storage-daemon -V || exit 1 -./validator-engine/validator-engine -V || exit 1 -./lite-client/lite-client -V || exit 1 -./crypto/fift -V || exit 1 - -ldd ./validator-engine/validator-engine || exit 1 - -cd .. - -if [ "$with_artifacts" = true ]; then - rm -rf artifacts - mkdir artifacts - mv build/tonlib/libtonlibjson.so.0.5 build/tonlib/libtonlibjson.so - cp build/storage/storage-daemon/storage-daemon build/storage/storage-daemon/storage-daemon-cli \ - build/crypto/fift build/crypto/tlbc build/crypto/func build/crypto/create-state build/blockchain-explorer/blockchain-explorer \ - build/validator-engine-console/validator-engine-console build/tonlib/tonlib-cli \ - build/tonlib/libtonlibjson.so build/http/http-proxy build/rldp-http-proxy/rldp-http-proxy \ - build/dht-server/dht-server build/lite-client/lite-client build/validator-engine/validator-engine \ - build/utils/generate-random-id build/utils/json2tlo build/adnl/adnl-proxy build/emulator/libemulator.so \ - artifacts - test $? -eq 0 || { echo "Can't copy final binaries"; exit 1; } - chmod +x artifacts/* - cp -R crypto/smartcont artifacts - cp -R crypto/fift/lib artifacts -fi - -if [ "$with_tests" = true ]; then - cd build -# ctest --output-on-failure -E "test-catchain|test-actors|test-smartcont|test-adnl|test-validator-session-state|test-dht|test-rldp" - ctest --output-on-failure --timeout 1800 -fi diff --git a/assembly/native/build-windows-github.bat b/assembly/native/build-windows-github.bat deleted file mode 100644 index 7cad8c7e5..000000000 --- a/assembly/native/build-windows-github.bat +++ /dev/null @@ -1,2 +0,0 @@ -call "C:\Program Files\Microsoft Visual Studio\2022\%1\VC\Auxiliary\Build\vcvars64.bat" -call build-windows.bat -t \ No newline at end of file diff --git a/assembly/native/build-windows-python.bat b/assembly/native/build-windows-python.bat deleted file mode 100644 index 41e9e718f..000000000 --- a/assembly/native/build-windows-python.bat +++ /dev/null @@ -1,120 +0,0 @@ -REM execute this script inside elevated (Run as Administrator) console "x64 Native Tools Command Prompt for VS 2022" - -echo off - -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - -echo Installing ninja... -choco install -y ninja -IF errorlevel 1 ( - echo Can't install ninja - exit /b %errorlevel% -) - -if not exist "zlib" ( -git clone https://github.com/madler/zlib.git -cd zlib\contrib\vstudio\vc14 -msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v143 - -IF errorlevel 1 ( - echo Can't install zlib - exit /b %errorlevel% -) -cd ..\..\..\.. -) else ( -echo Using zlib... -) - -if not exist "secp256k1" ( -git clone https://github.com/libbitcoin/secp256k1.git -cd secp256k1\builds\msvc\vs2017 -msbuild /p:Configuration=StaticRelease -p:PlatformToolset=v143 -p:Platform=x64 -IF errorlevel 1 ( - echo Can't install secp256k1 - exit /b %errorlevel% -) -cd ..\..\..\.. -) else ( -echo Using secp256k1... -) - - -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 1 ( - echo Can't download libsodium - exit /b %errorlevel% -) -unzip libsodium-1.0.18-stable-msvc.zip -) else ( -echo Using libsodium... -) - -if not exist "openssl-3.1.4" ( -curl -Lo openssl-3.1.4.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/openssl-3.1.4.zip -IF errorlevel 1 ( - echo Can't download OpenSSL - exit /b %errorlevel% -) -unzip -q openssl-3.1.4.zip -) else ( -echo Using openssl... -) - -if not exist "libmicrohttpd-0.9.77-w32-bin" ( -curl -Lo libmicrohttpd-0.9.77-w32-bin.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/libmicrohttpd-0.9.77-w32-bin.zip -IF errorlevel 1 ( - echo Can't download libmicrohttpd - exit /b %errorlevel% -) -unzip -q libmicrohttpd-0.9.77-w32-bin.zip -) else ( -echo Using libmicrohttpd... -) - -if not exist "readline-5.0-1-lib" ( -curl -Lo readline-5.0-1-lib.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/readline-5.0-1-lib.zip -IF errorlevel 1 ( - echo Can't download readline - exit /b %errorlevel% -) -unzip -q -d readline-5.0-1-lib readline-5.0-1-lib.zip -) else ( -echo Using readline... -) - - -set root=%cd% -echo %root% -set SODIUM_DIR=%root%\libsodium - -mkdir build -cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^ --DTON_USE_PYTHON=1 ^ --DTON_USE_ABSEIL=0 ^ --DPORTABLE=1 ^ --DSODIUM_USE_STATIC_LIBS=1 ^ --DSECP256K1_FOUND=1 ^ --DSECP256K1_INCLUDE_DIR=%root%\secp256k1\include ^ --DSECP256K1_LIBRARY=%root%\secp256k1\bin\x64\Release\v143\static\secp256k1.lib ^ --DMHD_FOUND=1 ^ --DMHD_LIBRARY=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static\libmicrohttpd.lib ^ --DMHD_INCLUDE_DIR=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static ^ --DZLIB_FOUND=1 ^ --DZLIB_INCLUDE_DIR=%root%\zlib ^ --DZLIB_LIBRARIES=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^ --DOPENSSL_FOUND=1 ^ --DOPENSSL_INCLUDE_DIR=%root%/openssl-3.1.4/x64/include ^ --DOPENSSL_CRYPTO_LIBRARY=%root%/openssl-3.1.4/x64/lib/libcrypto_static.lib ^ --DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj" .. -IF errorlevel 1 ( - echo Can't configure TON - exit /b %errorlevel% -) - -cmake --build . --config Release -j %NUMBER_OF_PROCESSORS% --target python_ton -IF errorlevel 1 ( - echo Can't compile TON - exit /b %errorlevel% -) \ No newline at end of file diff --git a/assembly/native/build-windows.bat b/assembly/native/build-windows.bat deleted file mode 100644 index 9b7322e1d..000000000 --- a/assembly/native/build-windows.bat +++ /dev/null @@ -1,222 +0,0 @@ -REM execute this script inside elevated (Run as Administrator) console "x64 Native Tools Command Prompt for VS 2022" - -echo off - -echo Installing chocolatey windows package manager... -@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" -choco -? -IF %errorlevel% NEQ 0 ( - echo Can't install chocolatey - exit /b %errorlevel% -) - -choco feature enable -n allowEmptyChecksums - -echo Installing pkgconfiglite... -choco install -y pkgconfiglite -IF %errorlevel% NEQ 0 ( - echo Can't install pkgconfiglite - exit /b %errorlevel% -) - -echo Installing ninja... -choco install -y ninja -IF %errorlevel% NEQ 0 ( - echo Can't install ninja - exit /b %errorlevel% -) - -if not exist "zlib" ( -git clone https://github.com/madler/zlib.git -cd zlib -git checkout v1.3.1 -cd contrib\vstudio\vc14 -msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v143 - -IF %errorlevel% NEQ 0 ( - echo Can't install zlib - exit /b %errorlevel% -) -cd ..\..\..\.. -) else ( -echo Using zlib... -) - -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=v143 -dir /s -IF %errorlevel% NEQ 0 ( - echo Can't install lz4 - exit /b %errorlevel% -) -cd ..\..\..\.. -) else ( -echo Using lz4... -) - -if not exist "secp256k1" ( -git clone https://github.com/bitcoin-core/secp256k1.git -cd secp256k1 -git checkout v0.3.2 -cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DBUILD_SHARED_LIBS=OFF -IF %errorlevel% NEQ 0 ( - echo Can't configure secp256k1 - exit /b %errorlevel% -) -cmake --build build --config Release -IF %errorlevel% NEQ 0 ( - echo Can't install secp256k1 - exit /b %errorlevel% -) -cd .. -) else ( -echo Using secp256k1... -) - - -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... -) - -if not exist "openssl-3.1.4" ( -curl -Lo openssl-3.1.4.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/openssl-3.1.4.zip -IF %errorlevel% NEQ 0 ( - echo Can't download OpenSSL - exit /b %errorlevel% -) -unzip -q openssl-3.1.4.zip -) else ( -echo Using openssl... -) - -if not exist "libmicrohttpd-0.9.77-w32-bin" ( -curl -Lo libmicrohttpd-0.9.77-w32-bin.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/libmicrohttpd-0.9.77-w32-bin.zip -IF %errorlevel% NEQ 0 ( - echo Can't download libmicrohttpd - exit /b %errorlevel% -) -unzip -q libmicrohttpd-0.9.77-w32-bin.zip -) else ( -echo Using libmicrohttpd... -) - -if not exist "readline-5.0-1-lib" ( -curl -Lo readline-5.0-1-lib.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/readline-5.0-1-lib.zip -IF %errorlevel% NEQ 0 ( - echo Can't download readline - exit /b %errorlevel% -) -unzip -q -d readline-5.0-1-lib readline-5.0-1-lib.zip -) else ( -echo Using readline... -) - - -set root=%cd% -echo %root% -set SODIUM_DIR=%root%\libsodium - -mkdir build -cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^ --DPORTABLE=1 ^ --DSODIUM_USE_STATIC_LIBS=1 ^ --DSECP256K1_FOUND=1 ^ --DSECP256K1_INCLUDE_DIR=%root%\secp256k1\include ^ --DSECP256K1_LIBRARY=%root%\secp256k1\build\src\Release\libsecp256k1.lib ^ --DLZ4_FOUND=1 ^ --DLZ4_INCLUDE_DIRS=%root%\lz4\lib ^ --DLZ4_LIBRARIES=%root%\lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^ --DMHD_FOUND=1 ^ --DMHD_LIBRARY=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static\libmicrohttpd.lib ^ --DMHD_INCLUDE_DIR=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static ^ --DZLIB_FOUND=1 ^ --DZLIB_INCLUDE_DIR=%root%\zlib ^ --DZLIB_LIBRARIES=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^ --DOPENSSL_FOUND=1 ^ --DOPENSSL_INCLUDE_DIR=%root%\openssl-3.1.4\x64\include ^ --DOPENSSL_CRYPTO_LIBRARY=%root%\openssl-3.1.4\x64\lib\libcrypto_static.lib ^ --DREADLINE_INCLUDE_DIR=%root%\readline-5.0-1-lib\include ^ --DREADLINE_LIBRARY=%root%\readline-5.0-1-lib\lib\readline.lib ^ --DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj" .. -IF %errorlevel% NEQ 0 ( - echo Can't configure TON - exit /b %errorlevel% -) - -IF "%1"=="-t" ( -ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tonlib tonlibjson ^ -tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id ^ -json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator ^ -test-ed25519 test-ed25519-crypto test-bigint test-vm test-fift test-cells test-smartcont test-net ^ -test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^ -test-fec test-tddb test-db test-validator-session-state -IF %errorlevel% NEQ 0 ( - echo Can't compile TON - exit /b %errorlevel% -) -) else ( -ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tonlib tonlibjson ^ -tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id ^ -json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator -IF %errorlevel% NEQ 0 ( - echo Can't compile TON - exit /b %errorlevel% -) -) - -copy validator-engine\validator-engine.exe test -IF %errorlevel% NEQ 0 ( - echo validator-engine.exe does not exist - exit /b %errorlevel% -) - -IF "%1"=="-t" ( - echo Running tests... -REM ctest -C Release --output-on-failure -E "test-catchain|test-actors|test-validator-session-state" - ctest -C Release --output-on-failure -E "test-bigint" --timeout 1800 - IF %errorlevel% NEQ 0 ( - echo Some tests failed - exit /b %errorlevel% - ) -) - - -echo Creating artifacts... -cd .. -mkdir artifacts -mkdir artifacts\smartcont -mkdir artifacts\lib - -for %%I in (build\storage\storage-daemon\storage-daemon.exe ^ -build\storage\storage-daemon\storage-daemon-cli.exe ^ -build\blockchain-explorer\blockchain-explorer.exe ^ -build\crypto\fift.exe ^ -build\crypto\tlbc.exe ^ -build\crypto\func.exe ^ -build\crypto\create-state.exe ^ -build\validator-engine-console\validator-engine-console.exe ^ -build\tonlib\tonlib-cli.exe ^ -build\tonlib\tonlibjson.dll ^ -build\http\http-proxy.exe ^ -build\rldp-http-proxy\rldp-http-proxy.exe ^ -build\dht-server\dht-server.exe ^ -build\lite-client\lite-client.exe ^ -build\validator-engine\validator-engine.exe ^ -build\utils\generate-random-id.exe ^ -build\utils\json2tlo.exe ^ -build\adnl\adnl-proxy.exe ^ -build\emulator\emulator.dll) do (strip -g %%I & copy %%I artifacts\) -xcopy /e /k /h /i crypto\smartcont artifacts\smartcont -xcopy /e /k /h /i crypto\fift\lib artifacts\lib diff --git a/assembly/nix/build-linux-arm64-nix.sh b/assembly/nix/build-linux-arm64-nix.sh deleted file mode 100644 index bb8591413..000000000 --- a/assembly/nix/build-linux-arm64-nix.sh +++ /dev/null @@ -1,20 +0,0 @@ -#/bin/bash - -nix-build --version -test $? -eq 0 || { echo "Nix is not installed!"; exit 1; } - -cp assembly/nix/linux-arm64* . -cp assembly/nix/microhttpd.nix . -cp assembly/nix/openssl.nix . -export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz - -nix-build linux-arm64-static.nix -mkdir artifacts -cp ./result/bin/* artifacts/ -chmod +x artifacts/* -rm -rf result -nix-build linux-arm64-tonlib.nix -cp ./result/lib/libtonlibjson.so.0.5 artifacts/libtonlibjson.so -cp ./result/lib/libemulator.so artifacts/ -cp -r crypto/fift/lib artifacts/ -cp -r crypto/smartcont artifacts/ \ No newline at end of file diff --git a/assembly/nix/build-linux-x86-64-nix.sh b/assembly/nix/build-linux-x86-64-nix.sh deleted file mode 100644 index eca6fe58b..000000000 --- a/assembly/nix/build-linux-x86-64-nix.sh +++ /dev/null @@ -1,20 +0,0 @@ -#/bin/bash - -nix-build --version -test $? -eq 0 || { echo "Nix is not installed!"; exit 1; } - -cp assembly/nix/linux-x86-64* . -cp assembly/nix/microhttpd.nix . -cp assembly/nix/openssl.nix . -export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz - -nix-build linux-x86-64-static.nix -mkdir artifacts -cp ./result/bin/* artifacts/ -chmod +x artifacts/* -rm -rf result -nix-build linux-x86-64-tonlib.nix -cp ./result/lib/libtonlibjson.so.0.5 artifacts/libtonlibjson.so -cp ./result/lib/libemulator.so artifacts/ -cp -r crypto/fift/lib artifacts/ -cp -r crypto/smartcont artifacts/ \ No newline at end of file diff --git a/assembly/nix/build-macos-nix.sh b/assembly/nix/build-macos-nix.sh deleted file mode 100644 index fdf674a69..000000000 --- a/assembly/nix/build-macos-nix.sh +++ /dev/null @@ -1,17 +0,0 @@ -#/bin/bash - -nix-build --version -test $? -eq 0 || { echo "Nix is not installed!"; exit 1; } - -cp assembly/nix/macos-* . -export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz -nix-build macos-static.nix -mkdir artifacts -cp ./result-bin/bin/* artifacts/ -chmod +x artifacts/* -rm -rf result-bin -nix-build macos-tonlib.nix -cp ./result/lib/libtonlibjson.dylib artifacts/ -cp ./result/lib/libemulator.dylib artifacts/ -cp -r crypto/fift/lib artifacts/ -cp -r crypto/smartcont artifacts/ \ No newline at end of file diff --git a/assembly/nix/linux-arm64-static.nix b/assembly/nix/linux-arm64-static.nix deleted file mode 100644 index b43afb281..000000000 --- a/assembly/nix/linux-arm64-static.nix +++ /dev/null @@ -1,66 +0,0 @@ -# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz - -{ pkgs ? import { system = builtins.currentSystem; } -, lib ? pkgs.lib -, stdenv ? pkgs.stdenv -, system ? builtins.currentSystem -, src ? ./. -}: - -let - boostStatic = pkgs.boost.overrideAttrs (oldAttrs: { - buildInputs = (oldAttrs.buildInputs or []) ++ [ pkgsStatic.stdenv ]; - doCheck = false; - configureFlags = [ "--with-libraries=all" "--with-icu" "--with-serialization" "--with-date_time" "--with-thread" "--with-regex" "--with-filesystem" "--with-program_options" "--with-system" "--with-chrono" "--with-random" "--with-test" ]; - }); -in - -let - microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; }; -in -with import microhttpdmy; -stdenv.mkDerivation { - pname = "ton"; - version = "dev-bin"; - - inherit src; - - nativeBuildInputs = with pkgs; - [ - cmake ninja git pkg-config - ]; - - buildInputs = with pkgs; - [ - pkgsStatic.openssl - microhttpdmy - pkgsStatic.zlib - pkgsStatic.libsodium.dev - pkgsStatic.secp256k1 - glibc.static - boostStatic - ]; - - makeStatic = true; - doCheck = true; - - cmakeFlags = [ - "-DTON_USE_ABSEIL=OFF" - "-DNIX=ON" - "-DBUILD_SHARED_LIBS=OFF" - "-DCMAKE_LINK_SEARCH_START_STATIC=ON" - "-DCMAKE_LINK_SEARCH_END_STATIC=ON" - "-DMHD_FOUND=1" - "-DMHD_INCLUDE_DIR=${microhttpdmy}/usr/local/include" - "-DMHD_LIBRARY=${microhttpdmy}/usr/local/lib/libmicrohttpd.a" - "-DCMAKE_CTEST_ARGUMENTS=--timeout;1800" - "-DBOOST_ROOT=${boostStatic}" - "-DBOOST_INCLUDEDIR=${boostStatic.dev}/include" - "-DBOOST_LIBRARYDIR=${boostStatic.lib}/lib" - "-DBoost_USE_STATIC_LIBS=ON" - ]; - - LDFLAGS = [ - "-static-libgcc" "-static-libstdc++" "-static" - ]; -} diff --git a/assembly/nix/linux-arm64-tonlib.nix b/assembly/nix/linux-arm64-tonlib.nix deleted file mode 100644 index 267bcd3c2..000000000 --- a/assembly/nix/linux-arm64-tonlib.nix +++ /dev/null @@ -1,51 +0,0 @@ -# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz -{ - pkgs ? import { inherit system; } -, lib ? pkgs.lib -, stdenv ? pkgs.stdenv -, system ? builtins.currentSystem -, src ? ./. -}: -let - microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; }; -in -with import microhttpdmy; -pkgs.llvmPackages_16.stdenv.mkDerivation { - pname = "ton"; - version = "dev-lib"; - - inherit src; - - nativeBuildInputs = with pkgs; - [ - cmake ninja git pkg-config - ]; - - buildInputs = with pkgs; - [ - pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.secp256k1 - (pkgsStatic.libsodium.overrideAttrs (oldAttrs: { - # https://github.com/jedisct1/libsodium/issues/292#issuecomment-137135369 - configureFlags = oldAttrs.configureFlags ++ [ " --disable-pie" ]; - hardeningDisable = oldAttrs.hardeningDisable ++ [ "pie" ]; - })) - ]; - - dontAddStaticConfigureFlags = false; - - cmakeFlags = [ - "-DTON_USE_ABSEIL=OFF" - "-DNIX=ON" - "-DMHD_FOUND=1" - "-DMHD_INCLUDE_DIR=${microhttpdmy}/usr/local/include" - "-DMHD_LIBRARY=${microhttpdmy}/usr/local/lib/libmicrohttpd.a" - ]; - - LDFLAGS = [ - "-static-libgcc" "-static-libstdc++" "-fPIC" "-fcommon" - ]; - - ninjaFlags = [ - "tonlibjson" "emulator" - ]; -} diff --git a/assembly/nix/linux-x86-64-static.nix b/assembly/nix/linux-x86-64-static.nix deleted file mode 100644 index 9be84bcf5..000000000 --- a/assembly/nix/linux-x86-64-static.nix +++ /dev/null @@ -1,47 +0,0 @@ -# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz - -{ pkgs ? import { inherit system; } -, lib ? pkgs.lib -, stdenv ? pkgs.stdenv -, system ? builtins.currentSystem -, src ? ./. -}: -let - microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; }; -in -with import microhttpdmy; -stdenv.mkDerivation { - pname = "ton"; - version = "dev-bin"; - - inherit src; - - nativeBuildInputs = with pkgs; - [ - cmake ninja git pkg-config - ]; - - buildInputs = with pkgs; - [ - pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.libsodium.dev pkgsStatic.secp256k1 glibc.static - ]; - - makeStatic = true; - doCheck = true; - - cmakeFlags = [ - "-DTON_USE_ABSEIL=OFF" - "-DNIX=ON" - "-DBUILD_SHARED_LIBS=OFF" - "-DCMAKE_LINK_SEARCH_START_STATIC=ON" - "-DCMAKE_LINK_SEARCH_END_STATIC=ON" - "-DMHD_FOUND=1" - "-DMHD_INCLUDE_DIR=${microhttpdmy}/usr/local/include" - "-DMHD_LIBRARY=${microhttpdmy}/usr/local/lib/libmicrohttpd.a" - "-DCMAKE_CTEST_ARGUMENTS=--timeout;1800" - ]; - - LDFLAGS = [ - "-static-libgcc" "-static-libstdc++" "-static" - ]; -} diff --git a/assembly/nix/linux-x86-64-tonlib.nix b/assembly/nix/linux-x86-64-tonlib.nix deleted file mode 100644 index 675079972..000000000 --- a/assembly/nix/linux-x86-64-tonlib.nix +++ /dev/null @@ -1,59 +0,0 @@ -# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.11.tar.gz -# copy linux-x86-64-tonlib.nix to git root directory and execute: -# nix-build linux-x86-64-tonlib.nix -{ - pkgs ? import { inherit system; } -, lib ? pkgs.lib -, stdenv ? pkgs.stdenv -, system ? builtins.currentSystem -, src ? ./. -}: -let - nixos1909 = (import (builtins.fetchTarball { - url = "https://channels.nixos.org/nixos-19.09/nixexprs.tar.xz"; - sha256 = "1vp1h2gkkrckp8dzkqnpcc6xx5lph5d2z46sg2cwzccpr8ay58zy"; - }) { inherit system; }); - glibc227 = nixos1909.glibc // { pname = "glibc"; }; - stdenv227 = let - cc = pkgs.wrapCCWith { - cc = nixos1909.buildPackages.gcc-unwrapped; - libc = glibc227; - bintools = pkgs.binutils.override { libc = glibc227; }; - }; - in (pkgs.overrideCC pkgs.stdenv cc); - -in -stdenv227.mkDerivation { - pname = "ton"; - version = "dev-lib"; - - inherit src; - - nativeBuildInputs = with pkgs; - [ cmake ninja git pkg-config ]; - - buildInputs = with pkgs; - [ - pkgsStatic.openssl pkgsStatic.zlib pkgsStatic.libmicrohttpd.dev pkgsStatic.secp256k1 - (pkgsStatic.libsodium.overrideAttrs (oldAttrs: { - # https://github.com/jedisct1/libsodium/issues/292#issuecomment-137135369 - configureFlags = oldAttrs.configureFlags ++ [ " --disable-pie" ]; - hardeningDisable = oldAttrs.hardeningDisable ++ [ "pie" ]; - })) - ]; - - dontAddStaticConfigureFlags = false; - - cmakeFlags = [ - "-DTON_USE_ABSEIL=OFF" - "-DNIX=ON" - ]; - - LDFLAGS = [ - "-static-libgcc" "-static-libstdc++" "-fPIC" - ]; - - ninjaFlags = [ - "tonlibjson" "emulator" - ]; -} diff --git a/assembly/nix/macos-static.nix b/assembly/nix/macos-static.nix deleted file mode 100644 index dbfe36938..000000000 --- a/assembly/nix/macos-static.nix +++ /dev/null @@ -1,78 +0,0 @@ -# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz - -{ pkgs ? import { inherit system; } -, lib ? pkgs.lib -, stdenv ? pkgs.stdenv -, system ? builtins.currentSystem -, src ? ./. -}: - -pkgs.llvmPackages_14.stdenv.mkDerivation { - pname = "ton"; - version = "dev-bin"; - - inherit src; - - nativeBuildInputs = with pkgs; - [ cmake ninja git pkg-config ]; - - buildInputs = with pkgs; - lib.forEach [ - secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev libtasn1.dev libidn2.dev libunistring.dev gettext jemalloc (gnutls.override { withP11-kit = false; }).dev - ] - (x: x.overrideAttrs(oldAttrs: rec { configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-shared" "--disable-tests" ]; dontDisableStatic = true; })) - ++ [ - darwin.apple_sdk.frameworks.CoreFoundation - (openssl.override { static = true; }).dev - (zlib.override { shared = false; }).dev - (libiconv.override { enableStatic = true; enableShared = false; }) - (lz4.override { enableStatic = true; enableShared = false; }).dev - ]; - - - dontAddStaticConfigureFlags = true; - makeStatic = true; - doCheck = true; - - configureFlags = []; - - cmakeFlags = [ - "-DTON_USE_ABSEIL=OFF" - "-DNIX=ON" - "-DTON_USE_JEMALLOC=ON" - "-DCMAKE_CROSSCOMPILING=OFF" - "-DCMAKE_LINK_SEARCH_START_STATIC=ON" - "-DCMAKE_LINK_SEARCH_END_STATIC=ON" - "-DBUILD_SHARED_LIBS=OFF" - "-DCMAKE_CXX_FLAGS=-stdlib=libc++" - "-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.3" - ]; - - LDFLAGS = [ - "-static-libstdc++" - "-framework CoreFoundation" - ]; - - postInstall = '' - moveToOutput bin "$bin" - ''; - - preFixup = '' - if [[ -n "$bin" ]]; then - for fn in "$bin"/bin/*; do - echo "Fixing libc++ in $fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++.1 | cut -d' ' -f1 | xargs)" libc++.1.dylib "$fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++abi.1 | cut -d' ' -f1 | xargs)" libc++abi.dylib "$fn" - done - fi - - if [[ -n "$out" ]]; then - for fn in "$out"/lib/*.{dylib,so}; do - echo "Fixing libc++ in $fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++.1 | cut -d' ' -f1 | xargs)" libc++.1.dylib "$fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++abi.1 | cut -d' ' -f1 | xargs)" libc++abi.dylib "$fn" - done - fi - ''; - outputs = [ "bin" "out" ]; -} \ No newline at end of file diff --git a/assembly/nix/macos-tonlib.nix b/assembly/nix/macos-tonlib.nix deleted file mode 100644 index dbba5c97d..000000000 --- a/assembly/nix/macos-tonlib.nix +++ /dev/null @@ -1,68 +0,0 @@ -# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz - -{ pkgs ? import { inherit system; } -, lib ? pkgs.lib -, stdenv ? pkgs.stdenv -, system ? builtins.currentSystem -, src ? ./. -}: - -pkgs.llvmPackages_14.stdenv.mkDerivation { - pname = "ton"; - version = "dev-lib"; - - inherit src; - - nativeBuildInputs = with pkgs; - [ cmake ninja git pkg-config ]; - - buildInputs = with pkgs; - lib.forEach [ - secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev libtasn1.dev libidn2.dev libunistring.dev gettext (gnutls.override { withP11-kit = false; }).dev - ] (x: x.overrideAttrs(oldAttrs: rec { configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-shared" "--disable-tests" ]; dontDisableStatic = true; })) - ++ [ - darwin.apple_sdk.frameworks.CoreFoundation - (openssl.override { static = true; }).dev - (zlib.override { shared = false; }).dev - (libiconv.override { enableStatic = true; enableShared = false; }) - (lz4.override { enableStatic = true; enableShared = false; }).dev - ]; - - dontAddStaticConfigureFlags = true; - - configureFlags = []; - - cmakeFlags = [ - "-DTON_USE_ABSEIL=OFF" - "-DNIX=ON" - "-DCMAKE_CXX_FLAGS=-stdlib=libc++" - "-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.3" - ]; - - LDFLAGS = [ - "-static-libstdc++" - "-framework CoreFoundation" - ]; - - ninjaFlags = [ - "tonlibjson" "emulator" - ]; - - preFixup = '' - if [[ -n "$bin" ]]; then - for fn in "$bin"/bin/*; do - echo "Fixing libc++ in $fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++.1 | cut -d' ' -f1 | xargs)" libc++.1.dylib "$fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++abi.1 | cut -d' ' -f1 | xargs)" libc++abi.dylib "$fn" - done - fi - - if [[ -n "$out" ]]; then - for fn in "$out"/lib/*.{dylib,so}; do - echo "Fixing libc++ in $fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++.1 | cut -d' ' -f1 | xargs)" libc++.1.dylib "$fn" - install_name_tool -change "$(otool -L "$fn" | grep libc++abi.1 | cut -d' ' -f1 | xargs)" libc++abi.dylib "$fn" - done - fi - ''; -} diff --git a/assembly/wasm/fift-func-wasm-build-ubuntu.sh b/assembly/wasm/fift-func-wasm-build-ubuntu.sh deleted file mode 100644 index 6daf2d4cd..000000000 --- a/assembly/wasm/fift-func-wasm-build-ubuntu.sh +++ /dev/null @@ -1,170 +0,0 @@ -# The script builds funcfift compiler to WASM - -# Execute these prerequisites first -# sudo apt update -# sudo apt install -y build-essential git make cmake ninja-build clang libgflags-dev zlib1g-dev libssl-dev \ -# libreadline-dev libmicrohttpd-dev pkg-config libgsl-dev python3 python3-dev python3-pip \ -# nodejs libsecp256k1-dev libsodium-dev automake libtool - -# wget https://apt.llvm.org/llvm.sh -# chmod +x llvm.sh -# sudo ./llvm.sh 16 all - -with_artifacts=false - -while getopts 'a' flag; do - case "${flag}" in - a) with_artifacts=true ;; - *) break - ;; - esac -done - -export CC=$(which clang-16) -export CXX=$(which clang++-16) -export CCACHE_DISABLE=1 - -cd ../.. -rm -rf openssl zlib emsdk secp256k1 libsodium build -echo `pwd` - -git clone https://github.com/openssl/openssl.git -cd openssl -git checkout checkout openssl-3.1.4 -./config -make -j16 -OPENSSL_DIR=`pwd` -cd .. - -git clone https://github.com/madler/zlib.git -cd zlib -ZLIB_DIR=`pwd` -cd .. - -git clone https://github.com/lz4/lz4.git -cd lz4 -LZ4_DIR=`pwd` -cd .. - -git clone https://github.com/bitcoin-core/secp256k1.git -cd secp256k1 -./autogen.sh -SECP256K1_DIR=`pwd` -cd .. - -git clone https://github.com/jedisct1/libsodium --branch stable -cd libsodium -SODIUM_DIR=`pwd` -cd .. - -mkdir build -cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ --DCMAKE_CXX_STANDARD=17 \ --DOPENSSL_FOUND=1 \ --DOPENSSL_ROOT_DIR=$OPENSSL_DIR \ --DOPENSSL_INCLUDE_DIR=$OPENSSL_DIR/include \ --DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_DIR/libcrypto.so \ --DOPENSSL_SSL_LIBRARY=$OPENSSL_DIR/libssl.so \ --DTON_USE_ABSEIL=OFF .. - -test $? -eq 0 || { echo "Can't configure TON build"; exit 1; } - -ninja fift smc-envelope - -test $? -eq 0 || { echo "Can't compile fift "; exit 1; } - -rm -rf * - -cd .. - -git clone https://github.com/emscripten-core/emsdk.git -cd emsdk -./emsdk install 3.1.19 -./emsdk activate 3.1.19 -EMSDK_DIR=`pwd` -ls $EMSDK_DIR - -. $EMSDK_DIR/emsdk_env.sh -export CC=$(which emcc) -export CXX=$(which em++) -export CCACHE_DISABLE=1 - -cd ../openssl - -make clean -emconfigure ./Configure linux-generic32 no-shared no-dso no-engine no-unit-test -sed -i 's/CROSS_COMPILE=.*/CROSS_COMPILE=/g' Makefile -sed -i 's/-ldl//g' Makefile -sed -i 's/-O3/-Os/g' Makefile -emmake make depend -emmake make -j16 -test $? -eq 0 || { echo "Can't compile OpenSSL with emmake "; exit 1; } - -cd ../zlib - -emconfigure ./configure --static -emmake make -j16 -test $? -eq 0 || { echo "Can't compile zlib with emmake "; exit 1; } - -cd ../lz4 -emmake make -j16 -test $? -eq 0 || { echo "Can't compile lz4 with emmake "; exit 1; } - -cd ../secp256k1 - -emconfigure ./configure --enable-module-recovery -emmake make -j16 -test $? -eq 0 || { echo "Can't compile secp256k1 with emmake "; exit 1; } - -cd ../libsodium - -emconfigure ./configure --disable-ssp -emmake make -j16 -test $? -eq 0 || { echo "Can't compile libsodium with emmake "; exit 1; } - -cd ../build - -emcmake cmake -DUSE_EMSCRIPTEN=ON -DCMAKE_BUILD_TYPE=Release \ --DZLIB_FOUND=1 \ --DZLIB_LIBRARIES=$ZLIB_DIR/libz.a \ --DZLIB_INCLUDE_DIR=$ZLIB_DIR \ --DLZ4_FOUND=1 \ --DLZ4_LIBRARIES=$LZ4_DIR/lib/liblz4.a \ --DLZ4_INCLUDE_DIRS=$LZ4_DIR/lib \ --DOPENSSL_FOUND=1 \ --DOPENSSL_ROOT_DIR=$OPENSSL_DIR \ --DOPENSSL_INCLUDE_DIR=$OPENSSL_DIR/include \ --DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_DIR/libcrypto.a \ --DOPENSSL_SSL_LIBRARY=$OPENSSL_DIR/libssl.a \ --DCMAKE_TOOLCHAIN_FILE=$EMSDK_DIR/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \ --DCMAKE_CXX_FLAGS="-sUSE_ZLIB=1" \ --DSECP256K1_FOUND=1 \ --DSECP256K1_INCLUDE_DIR=$SECP256K1_DIR/include \ --DSECP256K1_LIBRARY=$SECP256K1_DIR/.libs/libsecp256k1.a \ --DSODIUM_INCLUDE_DIR=$SODIUM_DIR/src/libsodium/include \ --DSODIUM_LIBRARY_RELEASE=$SODIUM_DIR/src/libsodium/.libs/libsodium.a \ --DSODIUM_USE_STATIC_LIBS=ON .. - -test $? -eq 0 || { echo "Can't configure TON with emmake "; exit 1; } -cp -R ../crypto/smartcont ../crypto/fift/lib crypto - -emmake make -j16 funcfiftlib func fift tlbc emulator-emscripten - -test $? -eq 0 || { echo "Can't compile TON with emmake "; exit 1; } - -if [ "$with_artifacts" = true ]; then - echo "Creating artifacts..." - cd .. - rm -rf artifacts - mkdir artifacts - ls build/crypto - cp build/crypto/fift* artifacts - cp build/crypto/func* artifacts - cp build/crypto/tlbc* artifacts - cp build/emulator/emulator-emscripten* artifacts - cp -R crypto/smartcont artifacts - cp -R crypto/fift/lib artifacts -fi - - diff --git a/flake.nix b/flake.nix index b4faf7b26..b6f80b667 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,25 @@ outputs = { self, nixpkgs-stable, nixpkgs-trunk, flake-compat, flake-utils }: let + # Define static Boost + staticBoost = pkgs: pkgs.boost.overrideAttrs (oldAttrs: { + buildInputs = (oldAttrs.buildInputs or []) ++ [ pkgsStatic.stdenv ]; + doCheck = false; + configureFlags = [ + "--with-libraries=all" + "--with-serialization" + "--with-date_time" + "--with-thread" + "--with-regex" + "--with-filesystem" + "--with-program_options" + "--with-system" + "--with-chrono" + "--with-random" + "--with-test" + ]; + }); + ton = { host, system, kind }: let p = host.hostPlatform; @@ -27,7 +46,9 @@ pkgs = host; inherit system; src = host.nix-gitignore.gitignoreRecursiveSource [ ] ./.; + boost = staticBoost host; # Include static Boost }; + tonPython = ton: python: ton.overrideAttrs (previousAttrs: { buildInputs = previousAttrs.buildInputs ++ [ python ]; @@ -52,6 +73,7 @@ outputs = [ "out" ]; }); + hostPkgs = system: import nixpkgs-stable { inherit system;