openbsd 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/usr/bin/env bash
  2. requirements_openbsd_lib_installed()
  3. {
  4. pkg_info | __rvm_grep "^$1" >/dev/null 2>&1 || return $?
  5. }
  6. requirements_openbsd_lib_available()
  7. {
  8. pkg_info -Q "${1%%-[[:digit:]]}" | __rvm_grep "^$1" >/dev/null 2>&1 || return $?
  9. }
  10. requirements_openbsd_libs_install()
  11. {
  12. __rvm_try_sudo pkg_add -z "$@" || return $?
  13. }
  14. requirements_openbsd_install_node()
  15. {
  16. # plain make is required for sudo
  17. __rvm_try_sudo make -C /usr/ports/www/node install clean || return $?
  18. }
  19. requirements_openbsd_update_system()
  20. {
  21. [[ -d /usr/ports ]] ||
  22. {
  23. \typeset __url __target __result=0
  24. __url="http://ftp.openbsd.org/pub/OpenBSD/${_system_version}/ports.tar.gz"
  25. __target="$( TMPDIR="${rvm_tmp_path}" mktemp ${TMPDIR:-/tmp}/tmp.XXXXXXXXXXXXXXXXXX )"
  26. __rvm_curl "${__url}" -o "${__target}" &&
  27. __rvm_try_sudo tar -C /usr -zxf "${__target}" ||
  28. __result=$?
  29. rm -f "${__target}"
  30. return ${__result}
  31. }
  32. true
  33. }
  34. requirements_openbsd_define()
  35. {
  36. case "$1" in
  37. (rvm)
  38. requirements_check bash curl
  39. ;;
  40. (jruby*)
  41. requirements_check make jdk
  42. if
  43. is_head_or_disable_binary "$1"
  44. then
  45. requirements_check git
  46. case $( jruby_installation_method "$1" ) in
  47. ant) requirements_check apache-ant ;;
  48. mvn) requirements_check maven ;;
  49. esac
  50. fi
  51. ;;
  52. (ir*)
  53. requirements_check mono
  54. ;;
  55. (opal)
  56. requirements_check_custom node
  57. ;;
  58. (ruby-1.9.3*|ruby-2.0.0*)
  59. rvm_error "Beware there is a compilation bug in $1 on OpenBSD, it's fixed in ruby-2.1.0
  60. for more details see https://bugs.ruby-lang.org/issues/7959"
  61. return 103
  62. ;;
  63. (*-head)
  64. # OpenSSL is installed by default http://www.openbsd.org/crypto.html
  65. requirements_check gcc-4 automake-1 libtool bison readline-6 libyaml-0 git
  66. requirements_check_fallback autoconf-2.69p0 autoconf-2.68 autoconf-2.67
  67. __rvm_update_configure_opt_dir "$1" "/usr/local"
  68. ;;
  69. (*)
  70. # OpenSSL is installed by default http://www.openbsd.org/crypto.html
  71. requirements_check gcc-4 autoconf-2 automake-1 libtool bison readline-6 libyaml-0
  72. __rvm_update_configure_opt_dir "$1" "/usr/local"
  73. ;;
  74. esac
  75. }
  76. requirements_openbsd_before()
  77. {
  78. [[ -n "${PKG_PATH:-}" ]] ||
  79. {
  80. export PKG_PATH=http://ftp.openbsd.org/pub/OpenBSD/${_system_version}/packages/$(arch -s)/
  81. rvm_warn "WARNING: \$PKG_PATH was not set, using fallback '$PKG_PATH',
  82. see http://www.openbsd.org/ftp.html for list of available mirrors."
  83. }
  84. }