build.windows.release.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. set -xe
  3. git clone https://github.com/curl/curl --depth=1 --branch curl-8_6_0
  4. cd curl
  5. cmake -DCMAKE_BUILD_TYPE=Release -DCURL_USE_LIBSSH2=OFF -DHTTP_ONLY=ON -DCURL_USE_SCHANNEL=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_CURL_EXE=OFF -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" -DHAVE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF .
  6. make install -j4
  7. cd ..
  8. git clone https://github.com/jbeder/yaml-cpp --depth=1
  9. cd yaml-cpp
  10. cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" .
  11. make install -j4
  12. cd ..
  13. git clone https://github.com/ftk/quickjspp --depth=1
  14. cd quickjspp
  15. patch quickjs/quickjs-libc.c -i ../scripts/patches/0001-quickjs-libc-add-realpath-for-Windows.patch
  16. cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
  17. make quickjs -j4
  18. install -d "$MINGW_PREFIX/lib/quickjs/"
  19. install -m644 quickjs/libquickjs.a "$MINGW_PREFIX/lib/quickjs/"
  20. install -d "$MINGW_PREFIX/include/quickjs"
  21. install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h "$MINGW_PREFIX/include/quickjs/"
  22. install -m644 quickjspp.hpp "$MINGW_PREFIX/include/"
  23. cd ..
  24. git clone https://github.com/PerMalmberg/libcron --depth=1
  25. cd libcron
  26. git submodule update --init
  27. cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" .
  28. make libcron install -j4
  29. cd ..
  30. git clone https://github.com/Tencent/rapidjson --depth=1
  31. cd rapidjson
  32. cmake -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" .
  33. make install -j4
  34. cd ..
  35. git clone https://github.com/ToruNiina/toml11 --branch "v4.3.0" --depth=1
  36. cd toml11
  37. cmake -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=11 .
  38. make install -j4
  39. cd ..
  40. python -m ensurepip
  41. python -m pip install gitpython
  42. python scripts/update_rules.py -c scripts/rules_config.conf
  43. rm -f C:/Strawberry/perl/bin/pkg-config C:/Strawberry/perl/bin/pkg-config.bat
  44. cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" .
  45. make -j4
  46. rm subconverter.exe
  47. # shellcheck disable=SC2046
  48. g++ $(find CMakeFiles/subconverter.dir/src -name "*.obj") curl/lib/libcurl.a -o base/subconverter.exe -static -lbcrypt -lpcre2-8 -l:quickjs/libquickjs.a -llibcron -lyaml-cpp -liphlpapi -lcrypt32 -lws2_32 -lwsock32 -lz -s
  49. mv base subconverter