Skip to content

Instantly share code, notes, and snippets.

@leoforney
Last active June 24, 2017 21:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoforney/3bfe2aca911c16416170 to your computer and use it in GitHub Desktop.
Save leoforney/3bfe2aca911c16416170 to your computer and use it in GitHub Desktop.
Installing icu4c (AKA libicu) on dreamhost
#!/bin/shell
echo "Hey, I heard you want to install libicu on Dreamhost... Let me help you out! :D"
if [ ! -d "$HOME/usr/local" ]; then
mkdir -p ~/usr/local
fi
if [ -d "$HOME/icu" ]; then
echo "Removing the folder ~/icu..."
rm -rf $HOME/icu
fi
if [ ! -d "$HOME/icu" ]; then
rm -rf icu4c-53_1-src.zip
if [ ! -f "$HOME/icu4c-53_1-src.zip" ]; then
clear
echo "Downloading ICU with wget..."
sleep 2
cd $HOME
wget http://download.icu-project.org/files/icu4c/53.1/icu4c-53_1-src.zip
fi
if [ -f "$HOME/icu4c-53_1-src.zip" ]; then
clear
echo "Extracting source (Silently)..."
sleep 2
unzip --qq icu4c-53_1-src.zip
fi
fi
if [ -d "$HOME/icu" ]; then
echo "${green}Removing zip file...${NC}"
rm -rf icu4c-53_1-src.zip
cd $HOME/icu/source
clear
echo "Configuring icu... (This could take a while)"
sleep 2
./configure --prefix=$HOME/usr/local
if [ -d "$HOME/usr/local" ]; then
clear
echo "Compiling icu... with flag -j 2 (Makes it faster)"
sleep 2
make -j 2
clear
echo "Installing icu... with flag -j 2 (Makes it faster)"
sleep 2
make install -j 2
rm -rf $HOME/icu
clear
(echo export PATH=$HOME/usr/local/bin:PATH; echo export LD_LIBRARY_PATH=$HOME/usr/local/lib:$LD_LIBRARY_PATH) >> ~/.bash_profile
clear
echo "Injecting into your shell session..."
sleep 2
source ~/.bash_profile
clear
echo "Congratulations! You have installed libicu for your server... Now run your gem instalations with --with-icu-lib=$HOME/usr/local/lib --with-icu-include=$HOME/usr/local/include ."
fi
fi
@minademian
Copy link

thank you very much for this gist. lifesaver. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment