Created
December 4, 2013 15:48
-
-
Save kou1okada/7789850 to your computer and use it in GitHub Desktop.
Install ruby-2.0.0-p353 to rbenv on cygwin64.
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
#!/usr/bin/env bash | |
TARGET_URL=http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | |
PATCH_URL=https://gist.github.com/kou1okada/7209539/raw/68c845108504285a44a99d01aa0db60f88d81dda/ruby-2.0.0-p247.cygwin64.patch | |
HASH="$(cat <<EOD | |
78282433fb697dd3613613ff55d734c1 *ruby-2.0.0-p353.tar.gz | |
067532b28c5a42b93aa6dc5ba42c630c *ruby-2.0.0-p247.cygwin64.patch | |
EOD | |
)" | |
TARGET_ARCHIVE="${TARGET_URL##*/}" | |
TARGET_DIR="${TARGET_ARCHIVE%.tar.*}" | |
TARGET_VERSION="${TARGET_DIR#ruby-}" | |
PATCH="${PATCH_URL##*/}" | |
cd /tmp | |
wget -Nc "${TARGET_URL}" | |
wget -Nc "${PATCH_URL}" | |
echo "$HASH" | md5sum -c || exit | |
tar xvf "${TARGET_ARCHIVE}" | |
cd "${TARGET_DIR}" | |
if [ "${PATCH}" != "" ]; then patch -p1 < "../${PATCH}"; fi | |
./configure --prefix="$HOME/.rbenv/versions/${TARGET_VERSION}" | |
make install | |
rbenv rehash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment