scripts/libraries in rvm-0.1.11 vs scripts/libraries in rvm-0.1.12

- old
+ new

@@ -1,149 +1,131 @@ #!/usr/bin/env bash # # ruby supporting libraries: # -__rvm_readline_install() { +__rvm_install_package() { + if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi + __rvm_pushpop $rvm_src_path - package="readline" ; version="5.2" ; archive_format="tar.gz" - # TODO: Figure out how to list, grab and apply the patches - #ftp://ftp.cwru.edu/pub/bash/readline-6.0.tar.gz - for version in 5.2 6.0 ; do - $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format" - $rvm_scripts_path/fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.$archive_format" || (result=$? && return $result) - __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format" - builtin cd "$rvm_src_path/$package-$version" - if [[ "Darwin" = "$(uname)" ]] ; then - #sdk=$(\ls -t /Developer/SDKs/ | head -n 1) - #CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64" - #LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$sdk -arch i386 -arch x86_64" - #export CFLAGS LDFLAGS - __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared" "Configuring $package" - else - __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared" "Configuring $package" - fi - if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then - __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr" - else - __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package" - __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr" - fi - done - __rvm_pushpop -} + $rvm_scripts_path/log "info" "Fetching $package-$version.$archive_format to $rvm_archives_path" -__rvm_iconv_install() { - if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi - __rvm_pushpop $rvm_src_path - __rvm_pushpop $rvm_src_path - package="libiconv" ; version=1.13.1 ; archive_format="tar.gz" - $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format" - $rvm_scripts_path/fetch "http://ftp.gnu.org/pub/gnu/libiconv/$package-$version.$archive_format" || (result=$? && return $result) - __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format" + if [[ "$archive_format" = "tar.gz" ]] || [[ "$archive_format" = "tgz" ]] ; then + $rvm_scripts_path/fetch "$package_url/$package-$version.$archive_format" || (result=$? && return $result) + __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format to $rvm_src_path" + elif [[ "$archive_format" = "tar.bz2" ]] ; then + $rvm_scripts_path/fetch "$package_url/$package-$version.$archive_format" || (result=$? && return $result) + __rvm_run "$package/extract" "tar jxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format to $rvm_src_path" + elif [[ "$archive_format" = "zip" ]] ; then + $rvm_scripts_path/fetch "$package_url/$package-$version.$archive_format" || (result=$? && return $result) + __rvm_run "$package/extract" "unzip -q -o $rvm_archives_path/$package-$version.$archive_format -d $rvm_src_path/$package-$version" "Extracting $package-$version.$archive_format to $rvm_src_path" + else + echo -e "Unrecognized archive format '$archive_format'" ; return 1 + fi + builtin cd "$rvm_src_path/$package-$version" - __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package." + + __rvm_run "$package/configure" "${configure:-"./configure --prefix=$rvm_usr_path"} $configure_flags" "Configuring $package in $rvm_src_path/$package-$version." + + unset configure_flags + if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then - __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr" + __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "Uninstalling $package from $rvm_usr_path" else - __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package" - __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr" + __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package in $rvm_src_path/$package-$version." + __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_usr_path" fi + __rvm_pushpop + } +__rvm_readline_install() { + package="readline" ; archive_format="tar.gz" + package_url="ftp://ftp.gnu.org/gnu/readline" + for version in 5.2 6.0 ; do + configure_flags="--disable-dependency-tracking --disable-static --enable-shared" + __rvm_install_package + done +} + +__rvm_iconv_install() { + 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() { - if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi - __rvm_pushpop $rvm_src_path package="curl" ; version=7.19.7 ; archive_format="tar.gz" - $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format" - $rvm_scripts_path/fetch "http://curl.haxx.se/download/$package-$version.$archive_format" || (result=$? && return $result) - __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format" - builtin cd "$rvm_src_path/$package-$version" - __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package." - if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then - __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr" - else - __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package" - __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr" - fi - __rvm_pushpop + package_url="http://curl.haxx.se/download" + __rvm_install_package } __rvm_openssl_install() { - if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi if $rvm_scripts_path/match "$rvm_archflags" "x86_64" ; then - openssl_os="os/compiler darwin64-x86_64-cc" + export openssl_os="os/compiler darwin64-x86_64-cc" else - openssl_os="os/compiler darwin-i386-cc" + export openssl_os="os/compiler darwin-i386-cc" fi - __rvm_pushpop $rvm_src_path package="openssl" ; version="0.9.8k" ; archive_format="tar.gz" - $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format" - $rvm_scripts_path/fetch "http://www.openssl.org/source/$package-$version.tar.gz" || (result=$? && return $result) - __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format" - builtin cd "$rvm_src_path/$package-$version" - __rvm_run "$package/config" "./config --prefix=$rvm_path/usr zlib no-asm no-krb5 shared" "Configuring $package." - if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then - __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr" - else - __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package" - __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr" - fi - __rvm_pushpop + package_url="http://www.openssl.org/source" + configure="./config --prefix=$rvm_usr_path zlib no-asm no-krb5 shared" + __rvm_install_package } __rvm_zlib_install() { - if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi - __rvm_pushpop $rvm_src_path package="zlib" ; version="1.2.3" ; archive_format="tar.gz" - $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format" - $rvm_scripts_path/fetch "http://www.zlib.net/$package-$version.tar.gz" || (result=$? && return $result) - __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format" - builtin cd "$rvm_src_path/$package-$version" - __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package." - if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then - __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr" - else - __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package" - __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr" - fi - __rvm_pushpop + package_url="http://www.zlib.net" + __rvm_install_package } __rvm_ncurses_install() { - if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi - __rvm_pushpop $rvm_src_path + package_url="ftp://invisible-island.net/ncurses/ncurses" package="ncurses" ; version="5.7" ; archive_format="tar.gz" - $rvm_scripts_path/log "info" "Retrieving $package" - $rvm_scripts_path/fetch "ftp://invisible-island.net/ncurses/ncurses.tar.gz" || (result=$? && return $result) - __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package.$archive_format -C $rvm_src_path" "Extracting $package.$archive_format" - builtin cd "$rvm_src_path/$package-$version" - __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs" "Configuring $package." - if [[ "$rvm_uninstall_flag" -eq 1 ]] || [[ "$rvm_remove_flag" -eq 1 ]] ; then - __rvm_run "$package/make.uninstall" "/usr/bin/make uninstall" "uninstalling $package from $rvm_path/usr" - else - __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package" - __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr" - fi - __rvm_pushpop + configure_flags="--with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs" + __rvm_install_package } -__rvm_install_llvm() { +__rvm_pkgconfig_install() { + package_url="http://pkgconfig.freedesktop.org/releases" + package="pkg-config" ; version="0.23" archive_format="tar.gz" + __rvm_install_package +} + +__rvm_gettext_install() { + package_url="ftp://ftp.gnu.org/pub/gnu/gettext" + package="gettext" ; version="0.17" ; archive_format="tar.gz" + __rvm_install_package +} + +__rvm_glib_install() { + 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() { + package="mono" ; version="2.6.1" ; archive_format="tar.bz2" + packge_url="http://ftp.novell.com/pub/mono/sources/mono/" + __rvm_mono_env + __rvm_gettext_install + __rvm_pkgconfig_install + __rvm_glib_install +} + +__rvm_llvm_install() { if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi - builtin cd "$rvm_src_path" + __rvm_pushpop $rvm_src_path if [[ ! -d "$rvm_src_path/llvm/.svn" ]] ; then rm -rf "$rvm_src_path/llvm" svn co -r 89156 https://llvm.org/svn/llvm-project/llvm/trunk llvm builtin cd "$rvm_src_path/llvm" ./configure --enable-bindings=none UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make -j2 sudo env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make install fi + __rvm_pushpop } - -__rvm_install_mono() { - echo "Not implemented yet." -} -