build.alpine.release.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. set -xe
  3. apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool python2 python3
  4. apk add mbedtls-dev mbedtls-static zlib-dev rapidjson-dev zlib-static pcre2-dev
  5. git clone https://github.com/curl/curl --depth=1 --branch curl-8_6_0
  6. cd curl
  7. cmake -DCURL_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_CURL_EXE=OFF . > /dev/null
  8. make install -j2 > /dev/null
  9. cd ..
  10. git clone https://github.com/jbeder/yaml-cpp --depth=1
  11. cd yaml-cpp
  12. cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF . > /dev/null
  13. make install -j3 > /dev/null
  14. cd ..
  15. git clone https://github.com/ftk/quickjspp --depth=1
  16. cd quickjspp
  17. cmake -DCMAKE_BUILD_TYPE=Release .
  18. make quickjs -j3 > /dev/null
  19. install -d /usr/lib/quickjs/
  20. install -m644 quickjs/libquickjs.a /usr/lib/quickjs/
  21. install -d /usr/include/quickjs/
  22. install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h /usr/include/quickjs/
  23. install -m644 quickjspp.hpp /usr/include/
  24. cd ..
  25. git clone https://github.com/PerMalmberg/libcron --depth=1
  26. cd libcron
  27. git submodule update --init
  28. cmake -DCMAKE_BUILD_TYPE=Release .
  29. make libcron install -j3
  30. cd ..
  31. git clone https://github.com/ToruNiina/toml11 --branch="v4.3.0" --depth=1
  32. cd toml11
  33. cmake -DCMAKE_CXX_STANDARD=11 .
  34. make install -j4
  35. cd ..
  36. export PKG_CONFIG_PATH=/usr/lib64/pkgconfig
  37. cmake -DCMAKE_BUILD_TYPE=Release .
  38. make -j3
  39. rm subconverter
  40. # shellcheck disable=SC2046
  41. g++ -o base/subconverter $(find CMakeFiles/subconverter.dir/src/ -name "*.o") -static -lpcre2-8 -lyaml-cpp -L/usr/lib64 -lcurl -lmbedtls -lmbedcrypto -lmbedx509 -lz -l:quickjs/libquickjs.a -llibcron -O3 -s
  42. python3 -m ensurepip
  43. python3 -m pip install gitpython
  44. python3 scripts/update_rules.py -c scripts/rules_config.conf
  45. cd base
  46. chmod +rx subconverter
  47. chmod +r ./*
  48. cd ..
  49. mv base subconverter