summaryrefslogtreecommitdiff
path: root/homebrew/lua
diff options
context:
space:
mode:
authorMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-20 20:49:46 -0500
committerMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-23 20:18:47 -0500
commit12335518ab39608d58370c85ff9f5384ad2aa5f7 (patch)
tree352d81f2a2de3f1252af732080ec0fde38c13b4d /homebrew/lua
parenta2b26ad12d4fa12f0273645caf4be6d0b8b71e7c (diff)
Ported in the homebrew-marauder for a hacky update/import system.
TODO: Maybe add a license & fix up messy code.
Diffstat (limited to 'homebrew/lua')
-rw-r--r--homebrew/lua/.beer86
-rw-r--r--homebrew/lua/.make.sh-auto6
-rw-r--r--homebrew/lua/_metadata/description1
-rw-r--r--homebrew/lua/_metadata/homepage1
-rw-r--r--homebrew/lua/_metadata/name1
-rw-r--r--homebrew/lua/_metadata/version1
-rwxr-xr-xhomebrew/lua/download.sh1
-rwxr-xr-xhomebrew/lua/patches.sh63
8 files changed, 160 insertions, 0 deletions
diff --git a/homebrew/lua/.beer b/homebrew/lua/.beer
new file mode 100644
index 000000000..1a9e9a3c0
--- /dev/null
+++ b/homebrew/lua/.beer
@@ -0,0 +1,86 @@
+{
+ "name": "Lua",
+ "description": "Powerful, lightweight programming language",
+ "url": "https://www.lua.org/ftp/lua-5.3.5.tar.gz",
+ "mirror": null,
+ "homepage": "https://www.lua.org/",
+ "depends": [],
+ "resource": [],
+ "conflicts": [],
+ "patches": [
+ {
+ "url": null,
+ "data": [
+ "diff --git a/Makefile b/Makefile\n",
+ "index 7fa91c8..a825198 100644\n",
+ "--- a/Makefile\n",
+ "+++ b/Makefile\n",
+ "@@ -41,7 +41,7 @@ PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris\n",
+ " # What to install.\n",
+ " TO_BIN= lua luac\n",
+ " TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp\n",
+ "-TO_LIB= liblua.a\n",
+ "+TO_LIB= liblua.5.3.5.dylib\n",
+ " TO_MAN= lua.1 luac.1\n",
+ "\n",
+ " # Lua version and release.\n",
+ "@@ -63,6 +63,8 @@ install: dummy\n",
+ "\tcd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)\n",
+ "\tcd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)\n",
+ "\tcd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)\n",
+ "+\tln -s -f liblua.5.3.5.dylib $(INSTALL_LIB)/liblua.5.3.dylib\n",
+ "+\tln -s -f liblua.5.3.dylib $(INSTALL_LIB)/liblua.dylib\n",
+ "\n",
+ " uninstall:\n",
+ "\tcd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)\n",
+ "diff --git a/src/Makefile b/src/Makefile\n",
+ "index 2e7a412..d0c4898 100644\n",
+ "--- a/src/Makefile\n",
+ "+++ b/src/Makefile\n",
+ "@@ -28,7 +28,7 @@ MYOBJS=\n",
+ "\n",
+ " PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris\n",
+ "\n",
+ "-LUA_A=\tliblua.a\n",
+ "+LUA_A=\tliblua.5.3.5.dylib\n",
+ " CORE_O=\tlapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \\\n",
+ "\tlmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \\\n",
+ "\tltm.o lundump.o lvm.o lzio.o\n",
+ "@@ -56,11 +56,12 @@ o:\t$(ALL_O)\n",
+ " a:\t$(ALL_A)\n",
+ "\n",
+ " $(LUA_A): $(BASE_O)\n",
+ "-\t$(AR) $@ $(BASE_O)\n",
+ "-\t$(RANLIB) $@\n",
+ "+\t$(CC) -dynamiclib -install_name @LUA_PREFIX@/lib/liblua.5.3.dylib \\\n",
+ "+\t\t-compatibility_version 5.3 -current_version 5.3.5 \\\n",
+ "+\t\t-o liblua.5.3.5.dylib $^\n",
+ "\n",
+ " $(LUA_T): $(LUA_O) $(LUA_A)\n",
+ "-\t$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)\n",
+ "+\t$(CC) -fno-common $(MYLDFLAGS) -o $@ $(LUA_O) $(LUA_A) -L. -llua.5.3.5 $(LIBS)\n",
+ "\n",
+ " $(LUAC_T): $(LUAC_O) $(LUA_A)\n",
+ "\t$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)\n",
+ "@@ -110,7 +111,7 @@ linux:\n",
+ "\t$(MAKE) $(ALL) SYSCFLAGS=\"-DLUA_USE_LINUX\" SYSLIBS=\"-Wl,-E -ldl -lreadline\"\n",
+ "\n",
+ " macosx:\n",
+ "-\t$(MAKE) $(ALL) SYSCFLAGS=\"-DLUA_USE_MACOSX\" SYSLIBS=\"-lreadline\"\n",
+ "+\t$(MAKE) $(ALL) SYSCFLAGS=\"-DLUA_USE_MACOSX -fno-common\" SYSLIBS=\"-lreadline\"\n",
+ "\n",
+ " mingw:\n",
+ "\t$(MAKE) \"LUA_A=lua53.dll\" \"LUA_T=lua.exe\" \\\n"
+ ]
+ }
+ ],
+ "install": [
+ "inreplace \"src/Makefile\" do |s|",
+ "s.gsub! \"@LUA_PREFIX@\", prefix",
+ "s.remove_make_var! \"CC\"",
+ "s.change_make_var! \"CFLAGS\", \"#{ENV.cflags} -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)\"",
+ "s.change_make_var! \"MYLDFLAGS\", ENV.ldflags"
+ ],
+ "version": "5.3.5",
+ "file": "lua.rb"
+} \ No newline at end of file
diff --git a/homebrew/lua/.make.sh-auto b/homebrew/lua/.make.sh-auto
new file mode 100644
index 000000000..a56898447
--- /dev/null
+++ b/homebrew/lua/.make.sh-auto
@@ -0,0 +1,6 @@
+pkg:setup
+inreplace "src/Makefile" do |s|
+s.gsub! "@LUA_PREFIX@", prefix
+s.remove_make_var! "CC"
+s.change_make_var! "CFLAGS", "#{ENV.cflags} -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)"
+s.change_make_var! "MYLDFLAGS", ENV.ldflags
diff --git a/homebrew/lua/_metadata/description b/homebrew/lua/_metadata/description
new file mode 100644
index 000000000..15b2db921
--- /dev/null
+++ b/homebrew/lua/_metadata/description
@@ -0,0 +1 @@
+Powerful, lightweight programming language
diff --git a/homebrew/lua/_metadata/homepage b/homebrew/lua/_metadata/homepage
new file mode 100644
index 000000000..c1806c54e
--- /dev/null
+++ b/homebrew/lua/_metadata/homepage
@@ -0,0 +1 @@
+https://www.lua.org/
diff --git a/homebrew/lua/_metadata/name b/homebrew/lua/_metadata/name
new file mode 100644
index 000000000..0f9d55077
--- /dev/null
+++ b/homebrew/lua/_metadata/name
@@ -0,0 +1 @@
+Lua
diff --git a/homebrew/lua/_metadata/version b/homebrew/lua/_metadata/version
new file mode 100644
index 000000000..e61ecd12d
--- /dev/null
+++ b/homebrew/lua/_metadata/version
@@ -0,0 +1 @@
+5.3.5
diff --git a/homebrew/lua/download.sh b/homebrew/lua/download.sh
new file mode 100755
index 000000000..9699b3ad1
--- /dev/null
+++ b/homebrew/lua/download.sh
@@ -0,0 +1 @@
+wget https://www.lua.org/ftp/lua-5.3.5.tar.gz \ No newline at end of file
diff --git a/homebrew/lua/patches.sh b/homebrew/lua/patches.sh
new file mode 100755
index 000000000..6fa58c9f1
--- /dev/null
+++ b/homebrew/lua/patches.sh
@@ -0,0 +1,63 @@
+echo 'Creating brew-patch.diff'
+cat << EOF >> brew-patch.diff
+diff --git a/Makefile b/Makefile
+index 7fa91c8..a825198 100644
+--- a/Makefile
++++ b/Makefile
+@@ -41,7 +41,7 @@ PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+ # What to install.
+ TO_BIN= lua luac
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua.a
++TO_LIB= liblua.5.3.5.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.3.5.dylib $(INSTALL_LIB)/liblua.5.3.dylib
++ ln -s -f liblua.5.3.dylib $(INSTALL_LIB)/liblua.dylib
+
+ uninstall:
+ cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
+diff --git a/src/Makefile b/src/Makefile
+index 2e7a412..d0c4898 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -28,7 +28,7 @@ MYOBJS=
+
+ PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+
+-LUA_A= liblua.a
++LUA_A= liblua.5.3.5.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
+@@ -56,11 +56,12 @@ o: $(ALL_O)
+ a: $(ALL_A)
+
+ $(LUA_A): $(BASE_O)
+- $(AR) $@ $(BASE_O)
+- $(RANLIB) $@
++ $(CC) -dynamiclib -install_name @LUA_PREFIX@/lib/liblua.5.3.dylib \
++ -compatibility_version 5.3 -current_version 5.3.5 \
++ -o liblua.5.3.5.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.3.5 $(LIBS)
+
+ $(LUAC_T): $(LUAC_O) $(LUA_A)
+ $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+@@ -110,7 +111,7 @@ linux:
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
+
+ macosx:
+- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
++ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -fno-common" SYSLIBS="-lreadline"
+
+ mingw:
+ $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
+EOF