Skip to content

Commit

Permalink
Adjust where rvmrc gets loaded for package managers.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Feb 26, 2010
1 parent b1d2687 commit f3f5d81
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
3 changes: 1 addition & 2 deletions scripts/cli
Expand Up @@ -433,11 +433,10 @@ rvm() {
tests|specs) rvm_action="rake" ; __rvm_do ; result=$? ;;

iconv|openssl|ncurses|zlib|readline|curl|mono)
__rvm_${rvm_action}_install
$rvm_scripts_path/libraries $rvm_action
result=$?
;;


error)
$rvm_scripts_path/log "fail" "$rvm_error_message ( see: 'rvm usage' )"
__rvm_pushpop
Expand Down
7 changes: 3 additions & 4 deletions scripts/install
Expand Up @@ -35,11 +35,10 @@ while [[ $# -gt 0 ]] ; do
esac
done

__rvm_load_rvmrc

if [[ -z "$rvm_prefix" ]] ; then
if [[ -z "$rvm_prefix" ]] ; then
__rvm_load_rvmrc
if [[ "root" = "$(whoami)" ]] ; then
rvm_prefix="/usr/local/"
rvm_prefix="/usr/local/"
else
rvm_prefix="$HOME/."
fi
Expand Down
35 changes: 23 additions & 12 deletions scripts/libraries
Expand Up @@ -3,7 +3,14 @@
#
# ruby supporting libraries:
#
__rvm_install_package() {

action=$1 ; shift ; library=$1 ; shift ; args="$*"

if [[ -z "$action" ]] ; then
echo "Usage: libraries {install,uninstall} {openssl,zlib,readline,iconv,ncurses}"
fi

install_package() {

if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi

Expand Down Expand Up @@ -41,7 +48,7 @@ __rvm_install_package() {

}

__rvm_readline_install() {
readline() {
package="readline" ; archive_format="tar.gz"
package_url="ftp://ftp.gnu.org/gnu/readline"
for version in 5.2 6.0 ; do
Expand All @@ -50,19 +57,19 @@ __rvm_readline_install() {
done
}

__rvm_iconv_install() {
iconv() {
package="libiconv" ; version=1.13.1 ; archive_format="tar.gz"
package_url="http://ftp.gnu.org/pub/gnu/libiconv"
__rvm_install_package
}

__rvm_curl_install() {
curl() {
package="curl" ; version=7.19.7 ; archive_format="tar.gz"
package_url="http://curl.haxx.se/download"
__rvm_install_package
}

__rvm_openssl_install() {
openssl() {
if $rvm_scripts_path/match "$rvm_archflags" "x86_64" ; then
export openssl_os="os/compiler darwin64-x86_64-cc"
else
Expand All @@ -74,40 +81,40 @@ __rvm_openssl_install() {
__rvm_install_package
}

__rvm_zlib_install() {
zlib() {
package="zlib" ; version="1.2.3" ; archive_format="tar.gz"
package_url="http://www.zlib.net"
__rvm_install_package
}

__rvm_ncurses_install() {
ncurses() {
package_url="ftp://invisible-island.net/ncurses/ncurses"
package="ncurses" ; version="5.7" ; archive_format="tar.gz"
configure_flags="--with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs"
__rvm_install_package
}

__rvm_pkgconfig_install() {
pkgconfig() {
package_url="http://pkgconfig.freedesktop.org/releases"
package="pkg-config" ; version="0.23" archive_format="tar.gz"
__rvm_install_package
}

__rvm_gettext_install() {
gettext() {
package_url="ftp://ftp.gnu.org/pub/gnu/gettext"
package="gettext" ; version="0.17" ; archive_format="tar.gz"
__rvm_install_package
}

__rvm_glib_install() {
glib() {
package="glib" ; version="2.23.1" ; archive_format="tar.gz"
package_url="http://ftp.gnome.org/pub/gnome/sources/glib/2.23"
configure="CC=\"cc -L$rvm_usr_path/lib\" ./configure --prefix=$rvm_usr_path"

__rvm_install_package
}

__rvm_mono_install() {
mono() {
package="mono" ; version="2.6.1" ; archive_format="tar.bz2"
packge_url="http://ftp.novell.com/pub/mono/sources/mono/"
__rvm_mono_env
Expand All @@ -116,7 +123,7 @@ __rvm_mono_install() {
__rvm_glib_install
}

__rvm_llvm_install() {
llvm() {
if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
__rvm_pushpop $rvm_src_path
if [[ ! -d "$rvm_src_path/llvm/.svn" ]] ; then
Expand All @@ -129,3 +136,7 @@ __rvm_llvm_install() {
fi
__rvm_pushpop
}


${action}

0 comments on commit f3f5d81

Please sign in to comment.