Created
January 20, 2012 22:23
-
-
Save ScottPhillips/1649965 to your computer and use it in GitHub Desktop.
Install Lua on your Mac OSX
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
#!/bin/bash | |
# Download and install xCode to install make. | |
# http://itunes.apple.com/us/app/xcode/id448457090?mt=12 | |
# Don't forget to run "/Applications/Install Xcode.app" | |
# Open up your terminal, and follow the steps below | |
# by cutting pasting or typing the below in. | |
# The dollar sign indicates a comment. | |
basedir=$(dirname $0) | |
# Make a temporary directory | |
echo -e "\n\n" | |
read -p "This will install Lua, are you ready?" -n 1 | |
echo -e "\n\n" | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
echo -e "\n*** Creating $basedir/temp ***\n" | |
mkdir $basedir/temp | |
fi | |
echo -e "\n*** Created $basedir/temp ***\n" | |
# Go to that directory | |
cd $basedir/temp | |
echo -e "\n*** Getting Ready to Download Lua Version 5.2.0 ***\n" | |
# Download the latest version of Lua | |
curl -O http://www.lua.org/ftp/lua-5.2.0.tar.gz | |
echo -e "\n*** Getting Ready To Extract It ***\n" | |
# Extract it | |
tar -xzvf lua-5.2.0.tar.gz | |
# Go to the new directory | |
cd lua-5.2.0 | |
echo -e "\n*** Getting Ready To Compile ***\n" | |
# Compile it | |
make macosx | |
echo -e "\n*** Getting Ready To Test ***\n" | |
# Test it. | |
make test | |
echo -e "\n*** Getting Ready To Install. You may have to enter your password. ***\n" | |
# If it succeeds, install it. | |
sudo make install | |
echo -e "\n*** All Done, I hoped it worked! ***\n" |
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
# Download and install xCode to install make. | |
# http://itunes.apple.com/us/app/xcode/id448457090?mt=12 | |
# Don't forget to run "/Applications/Install Xcode.app" | |
# Open up your terminal, and follow the steps below | |
# by cutting pasting or typing the below in. | |
# The number sign indicates a comment. | |
# Make a temporary directory | |
mkdir temp | |
# Go to that directory | |
cd /temp | |
# Download the latest version of Lua | |
curl -O http://www.lua.org/ftp/lua-5.2.0.tar.gz | |
# Extract it | |
tar -xzvf lua-5.2.0.tar.gz | |
# Go to the new directory | |
cd lua-5.2.0 | |
# Compile it | |
make macosx | |
# Test it. | |
make test | |
# If it succeeds, install it. | |
sudo make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment