fast-compiler.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. # This script needs alpine linux system.
  3. self_dir=$(cd "$(dirname "$0")";pwd)
  4. test "$VER_PHP" = "" && VER_PHP="8.1.7"
  5. test "$USE_BACKUP" = "" && USE_BACKUP="no"
  6. test "$ALL_EXTENSIONS" = "" && ALL_EXTENSIONS="all"
  7. LINK_APK_REPO='mirrors.ustc.edu.cn'
  8. LINK_APK_REPO_BAK='dl-cdn.alpinelinux.org'
  9. if [ "${USE_BACKUP}" = "yes" ]; then \
  10. echo "Using backup address..." && sleep 1s
  11. LINK_APK_REPO=${LINK_APK_REPO_BAK}
  12. else
  13. echo "Using original address..." && sleep 1s
  14. fi
  15. sed -i 's/dl-cdn.alpinelinux.org/'${LINK_APK_REPO}'/g' /etc/apk/repositories
  16. # build requirements
  17. apk add bash file wget cmake gcc g++ jq autoconf git libstdc++ linux-headers make m4 libgcc binutils ncurses dialog
  18. # php zlib dependencies
  19. apk add zlib-dev zlib-static
  20. # php mbstring dependencies
  21. apk add oniguruma-dev
  22. # php openssl dependencies
  23. apk add openssl-libs-static openssl-dev openssl
  24. # php gd dependencies
  25. apk add libpng-dev libpng-static
  26. # curl c-ares dependencies
  27. apk add c-ares-static c-ares-dev
  28. # php event dependencies
  29. apk add libevent libevent-dev libevent-static
  30. # php sqlite3 dependencies
  31. apk add sqlite sqlite-dev sqlite-libs sqlite-static
  32. # php libzip dependencies
  33. apk add bzip2-dev bzip2-static bzip2
  34. # php micro ffi dependencies
  35. apk add libffi libffi-dev
  36. # php gd event parent dependencies
  37. apk add zstd-static
  38. # php readline dependencies
  39. apk add readline-static ncurses-static readline-dev
  40. test "$USE_BACKUP" = "no" && PROMPT_1="mirror" || PROMPT_1="original"
  41. $self_dir/download.sh swoole ${USE_BACKUP} && \
  42. $self_dir/download.sh inotify ${USE_BACKUP} && \
  43. $self_dir/download.sh mongodb ${USE_BACKUP} && \
  44. $self_dir/download.sh event ${USE_BACKUP} && \
  45. $self_dir/download.sh redis ${USE_BACKUP} && \
  46. $self_dir/download.sh libxml2 ${USE_BACKUP} && \
  47. $self_dir/download.sh xz ${USE_BACKUP} && \
  48. $self_dir/download.sh protobuf ${USE_BACKUP} && \
  49. $self_dir/download.sh curl ${USE_BACKUP} && \
  50. $self_dir/download.sh libzip ${USE_BACKUP} && \
  51. $self_dir/download.sh libiconv ${USE_BACKUP} && \
  52. $self_dir/download-git.sh dixyes/phpmicro phpmicro ${USE_BACKUP} && \
  53. $self_dir/compile-deps.sh && \
  54. $self_dir/compile-php.sh $PROMPT_1 $VER_PHP $ALL_EXTENSIONS /dist/