Skip to content

Commit

Permalink
lua: synchronize inline patch with current version
Browse files Browse the repository at this point in the history
Installing Lua 5.2.4 produces (quite confusingly) `liblua.5.2.3.dylib`.
This updates the inline patch to be in sync with the formula version.

Closes Homebrew/legacy-homebrew#42092.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
  • Loading branch information
UniqMartin authored and DomT4 committed Jul 25, 2015
1 parent 676413d commit d86522a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Formula/lua.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class Lua < Formula
homepage "http://www.lua.org/"
url "http://www.lua.org/ftp/lua-5.2.4.tar.gz"
sha256 "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b"
revision 1

bottle do
sha256 "50c2d69eeeea78d4a61b9126c5d26109dc0f07e2f5612d6f4cb284f327218ef2" => :yosemite
Expand Down Expand Up @@ -156,15 +157,15 @@ def caveats; <<-EOS.undent
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.5.2.3.dylib
+TO_LIB= liblua.5.2.4.dylib
TO_MAN= lua.1 luac.1

# Lua version and release.
@@ -63,6 +63,8 @@ install: dummy
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ ln -s -f liblua.5.2.3.dylib $(INSTALL_LIB)/liblua.5.2.dylib
+ ln -s -f liblua.5.2.4.dylib $(INSTALL_LIB)/liblua.5.2.dylib
+ ln -s -f liblua.5.2.dylib $(INSTALL_LIB)/liblua.dylib

uninstall:
Expand All @@ -178,7 +179,7 @@ def caveats; <<-EOS.undent
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris

-LUA_A= liblua.a
+LUA_A= liblua.5.2.3.dylib
+LUA_A= liblua.5.2.4.dylib
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
ltm.o lundump.o lvm.o lzio.o
Expand All @@ -189,12 +190,12 @@ def caveats; <<-EOS.undent
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
+ $(CC) -dynamiclib -install_name HOMEBREW_PREFIX/lib/liblua.5.2.dylib \
+ -compatibility_version 5.2 -current_version 5.2.3 \
+ -o liblua.5.2.3.dylib $^
+ -compatibility_version 5.2 -current_version 5.2.4 \
+ -o liblua.5.2.4.dylib $^

$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(CC) -fno-common $(MYLDFLAGS) -o $@ $(LUA_O) $(LUA_A) -L. -llua.5.2.3 $(LIBS)
+ $(CC) -fno-common $(MYLDFLAGS) -o $@ $(LUA_O) $(LUA_A) -L. -llua.5.2.4 $(LIBS)

$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
Expand Down

0 comments on commit d86522a

Please sign in to comment.