-
-
Save jssjr/6489718b9ff44e168df7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSTALL_PREFIX=/opt/rubies/${Version} | |
if [ -d ruby-build ] ; then | |
( cd ruby-build && git pull && PREFIX=${WORKSPACE} ./install.sh) | |
else | |
git clone git://github.com/sstephenson/ruby-build.git | |
cd ruby-build | |
PREFIX=${WORKSPACE} ./install.sh | |
fi | |
# cleanup previous builds | |
rm -rf /opt/rubies/${Version} | |
### # set up vendor location | |
### mkdir -p /opt/rubies/${Version}/vendor/include | |
### mkdir -p /opt/rubies/${Version}/vendor/lib | |
### | |
### # install readline | |
### curl -O http://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz | |
### tar -zxvf readline-6.2.tar.gz | |
### ( cd readline-6.2 | |
### export CFLAGS="-L/opt/rubies/${Version}/vendor/lib -I/opt/rubies/${Version}/vendor/include" | |
### export LDFLAGS="-Wl,-rpath /opt/rubies/${Version}/vendor/lib -L/opt/rubies/${Version}/vendor/lib -I/opt/rubies/${Version}/vendor/include" | |
### ./configure --prefix=/opt/rubies/${Version}/vendor/ | |
### make | |
### make install | |
### ) | |
# install iconv if ruby 1.8 | |
CONFIGURE_ICONV="" | |
if echo -n "${Version}" | grep -q "1.8" ; then | |
### curl -O http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz | |
### tar -zxvf libiconv-1.14.tar.gz | |
### ( cd libiconv-1.14 | |
### export CFLAGS="-L/opt/rubies/${Version}/vendor/lib -I/opt/rubies/${Version}/vendor/include" | |
### export LDFLAGS="-Wl,-rpath /opt/rubies/${Version}/vendor/lib -L/opt/rubies/${Version}/vendor/lib -I/opt/rubies/${Version}/vendor/include" | |
### ./configure --enable-extra-encodings --enable-static --without-libintl-prefix --prefix=/opt/rubies/${Version}/vendor/ | |
### make | |
### make install | |
### ) | |
CONFIGURE_ICONV="--with-iconv-dir=/usr/local" | |
fi | |
# build ruby | |
cd ${WORKSPACE} | |
CONFIGURE_OPTS="--enable-shared ${CONFIGURE_ICONV} --with-readline-dir=/usr/local" ./bin/ruby-build ${Version} ${INSTALL_PREFIX} | |
# install gems | |
for g in ${Gems} ; do | |
( cd $INSTALL_PREFIX && ./bin/gem install ${g} ) | |
done | |
# package ruby install | |
( | |
cd / | |
tar -czvf /dist/pub/rubies/builds/ruby-${Version}-${BUILD_ID}.tar.gz /opt/rubies/${Version} | |
cd /dist/pub/rubies/ | |
ln -sf builds/ruby-${Version}-${BUILD_ID}.tar.gz ruby-${Version}.tar.gz | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment