You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

utils.sh 1.5 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash -e
  2. source ${SRC_DIR}/scripts/whl/utils/utils.sh
  3. ALL_PYTHON=${ALL_PYTHON}
  4. # FIXME: now imperative py code do not support 3.10
  5. # but megenginelite and megbrain support it, so we
  6. # config with 3.10.1 now
  7. FULL_PYTHON_VER="3.8.3 3.9.9 3.10.1"
  8. if [[ -z ${ALL_PYTHON} ]]
  9. then
  10. ALL_PYTHON=${FULL_PYTHON_VER}
  11. else
  12. check_python_version_is_valid "${ALL_PYTHON}" "${FULL_PYTHON_VER}"
  13. fi
  14. # FIXME python3.10+ self build have some issue, need config env
  15. # _PYTHON_SYSCONFIGDATA_NAME remove this env after find the build issue
  16. # do not care about this, apt install python3.10 do not have this issue
  17. export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata__linux_aarch64-linux-android"
  18. function check_termux_env() {
  19. echo "check is in termux env or not"
  20. info=`command -v termux-info || true`
  21. if [[ "${info}" =~ "com.termux" ]]; then
  22. echo "find termux-info at: ${info}"
  23. echo "check env now"
  24. ENVS="PREFIX HOME"
  25. for check_env in ${ENVS}
  26. do
  27. echo "try check env: ${check_env}"
  28. if [[ "${!check_env}" =~ "termux" ]]; then
  29. echo "env ${check_env} is: ${!check_env}"
  30. else
  31. echo "invalid ${check_env} env, may broken termux env"
  32. exit -1
  33. fi
  34. done
  35. else
  36. echo "invalid env, only support build android whl at termux env, please refs to: scripts/whl/BUILD_PYTHON_WHL_README.md to init env"
  37. exit -1
  38. fi
  39. }