Last active
January 3, 2016 14:29
-
-
Save jprjr/8476378 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
build_package_shared() { | |
local package_name="$1" | |
# patch the makefile for a shared library | |
curl -L https://gist.github.com/jprjr/8476378/raw/lua51-shared-library.patch | patch -p 1 | |
if [ "${MAKEOPTS+defined}" ]; then | |
MAKE_OPTS="$MAKEOPTS" | |
elif [ -z "${MAKE_OPTS+defined}" ]; then | |
MAKE_OPTS="-j 2" | |
fi | |
local os_name=$(uname -s | tr '[A-Z]' '[a-z]') | |
local platform | |
[ "$os_name" == darwin ] && platform=macosx | |
[ "$os_name" == *cygwin* ] && platform=posix | |
[ "$os_name" == *mingw* ] && platform=mingw | |
[ "$os_name" == *bsd* ] && platform=bsd | |
[ "$os_name" == *freebsd* ] && platform=freebsd | |
[ "$os_name" == linux ] && platform=linux | |
[ "$os_name" == *sunos* ] && platform=solaris | |
[ "$os_name" == *aix* ] && platform=aix | |
{ mv src/luaconf.h src/luaconf.h.orig | |
sed -e "s:LUA_ROOT[ ]*\"/usr/local/\":LUA_ROOT \"${PREFIX_PATH}/\":g" src/luaconf.h.orig > src/luaconf.h | |
"$MAKE" $MAKE_OPTS "${platform:-posix}" INSTALL_TOP="$PREFIX_PATH" INSTALL_MAN="$PREFIX_PATH/share/man/man1" | |
"$MAKE" TO_LIB="liblua.a liblua.so liblua.so.5.1 liblua.so.5.1.5" $MAKE_OPTS install INSTALL_TOP="$PREFIX_PATH" INSTALL_MAN="$PREFIX_PATH/share/man/man1" | |
} >&4 2>&1 | |
} | |
install_package "lua-5.1.5" "http://www.lua.org/ftp/lua-5.1.5.tar.gz#2e115fe26e435e33b0d5c022e4490567" shared |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment