mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 11:12:16 +00:00
Improve windows build scripts (#1416)
* improve windows builds * install nasm for openssl compilation on win * install nasm for openssl compilation on win for github * add create-state, proxy-liteserver, rldp-http-proxy, http-proxy, adnl-proxy, dht-server, libtonlibjson.so and libemulator.so to docker image * build new artifacts inside Docker * add files smartcont/auto/* to docker image * build arm64 in docker branch build * improve secp256k1 build
This commit is contained in:
parent
d3d050a319
commit
540d1fb4b7
5 changed files with 218 additions and 189 deletions
|
@ -41,7 +41,7 @@ jobs:
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
context: ./
|
context: ./
|
||||||
tags: |
|
tags: |
|
||||||
|
|
|
@ -5,6 +5,7 @@ if (NOT SECP256K1_LIBRARY)
|
||||||
set(SECP256K1_INCLUDE_DIR ${SECP256K1_BINARY_DIR}/include)
|
set(SECP256K1_INCLUDE_DIR ${SECP256K1_BINARY_DIR}/include)
|
||||||
|
|
||||||
file(MAKE_DIRECTORY ${SECP256K1_BINARY_DIR})
|
file(MAKE_DIRECTORY ${SECP256K1_BINARY_DIR})
|
||||||
|
file(MAKE_DIRECTORY "${SECP256K1_BINARY_DIR}/include")
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
|
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
|
||||||
|
|
20
Dockerfile
20
Dockerfile
|
@ -20,14 +20,17 @@ COPY ./ ./
|
||||||
RUN mkdir build && \
|
RUN mkdir build && \
|
||||||
cd build && \
|
cd build && \
|
||||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= -DTON_USE_JEMALLOC=ON .. && \
|
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= -DTON_USE_JEMALLOC=ON .. && \
|
||||||
ninja storage-daemon storage-daemon-cli tonlibjson fift func validator-engine validator-engine-console generate-random-id dht-server lite-client
|
ninja storage-daemon storage-daemon-cli tonlibjson fift func validator-engine validator-engine-console \
|
||||||
|
generate-random-id dht-server lite-client tolk rldp-http-proxy dht-server proxy-liteserver create-state \
|
||||||
|
blockchain-explorer emulator tonlibjson http-proxy adnl-proxy
|
||||||
|
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y wget curl libatomic1 openssl libsodium-dev libmicrohttpd-dev liblz4-dev libjemalloc-dev htop net-tools netcat iptraf-ng jq tcpdump pv plzip && \
|
apt-get install -y wget curl libatomic1 openssl libsodium-dev libmicrohttpd-dev liblz4-dev libjemalloc-dev htop \
|
||||||
|
net-tools netcat iptraf-ng jq tcpdump pv plzip && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN mkdir -p /var/ton-work/db /var/ton-work/scripts /usr/share/ton/smartcont/ /usr/lib/fift/
|
RUN mkdir -p /var/ton-work/db /var/ton-work/scripts /usr/share/ton/smartcont/auto /usr/lib/fift/
|
||||||
|
|
||||||
COPY --from=builder /ton/build/storage/storage-daemon/storage-daemon /usr/local/bin/
|
COPY --from=builder /ton/build/storage/storage-daemon/storage-daemon /usr/local/bin/
|
||||||
COPY --from=builder /ton/build/storage/storage-daemon/storage-daemon-cli /usr/local/bin/
|
COPY --from=builder /ton/build/storage/storage-daemon/storage-daemon-cli /usr/local/bin/
|
||||||
|
@ -35,9 +38,20 @@ COPY --from=builder /ton/build/lite-client/lite-client /usr/local/bin/
|
||||||
COPY --from=builder /ton/build/validator-engine/validator-engine /usr/local/bin/
|
COPY --from=builder /ton/build/validator-engine/validator-engine /usr/local/bin/
|
||||||
COPY --from=builder /ton/build/validator-engine-console/validator-engine-console /usr/local/bin/
|
COPY --from=builder /ton/build/validator-engine-console/validator-engine-console /usr/local/bin/
|
||||||
COPY --from=builder /ton/build/utils/generate-random-id /usr/local/bin/
|
COPY --from=builder /ton/build/utils/generate-random-id /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/blockchain-explorer/blockchain-explorer /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/crypto/create-state /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/utils/proxy-liteserver /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/dht-server/dht-server /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/rldp-http-proxy/rldp-http-proxy /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/http/http-proxy /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/adnl/adnl-proxy /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/tonlib/libtonlibjson.so /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/emulator/libemulator.so /usr/local/bin/
|
||||||
|
COPY --from=builder /ton/build/tolk/tolk /usr/local/bin/
|
||||||
COPY --from=builder /ton/build/crypto/fift /usr/local/bin/
|
COPY --from=builder /ton/build/crypto/fift /usr/local/bin/
|
||||||
COPY --from=builder /ton/build/crypto/func /usr/local/bin/
|
COPY --from=builder /ton/build/crypto/func /usr/local/bin/
|
||||||
COPY --from=builder /ton/crypto/smartcont/* /usr/share/ton/smartcont/
|
COPY --from=builder /ton/crypto/smartcont/* /usr/share/ton/smartcont/
|
||||||
|
COPY --from=builder /ton/crypto/smartcont/auto/* /usr/share/ton/smartcont/auto/
|
||||||
COPY --from=builder /ton/crypto/fift/lib/* /usr/lib/fift/
|
COPY --from=builder /ton/crypto/fift/lib/* /usr/lib/fift/
|
||||||
|
|
||||||
WORKDIR /var/ton-work/db
|
WORKDIR /var/ton-work/db
|
||||||
|
|
|
@ -26,106 +26,109 @@ IF %errorlevel% NEQ 0 (
|
||||||
exit /b %errorlevel%
|
exit /b %errorlevel%
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "zlib" (
|
echo Installing nasm...
|
||||||
git clone https://github.com/madler/zlib.git
|
choco install -y nasm
|
||||||
cd zlib
|
where nasm
|
||||||
git checkout v1.3.1
|
SET PATH=%PATH%;C:\Program Files\NASM
|
||||||
cd contrib\vstudio\vc14
|
|
||||||
msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v142
|
|
||||||
|
|
||||||
IF %errorlevel% NEQ 0 (
|
IF %errorlevel% NEQ 0 (
|
||||||
echo Can't install zlib
|
echo Can't install nasm
|
||||||
exit /b %errorlevel%
|
exit /b %errorlevel%
|
||||||
)
|
)
|
||||||
cd ..\..\..\..
|
|
||||||
|
mkdir third_libs
|
||||||
|
cd third_libs
|
||||||
|
|
||||||
|
set third_libs=%cd%
|
||||||
|
echo %third_libs%
|
||||||
|
|
||||||
|
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=v142
|
||||||
|
cd ..\..\..\..
|
||||||
) else (
|
) else (
|
||||||
echo Using zlib...
|
echo Using zlib...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "lz4" (
|
if not exist "lz4" (
|
||||||
git clone https://github.com/lz4/lz4.git
|
git clone https://github.com/lz4/lz4.git
|
||||||
cd lz4
|
cd lz4
|
||||||
git checkout v1.9.4
|
git checkout v1.9.4
|
||||||
cd build\VS2017\liblz4
|
cd build\VS2017\liblz4
|
||||||
msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
|
msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
|
||||||
|
cd ..\..\..\..
|
||||||
IF %errorlevel% NEQ 0 (
|
|
||||||
echo Can't install lz4
|
|
||||||
exit /b %errorlevel%
|
|
||||||
)
|
|
||||||
cd ..\..\..\..
|
|
||||||
) else (
|
) else (
|
||||||
echo Using lz4...
|
echo Using lz4...
|
||||||
)
|
)
|
||||||
|
|
||||||
curl --retry 5 --retry-delay 10 -Lo libsodium-1.0.18-stable-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip
|
if not exist "libsodium" (
|
||||||
IF %errorlevel% NEQ 0 (
|
git clone https://github.com/jedisct1/libsodium
|
||||||
echo Can't download libsodium
|
cd libsodium
|
||||||
exit /b %errorlevel%
|
git checkout 1.0.18-RELEASE
|
||||||
)
|
msbuild libsodium.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v142
|
||||||
unzip libsodium-1.0.18-stable-msvc.zip
|
cd ..
|
||||||
) else (
|
) else (
|
||||||
echo Using libsodium...
|
echo Using libsodium...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "openssl-3.1.4" (
|
if not exist "openssl" (
|
||||||
curl -Lo openssl-3.1.4.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/openssl-3.1.4.zip
|
git clone https://github.com/openssl/openssl.git
|
||||||
IF %errorlevel% NEQ 0 (
|
cd openssl
|
||||||
echo Can't download OpenSSL
|
git checkout openssl-3.1.4
|
||||||
exit /b %errorlevel%
|
where perl
|
||||||
)
|
perl Configure VC-WIN64A
|
||||||
unzip -q openssl-3.1.4.zip
|
IF %errorlevel% NEQ 0 (
|
||||||
|
echo Can't configure openssl
|
||||||
|
exit /b %errorlevel%
|
||||||
|
)
|
||||||
|
nmake
|
||||||
|
cd ..
|
||||||
) else (
|
) else (
|
||||||
echo Using openssl...
|
echo Using openssl...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "libmicrohttpd-0.9.77-w32-bin" (
|
if not exist "libmicrohttpd" (
|
||||||
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
|
git clone https://github.com/Karlson2k/libmicrohttpd.git
|
||||||
IF %errorlevel% NEQ 0 (
|
cd libmicrohttpd
|
||||||
echo Can't download libmicrohttpd
|
git checkout v1.0.1
|
||||||
exit /b %errorlevel%
|
cd w32\VS2019
|
||||||
)
|
msbuild libmicrohttpd.vcxproj /p:Configuration=Release-static /p:platform=x64 -p:PlatformToolset=v142
|
||||||
unzip -q libmicrohttpd-0.9.77-w32-bin.zip
|
IF %errorlevel% NEQ 0 (
|
||||||
|
echo Can't compile libmicrohttpd
|
||||||
|
exit /b %errorlevel%
|
||||||
|
)
|
||||||
|
cd ../../..
|
||||||
) else (
|
) else (
|
||||||
echo Using libmicrohttpd...
|
echo Using libmicrohttpd...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "readline-5.0-1-lib" (
|
cd ..
|
||||||
curl -Lo readline-5.0-1-lib.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/readline-5.0-1-lib.zip
|
echo Current dir %cd%
|
||||||
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
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
|
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
|
||||||
-DPORTABLE=1 ^
|
-DPORTABLE=1 ^
|
||||||
-DSODIUM_USE_STATIC_LIBS=1 ^
|
-DSODIUM_USE_STATIC_LIBS=1 ^
|
||||||
|
-DSODIUM_LIBRARY_RELEASE=%third_libs%\libsodium\Build\Release\x64\libsodium.lib ^
|
||||||
|
-DSODIUM_LIBRARY_DEBUG=%third_libs%\libsodium\Build\Release\x64\libsodium.lib ^
|
||||||
|
-DSODIUM_INCLUDE_DIR=%third_libs%\libsodium\src\libsodium\include ^
|
||||||
-DLZ4_FOUND=1 ^
|
-DLZ4_FOUND=1 ^
|
||||||
-DLZ4_INCLUDE_DIRS=%root%\lz4\lib ^
|
-DLZ4_INCLUDE_DIRS=%third_libs%\lz4\lib ^
|
||||||
-DLZ4_LIBRARIES=%root%\lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^
|
-DLZ4_LIBRARIES=%third_libs%\lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^
|
||||||
-DMHD_FOUND=1 ^
|
-DMHD_FOUND=1 ^
|
||||||
-DMHD_LIBRARY=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static\libmicrohttpd.lib ^
|
-DMHD_LIBRARY=%third_libs%\libmicrohttpd\w32\VS2019\Output\x64\libmicrohttpd.lib ^
|
||||||
-DMHD_INCLUDE_DIR=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static ^
|
-DMHD_INCLUDE_DIR=%third_libs%\libmicrohttpd\src\include ^
|
||||||
-DZLIB_FOUND=1 ^
|
-DZLIB_FOUND=1 ^
|
||||||
-DZLIB_INCLUDE_DIR=%root%\zlib ^
|
-DZLIB_INCLUDE_DIR=%third_libs%\zlib ^
|
||||||
-DZLIB_LIBRARIES=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^
|
-DZLIB_LIBRARIES=%third_libs%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^
|
||||||
-DOPENSSL_FOUND=1 ^
|
-DOPENSSL_FOUND=1 ^
|
||||||
-DOPENSSL_INCLUDE_DIR=%root%\openssl-3.1.4\x64\include ^
|
-DOPENSSL_INCLUDE_DIR=%third_libs%\openssl\include ^
|
||||||
-DOPENSSL_CRYPTO_LIBRARY=%root%\openssl-3.1.4\x64\lib\libcrypto_static.lib ^
|
-DOPENSSL_CRYPTO_LIBRARY=%third_libs%\openssl\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" ..
|
-DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj" ..
|
||||||
|
|
||||||
IF %errorlevel% NEQ 0 (
|
IF %errorlevel% NEQ 0 (
|
||||||
echo Can't configure TON
|
echo Can't configure TON
|
||||||
exit /b %errorlevel%
|
exit /b %errorlevel%
|
||||||
|
@ -168,33 +171,38 @@ REM ctest -C Release --output-on-failure -E "test-catchain|test-actors|test-val
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
echo Strip and copy artifacts
|
||||||
echo Creating artifacts...
|
|
||||||
cd ..
|
cd ..
|
||||||
|
echo where strip
|
||||||
|
where strip
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
mkdir artifacts\smartcont
|
mkdir artifacts\smartcont
|
||||||
mkdir artifacts\lib
|
mkdir artifacts\lib
|
||||||
|
|
||||||
for %%I in (build\storage\storage-daemon\storage-daemon.exe ^
|
for %%I in (build\storage\storage-daemon\storage-daemon.exe ^
|
||||||
build\storage\storage-daemon\storage-daemon-cli.exe ^
|
build\storage\storage-daemon\storage-daemon-cli.exe ^
|
||||||
build\blockchain-explorer\blockchain-explorer.exe ^
|
build\blockchain-explorer\blockchain-explorer.exe ^
|
||||||
build\crypto\fift.exe ^
|
build\crypto\fift.exe ^
|
||||||
build\crypto\tlbc.exe ^
|
build\crypto\tlbc.exe ^
|
||||||
build\crypto\func.exe ^
|
build\crypto\func.exe ^
|
||||||
build\tolk\tolk.exe ^
|
build\tolk\tolk.exe ^
|
||||||
build\crypto\create-state.exe ^
|
build\crypto\create-state.exe ^
|
||||||
build\validator-engine-console\validator-engine-console.exe ^
|
build\validator-engine-console\validator-engine-console.exe ^
|
||||||
build\tonlib\tonlib-cli.exe ^
|
build\tonlib\tonlib-cli.exe ^
|
||||||
build\tonlib\tonlibjson.dll ^
|
build\tonlib\tonlibjson.dll ^
|
||||||
build\http\http-proxy.exe ^
|
build\http\http-proxy.exe ^
|
||||||
build\rldp-http-proxy\rldp-http-proxy.exe ^
|
build\rldp-http-proxy\rldp-http-proxy.exe ^
|
||||||
build\dht-server\dht-server.exe ^
|
build\dht-server\dht-server.exe ^
|
||||||
build\lite-client\lite-client.exe ^
|
build\lite-client\lite-client.exe ^
|
||||||
build\validator-engine\validator-engine.exe ^
|
build\validator-engine\validator-engine.exe ^
|
||||||
build\utils\generate-random-id.exe ^
|
build\utils\generate-random-id.exe ^
|
||||||
build\utils\json2tlo.exe ^
|
build\utils\json2tlo.exe ^
|
||||||
build\utils\proxy-liteserver.exe ^
|
build\utils\proxy-liteserver.exe ^
|
||||||
build\adnl\adnl-proxy.exe ^
|
build\adnl\adnl-proxy.exe ^
|
||||||
build\emulator\emulator.dll) do (strip -s %%I & copy %%I artifacts\)
|
build\emulator\emulator.dll) do (
|
||||||
|
echo strip -s %%I & copy %%I artifacts\
|
||||||
|
strip -s %%I & copy %%I artifacts\
|
||||||
|
)
|
||||||
|
|
||||||
xcopy /e /k /h /i crypto\smartcont artifacts\smartcont
|
xcopy /e /k /h /i crypto\smartcont artifacts\smartcont
|
||||||
xcopy /e /k /h /i crypto\fift\lib artifacts\lib
|
xcopy /e /k /h /i crypto\fift\lib artifacts\lib
|
||||||
|
|
|
@ -26,109 +26,109 @@ IF %errorlevel% NEQ 0 (
|
||||||
exit /b %errorlevel%
|
exit /b %errorlevel%
|
||||||
)
|
)
|
||||||
|
|
||||||
rd /s /q ".\third-party\secp256k1\build"
|
echo Installing nasm...
|
||||||
|
choco install -y nasm
|
||||||
if not exist "zlib" (
|
where nasm
|
||||||
git clone https://github.com/madler/zlib.git
|
SET PATH=%PATH%;C:\Program Files\NASM
|
||||||
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 (
|
IF %errorlevel% NEQ 0 (
|
||||||
echo Can't install zlib
|
echo Can't install nasm
|
||||||
exit /b %errorlevel%
|
exit /b %errorlevel%
|
||||||
)
|
)
|
||||||
cd ..\..\..\..
|
|
||||||
|
mkdir third_libs
|
||||||
|
cd third_libs
|
||||||
|
|
||||||
|
set third_libs=%cd%
|
||||||
|
echo %third_libs%
|
||||||
|
|
||||||
|
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
|
||||||
|
cd ..\..\..\..
|
||||||
) else (
|
) else (
|
||||||
echo Using zlib...
|
echo Using zlib...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "lz4" (
|
if not exist "lz4" (
|
||||||
git clone https://github.com/lz4/lz4.git
|
git clone https://github.com/lz4/lz4.git
|
||||||
cd lz4
|
cd lz4
|
||||||
git checkout v1.9.4
|
git checkout v1.9.4
|
||||||
cd build\VS2017\liblz4
|
cd build\VS2022\liblz4
|
||||||
msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143
|
msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143
|
||||||
dir /s
|
cd ..\..\..\..
|
||||||
IF %errorlevel% NEQ 0 (
|
|
||||||
echo Can't install lz4
|
|
||||||
exit /b %errorlevel%
|
|
||||||
)
|
|
||||||
cd ..\..\..\..
|
|
||||||
) else (
|
) else (
|
||||||
echo Using lz4...
|
echo Using lz4...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "libsodium" (
|
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
|
git clone https://github.com/jedisct1/libsodium
|
||||||
IF %errorlevel% NEQ 0 (
|
cd libsodium
|
||||||
echo Can't download libsodium
|
git checkout 1.0.18-RELEASE
|
||||||
exit /b %errorlevel%
|
msbuild libsodium.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143
|
||||||
)
|
cd ..
|
||||||
unzip libsodium-1.0.18-stable-msvc.zip
|
|
||||||
) else (
|
) else (
|
||||||
echo Using libsodium...
|
echo Using libsodium...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "openssl-3.1.4" (
|
if not exist "openssl" (
|
||||||
curl -Lo openssl-3.1.4.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/openssl-3.1.4.zip
|
git clone https://github.com/openssl/openssl.git
|
||||||
IF %errorlevel% NEQ 0 (
|
cd openssl
|
||||||
echo Can't download OpenSSL
|
git checkout openssl-3.1.4
|
||||||
exit /b %errorlevel%
|
where perl
|
||||||
)
|
perl Configure VC-WIN64A
|
||||||
unzip -q openssl-3.1.4.zip
|
IF %errorlevel% NEQ 0 (
|
||||||
|
echo Can't configure openssl
|
||||||
|
exit /b %errorlevel%
|
||||||
|
)
|
||||||
|
nmake
|
||||||
|
cd ..
|
||||||
) else (
|
) else (
|
||||||
echo Using openssl...
|
echo Using openssl...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "libmicrohttpd-0.9.77-w32-bin" (
|
if not exist "libmicrohttpd" (
|
||||||
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
|
git clone https://github.com/Karlson2k/libmicrohttpd.git
|
||||||
IF %errorlevel% NEQ 0 (
|
cd libmicrohttpd
|
||||||
echo Can't download libmicrohttpd
|
git checkout v1.0.1
|
||||||
exit /b %errorlevel%
|
cd w32\VS2022
|
||||||
)
|
msbuild libmicrohttpd.vcxproj /p:Configuration=Release-static /p:platform=x64 -p:PlatformToolset=v143
|
||||||
unzip -q libmicrohttpd-0.9.77-w32-bin.zip
|
IF %errorlevel% NEQ 0 (
|
||||||
|
echo Can't compile libmicrohttpd
|
||||||
|
exit /b %errorlevel%
|
||||||
|
)
|
||||||
|
cd ../../..
|
||||||
) else (
|
) else (
|
||||||
echo Using libmicrohttpd...
|
echo Using libmicrohttpd...
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "readline-5.0-1-lib" (
|
cd ..
|
||||||
curl -Lo readline-5.0-1-lib.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/readline-5.0-1-lib.zip
|
echo Current dir %cd%
|
||||||
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
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
|
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
|
||||||
-DPORTABLE=1 ^
|
-DPORTABLE=1 ^
|
||||||
-DSODIUM_USE_STATIC_LIBS=1 ^
|
-DSODIUM_USE_STATIC_LIBS=1 ^
|
||||||
|
-DSODIUM_LIBRARY_RELEASE=%third_libs%\libsodium\Build\Release\x64\libsodium.lib ^
|
||||||
|
-DSODIUM_LIBRARY_DEBUG=%third_libs%\libsodium\Build\Release\x64\libsodium.lib ^
|
||||||
|
-DSODIUM_INCLUDE_DIR=%third_libs%\libsodium\src\libsodium\include ^
|
||||||
-DLZ4_FOUND=1 ^
|
-DLZ4_FOUND=1 ^
|
||||||
-DLZ4_INCLUDE_DIRS=%root%\lz4\lib ^
|
-DLZ4_INCLUDE_DIRS=%third_libs%\lz4\lib ^
|
||||||
-DLZ4_LIBRARIES=%root%\lz4\build\VS2017\liblz4\bin\x64_Release\liblz4_static.lib ^
|
-DLZ4_LIBRARIES=%third_libs%\lz4\build\VS2022\liblz4\bin\x64_Release\liblz4_static.lib ^
|
||||||
-DMHD_FOUND=1 ^
|
-DMHD_FOUND=1 ^
|
||||||
-DMHD_LIBRARY=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static\libmicrohttpd.lib ^
|
-DMHD_LIBRARY=%third_libs%\libmicrohttpd\w32\VS2022\Output\x64\libmicrohttpd.lib ^
|
||||||
-DMHD_INCLUDE_DIR=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static ^
|
-DMHD_INCLUDE_DIR=%third_libs%\libmicrohttpd\src\include ^
|
||||||
-DZLIB_FOUND=1 ^
|
-DZLIB_FOUND=1 ^
|
||||||
-DZLIB_INCLUDE_DIR=%root%\zlib ^
|
-DZLIB_INCLUDE_DIR=%third_libs%\zlib ^
|
||||||
-DZLIB_LIBRARIES=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^
|
-DZLIB_LIBRARIES=%third_libs%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^
|
||||||
-DOPENSSL_FOUND=1 ^
|
-DOPENSSL_FOUND=1 ^
|
||||||
-DOPENSSL_INCLUDE_DIR=%root%\openssl-3.1.4\x64\include ^
|
-DOPENSSL_INCLUDE_DIR=%third_libs%\openssl\include ^
|
||||||
-DOPENSSL_CRYPTO_LIBRARY=%root%\openssl-3.1.4\x64\lib\libcrypto_static.lib ^
|
-DOPENSSL_CRYPTO_LIBRARY=%third_libs%\openssl\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" ..
|
-DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj" ..
|
||||||
|
|
||||||
IF %errorlevel% NEQ 0 (
|
IF %errorlevel% NEQ 0 (
|
||||||
echo Can't configure TON
|
echo Can't configure TON
|
||||||
exit /b %errorlevel%
|
exit /b %errorlevel%
|
||||||
|
@ -171,32 +171,38 @@ REM ctest -C Release --output-on-failure -E "test-catchain|test-actors|test-val
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
echo Strip and copy artifacts
|
||||||
echo Creating artifacts...
|
|
||||||
cd ..
|
cd ..
|
||||||
|
echo where strip
|
||||||
|
where strip
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
mkdir artifacts\smartcont
|
mkdir artifacts\smartcont
|
||||||
mkdir artifacts\lib
|
mkdir artifacts\lib
|
||||||
|
|
||||||
for %%I in (build\storage\storage-daemon\storage-daemon.exe ^
|
for %%I in (build\storage\storage-daemon\storage-daemon.exe ^
|
||||||
build\storage\storage-daemon\storage-daemon-cli.exe ^
|
build\storage\storage-daemon\storage-daemon-cli.exe ^
|
||||||
build\blockchain-explorer\blockchain-explorer.exe ^
|
build\blockchain-explorer\blockchain-explorer.exe ^
|
||||||
build\crypto\fift.exe ^
|
build\crypto\fift.exe ^
|
||||||
build\crypto\tlbc.exe ^
|
build\crypto\tlbc.exe ^
|
||||||
build\crypto\func.exe ^
|
build\crypto\func.exe ^
|
||||||
build\tolk\tolk.exe ^
|
build\tolk\tolk.exe ^
|
||||||
build\crypto\create-state.exe ^
|
build\crypto\create-state.exe ^
|
||||||
build\validator-engine-console\validator-engine-console.exe ^
|
build\validator-engine-console\validator-engine-console.exe ^
|
||||||
build\tonlib\tonlib-cli.exe ^
|
build\tonlib\tonlib-cli.exe ^
|
||||||
build\tonlib\tonlibjson.dll ^
|
build\tonlib\tonlibjson.dll ^
|
||||||
build\http\http-proxy.exe ^
|
build\http\http-proxy.exe ^
|
||||||
build\rldp-http-proxy\rldp-http-proxy.exe ^
|
build\rldp-http-proxy\rldp-http-proxy.exe ^
|
||||||
build\dht-server\dht-server.exe ^
|
build\dht-server\dht-server.exe ^
|
||||||
build\lite-client\lite-client.exe ^
|
build\lite-client\lite-client.exe ^
|
||||||
build\validator-engine\validator-engine.exe ^
|
build\validator-engine\validator-engine.exe ^
|
||||||
build\utils\generate-random-id.exe ^
|
build\utils\generate-random-id.exe ^
|
||||||
build\utils\json2tlo.exe ^
|
build\utils\json2tlo.exe ^
|
||||||
build\adnl\adnl-proxy.exe ^
|
build\utils\proxy-liteserver.exe ^
|
||||||
build\emulator\emulator.dll) do (strip -s %%I & copy %%I artifacts\)
|
build\adnl\adnl-proxy.exe ^
|
||||||
|
build\emulator\emulator.dll) do (
|
||||||
|
echo strip -s %%I & copy %%I artifacts\
|
||||||
|
strip -s %%I & copy %%I artifacts\
|
||||||
|
)
|
||||||
|
|
||||||
xcopy /e /k /h /i crypto\smartcont artifacts\smartcont
|
xcopy /e /k /h /i crypto\smartcont artifacts\smartcont
|
||||||
xcopy /e /k /h /i crypto\fift\lib artifacts\lib
|
xcopy /e /k /h /i crypto\fift\lib artifacts\lib
|
||||||
|
|
Loading…
Reference in a new issue