Created
March 21, 2012 10:32
-
-
Save anonymous/2146054 to your computer and use it in GitHub Desktop.
Installs henplus in mac os x lion w/ readline support
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 sh | |
# http://creechy.wordpress.com/2012/02/08/compiling-java-readline-with-gnu-readline-for-osx/ | |
# FUNCTIONS | |
function download_extract { | |
wget $1 | |
tar xzf $2.tar.gz | |
cd $3 | |
} | |
function download_extract_patch { | |
download_extract $1 $2 $3 | |
wget $4 | |
patch -p1 < $3-osx-lion.patch | |
} | |
function clean { | |
rm -f $1.tar.gz | |
rm -rf $2 | |
} | |
# VARS | |
PREFIX=/usr/local | |
HENPLUS=henplus-0.9.8 | |
HENPLUS_URL=http://switch.dl.sourceforge.net/project/henplus/henplus/0.9.8/$HENPLUS.tar.gz | |
LIBRL=readline-6.2 | |
LIBRL_URL=ftp://ftp.cwru.edu/pub/bash/$LIBRL.tar.gz | |
LIBRL_P_URL=http://dl.dropbox.com/u/2175296/$LIBRL-osx-lion.patch | |
LIBRL_J=libreadline-java-0.8.0 | |
LIBRL_J_URL=http://garr.dl.sourceforge.net/project/java-readline/java-readline/0.8.0/$LIBRL_J-src.tar.gz | |
LIBRL_J_P_URL=http://dl.dropbox.com/u/2175296/$LIBRL_J-osx-lion.patch | |
# HENPLUS | |
download_extract $HENPLUS_URL $HENPLUS $HENPLUS | |
ant jar | |
ant -Dprefix=$PREFIX install | |
cd .. | |
clean $HENPLUS $HENPLUS | |
# READLINE | |
download_extract_patch $LIBRL_URL $LIBRL $LIBRL $LIBRL_P_URL | |
./configure --prefix=$PREFIX | |
make | |
make install | |
cd .. | |
clean $LIBRL $LIBRL | |
# READLINE JAVA | |
download_extract_patch $LIBRL_J_URL $LIBRL_J-src $LIBRL_J $LIBRL_J_P_URL | |
make | |
cp -v libJavaReadline.so $PREFIX/lib/libJavaReadline.jnilib | |
cd .. | |
clean $LIBRL_J-src $LIBRL_J |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment