build.macos.release.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. set -xe
  3. brew reinstall rapidjson zlib pcre2 pkgconfig
  4. #git clone https://github.com/curl/curl --depth=1 --branch curl-7_88_1
  5. #cd curl
  6. #./buildconf > /dev/null
  7. #./configure --with-ssl=/usr/local/opt/[email protected] --without-mbedtls --disable-ldap --disable-ldaps --disable-rtsp --without-libidn2 > /dev/null
  8. #cmake -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF . > /dev/null
  9. #make -j8 > /dev/null
  10. #cd ..
  11. git clone https://github.com/jbeder/yaml-cpp --depth=1
  12. cd yaml-cpp
  13. cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF . > /dev/null
  14. make -j6 > /dev/null
  15. sudo make install > /dev/null
  16. cd ..
  17. git clone https://github.com/ftk/quickjspp --depth=1
  18. cd quickjspp
  19. cmake -DCMAKE_BUILD_TYPE=Release .
  20. make quickjs -j6 > /dev/null
  21. sudo install -d /usr/local/lib/quickjs/
  22. sudo install -m644 quickjs/libquickjs.a /usr/local/lib/quickjs/
  23. sudo install -d /usr/local/include/quickjs/
  24. sudo install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h /usr/local/include/quickjs/
  25. sudo install -m644 quickjspp.hpp /usr/local/include/
  26. cd ..
  27. git clone https://github.com/PerMalmberg/libcron --depth=1
  28. cd libcron
  29. git submodule update --init
  30. cmake -DCMAKE_BUILD_TYPE=Release .
  31. make libcron -j6
  32. sudo install -m644 libcron/out/Release/liblibcron.a /usr/local/lib/
  33. sudo install -d /usr/local/include/libcron/
  34. sudo install -m644 libcron/include/libcron/* /usr/local/include/libcron/
  35. sudo install -d /usr/local/include/date/
  36. sudo install -m644 libcron/externals/date/include/date/* /usr/local/include/date/
  37. cd ..
  38. git clone https://github.com/ToruNiina/toml11 --branch="v4.3.0" --depth=1
  39. cd toml11
  40. cmake -DCMAKE_CXX_STANDARD=11 .
  41. sudo make install -j6 > /dev/null
  42. cd ..
  43. cmake -DCMAKE_BUILD_TYPE=Release .
  44. make -j6
  45. rm subconverter
  46. # shellcheck disable=SC2046
  47. c++ -Xlinker -unexported_symbol -Xlinker "*" -o base/subconverter -framework CoreFoundation -framework Security $(find CMakeFiles/subconverter.dir/src/ -name "*.o") "$(brew --prefix zlib)/lib/libz.a" "$(brew --prefix pcre2)/lib/libpcre2-8.a" $(find . -name "*.a") -lcurl -O3
  48. python -m ensurepip
  49. sudo python -m pip install gitpython
  50. python scripts/update_rules.py -c scripts/rules_config.conf
  51. cd base
  52. chmod +rx subconverter
  53. chmod +r ./*
  54. cd ..
  55. mv base subconverter
  56. set +xe