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

41 line
1.3 KiB

  1. rootdir="$(cd "${0%/*}" 2>/dev/null; echo "$PWD")"
  2. install_local_rebar() {
  3. if [ ! -x "${rootdir}/bin/rebar" ]; then
  4. if [ ! -d "${rootdir}/src/rebar" ]; then
  5. git clone --depth 1 https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar
  6. fi
  7. make -C ${rootdir}/src/rebar
  8. if [ ! -d "${rootdir}/bin/" ]; then
  9. mkdir ${rootdir}/bin/
  10. fi
  11. mv ${rootdir}/src/rebar/rebar ${rootdir}/bin/rebar
  12. make -C ${rootdir}/src/rebar clean
  13. rm -rf ${rootdir}/src/rebar
  14. fi
  15. }
  16. install_local_enc() {
  17. if [ ! -x "${rootdir}/bin/enc" ]; then
  18. if [ ! -d "${rootdir}/src/erlang-native-compiler" ]; then
  19. git clone --depth 1 https://github.com/davisp/erlang-native-compiler.git ${rootdir}/src/erlang-native-compiler
  20. fi
  21. make -C ${rootdir}/src/erlang-native-compiler
  22. if [ ! -d "${rootdir}/bin/" ]; then
  23. mkdir ${rootdir}/bin/
  24. fi
  25. mv ${rootdir}/src/erlang-native-compiler/enc ${rootdir}/bin/enc
  26. make -C ${rootdir}/src/erlang-native-compiler clean
  27. rm -rf ${rootdir}/src/erlang-native-compiler
  28. fi
  29. }
  30. if [ -z "${REBAR}" ]; then
  31. install_local_rebar
  32. REBAR=${rootdir}/bin/rebar
  33. fi
  34. if [ -z "${ENC}" ]; then
  35. install_local_enc
  36. ENC=${rootdir}/bin/enc
  37. fi