123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #!/usr/bin/env bash
- # old handlers before pkgng
- requirements_freebsd_lib_installed()
- {
- pkg_info | __rvm_grep "^$1" >/dev/null 2>&1 || return $?
- }
- requirements_freebsd_libs_install()
- {
- __rvm_try_sudo pkg_add -r "$@" || return $?
- }
- # new handlers for pkgng
- requirements_freebsd_pkgng_lib_installed()
- {
- pkg info | __rvm_grep "^$1" >/dev/null 2>&1 || return $?
- }
- requirements_freebsd_pkgng_libs_install()
- {
- __rvm_try_sudo pkg install -y "$@" || return $?
- }
- requirements_freebsd_install_node()
- {
- # TODO: missing pkgng!
- if
- [[ -d /usr/ports ]]
- then
- __rvm_try_sudo portsnap fetch update || return $?
- else
- rvm_requiremnts_fail_or_run_action 2 \
- "Skipping portsnap fetch extract, make sure your system is up to date." \
- __rvm_try_sudo portsnap fetch extract || return $?
- packages_flags+=( "portsnap-extracted" )
- fi
- # plain make is required for sudo
- __rvm_try_sudo make -C /usr/ports/www/node install clean || return $?
- }
- requirements_freebsd_before_detect_package_manager()
- {
- if
- __rvm_version_compare ${_system_version} -ge 10.0
- then
- __lib_type="freebsd_pkgng"
- else
- __lib_type="freebsd"
- if
- __rvm_which pkg >/dev/null &&
- [[ -s /var/db/pkg/local.sqlite ]]
- then
- __lib_type+='_pkgng'
- fi
- fi
- }
- requirements_freebsd_before()
- {
- if
- __rvm_version_compare ${_system_version} -le 10.0
- then
- rvm_warn "rvm is best supported on FreeBSD 10+"
- fi
- requirements_freebsd_before_detect_package_manager
- # TODO: when the time is out deprecate the old pkg_tools https://wiki.freebsd.org/pkgng/CharterAndRoadMap
- }
- requirements_freebsd_libs_default()
- {
- requirements_check autoconf automake libtool bison readline libyaml sqlite3 gdbm
- }
- requirements_freebsd_update_system()
- {
- case "${__lib_type}" in
- (freebsd_pkgng)
- if
- [[ -s /usr/local/etc/pkg.conf ]]
- then
- __rvm_try_sudo pkg update || return $?
- fi
- ;;
- esac
- }
- requirements_freebsd_define()
- {
- case "$1" in
- (rvm)
- requirements_check bash curl
- ;;
- (jruby*)
- requirements_check make openjdk
- if
- is_head_or_disable_binary "$1"
- then
- requirements_check git
- case $( jruby_installation_method "$1" ) in
- ant) __rvm_which ant >/dev/null || requirements_check apache-ant ;;
- mvn) __rvm_which mvn >/dev/null || requirements_check maven3 ;;
- esac
- fi
- ;;
- (ir*)
- requirements_check mono
- ;;
- (opal)
- requirements_check_custom node
- ;;
- (rbx*)
- if
- __rvm_version_compare ${_system_version} -ge 10.0
- then
- rvm_configure_flags+=( --cc=clang --cxx=clang++ )
- requirements_check gmake llvm35
- rvm_warn "If rbx installation fails, make sure llvm-config is in your PATH"
- else
- rvm_warn "rbx installation by rvm is only supported on FreeBSD 10 or higher"
- fi
- ;;
- (*-head)
- requirements_check git
- requirements_freebsd_define "${1%-head}"
- requirements_freebsd_libs_default
- __rvm_update_configure_opt_dir "$1" "/usr/local"
- ;;
- (*)
- # OpenSSL is installed by default http://www.freebsd.org/crypto.html
- requirements_freebsd_libs_default
- __rvm_update_configure_opt_dir "$1" "/usr/local"
- ;;
- esac
- }
|