Skip to content

Instantly share code, notes, and snippets.

@Ch00k
Created September 8, 2013 12:18
Show Gist options
  • Select an option

  • Save Ch00k/6484323 to your computer and use it in GitHub Desktop.

Select an option

Save Ch00k/6484323 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
requirements_netbsd_lib_installed()
{
pkg_info -qE "$1" || return $?
}
requirements_netbsd_check_binary()
{
__rvm_which "$1" >/dev/null 2>&1 || return $?
}
requirements_netbsd_fetch_and_unpack_set()
{
_set_url="http://ftp.netbsd.org/pub/NetBSD/NetBSD-${_system_version}/${_system_arch/x86_64/amd64}/binary/sets/$1.tgz"
__rvm_curl ${_set_url} -o ${rvm_archives_path}/$1.tgz || return $?
__rvm_try_sudo tar xf ${rvm_archives_path}/$1.tgz -C / || return $?
}
requirements_netbsd_install_set()
{
__rvm_log_command install_$1_set "Installing $1 set" \
requirements_netbsd_fetch_and_unpack_set $1 || return $?
}
requirements_netbsd_libs_install()
{
# This is unreliable as won't work with versions > 9
__rvm_try_sudo \
PKG_PATH="http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/${_system_version:0:3}/All/" \
pkg_add "$@" || return $?
}
requirements_netbsd_update_system()
{
true
}
requirements_netbsd_define()
{
case "$1" in
(rvm)
requirements_check bash curl p5-Digest-SHA
;;
(jruby*head)
true
;;
(jruby*)
openjdk7
;;
(ir*)
true
;;
(opal)
true
;;
(*-head)
requirements_check automake autoconf libtool bison gdbm libffi libyaml scmgit
requirements_netbsd_check_binary gcc ||
requirements_netbsd_install_set comp
;;
(*)
requirements_check automake autoconf libtool bison gdbm libffi libyaml
requirements_netbsd_check_binary gcc ||
requirements_netbsd_install_set comp
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment