aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile115
-rw-r--r--src/lfs.patch11
-rw-r--r--src/lua.sym26
-rw-r--r--src/luajit.patch63
-rw-r--r--src/lutf8libjit.patch14
-rw-r--r--src/textadept.c21
6 files changed, 27 insertions, 223 deletions
diff --git a/src/Makefile b/src/Makefile
index 4941a1b0..c370ffc7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -34,14 +34,13 @@ ifeq (win, $(findstring win, $(MAKECMDGOALS)))
CURSES_CFLAGS = -DLIBICONV_STATIC -Iwin32curses/include
CURSES_LIBS = win32curses/lib/pdcurses.a win32curses/lib/libiconv.a
endif
- libluajit = luajit/src/lua51.dll
else ifeq (osx, $(findstring osx, $(MAKECMDGOALS)))
# Cross-compile for Mac OSX.
CROSS = x86_64-apple-darwin9-
CFLAGS += -mdynamic-no-pic
CXXFLAGS += -mdynamic-no-pic
LUA_CFLAGS = -DLUA_USE_MACOSX
- LDFLAGS = -liconv -Wl,-read_only_relocs,suppress
+ LDFLAGS = -liconv
ifeq (, $(findstring curses, $(MAKECMDGOALS)))
plat_flag = -DGTK
GTK_CFLAGS = $(shell PKG_CONFIG_PATH=`pwd`/gtkosx/lib/pkgconfig \
@@ -58,7 +57,6 @@ else ifeq (osx, $(findstring osx, $(MAKECMDGOALS)))
plat_flag = -DCURSES
CURSES_LIBS = -lncurses
endif
- libluajit = luajit/src/libluajit.osx.a
else
# Build for Linux/BSD.
LUA_CFLAGS = -DLUA_USE_LINUX
@@ -88,7 +86,7 @@ else
GTK_LIBS = $(shell pkg-config --libs gtk+-3.0 gmodule-2.0)
endif
GLIB_CFLAGS = $(shell pkg-config --cflags glib-2.0)
- install_targets = ../textadept ../textadeptjit
+ install_targets = ../textadept
else
plat_flag = -DCURSES
CURSES_CFLAGS = $(shell pkg-config --silence-errors --cflags ncursesw || \
@@ -98,9 +96,8 @@ else
pkg-config --silence-errors --libs ncurses || \
pkg-config --silence-errors --libs curses || \
echo -lncursesw)
- install_targets = ../textadept-curses ../textadeptjit-curses
+ install_targets = ../textadept-curses
endif
- libluajit = luajit/src/libluajit.a
endif
# Scintilla.
@@ -117,7 +114,7 @@ sci_objs = AutoComplete.o CallTip.o CaseConvert.o CaseFolder.o Catalogue.o \
sci_lex_objs = Accessor.o CharacterCategory.o CharacterSet.o LexerBase.o \
LexerModule.o LexerNoExceptions.o LexerSimple.o PropSetSimple.o \
StyleContext.o WordList.o
-sci_lexer_objs = LexLPeg.o LexLPegjit.o LexLPeg-curses.o LexLPegjit-curses.o
+sci_lexer_objs = LexLPeg.o LexLPeg-curses.o
sci_gtk_objs = PlatGTK.o ScintillaGTK.o ScintillaGTKAccessible.o
sci_curses_objs = ScintillaCurses.o
@@ -125,8 +122,8 @@ sci_curses_objs = ScintillaCurses.o
ta_flags = -std=c99 -pedantic $(plat_flag) -Iscintilla/include -Igtdialog -Wall
-textadept_gtk_objs = textadept.o textadeptjit.o
-textadept_curses_objs = textadept-curses.o textadeptjit-curses.o
+textadept_gtk_objs = textadept.o
+textadept_curses_objs = textadept-curses.o
textadept_objs = $(textadept_gtk_objs) $(textadept_curses_objs)
lua_objs = lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o \
linit.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o \
@@ -134,9 +131,7 @@ lua_objs = lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o \
lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o
lua_lib_objs = lpcap.o lpcode.o lpprint.o lptree.o lpvm.o lfs.o
-luajit_lib_objs = lpcapjit.o lpcodejit.o lpprintjit.o lptreejit.o lpvmjit.o \
- lfsjit.o lutf8libjit.o
-lua_spawn_objs = lspawn.o lspawnjit.o lspawn-curses.o lspawnjit-curses.o
+lua_spawn_objs = lspawn.o lspawn-curses.o
gtdialog_objs = gtdialog.o gtdialog-curses.o
termkey_unix_objs = driver-ti.o driver-csi.o
termkey_win32_objs = driver-win32-pdcurses.o
@@ -154,12 +149,12 @@ endif
# Build.
-all: textadept textadeptjit
-curses: textadept-curses textadeptjit-curses
-win32: textadept.exe textadeptjit.exe
-win32-curses: textadept-curses.exe textadeptjit-curses.exe
-osx: textadept textadeptjit
-osx-curses: textadept-curses textadeptjit-curses
+all: textadept
+curses: textadept-curses
+win32: textadept.exe
+win32-curses: textadept-curses.exe
+osx: textadept
+osx-curses: textadept-curses
$(sci_objs): %.o: scintilla/src/%.cxx
$(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $< -o $@
@@ -179,17 +174,9 @@ $(lua_objs): %.o: lua/src/%.c
$(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -ULUA_LIB $< -o $@
$(lua_lib_objs): %.o: lua/src/lib/%.c
$(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) $< -o $@
-$(luajit_lib_objs): %jit.o: lua/src/lib/%.c
- $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) $< -o $@
$(lua_spawn_objs): lua/src/lib/lspawn.c
$(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -std=c99 -pedantic $(spawn_flags) \
$< -o $@
-luajit/src/libluajit.a: ; $(MAKE) -C luajit CC="$(CC)" CFLAGS="$(CFLAGS)"
-luajit/src/lua51.dll:
- $(MAKE) -C luajit HOST_CC="$(CC) -m32" CROSS=$(CROSS) TARGET_SYS=Windows \
- TARGET_SHLDFLAGS="-static-libgcc"
-luajit/src/libluajit.osx.a:
- $(MAKE) -C luajit CROSS=$(CROSS) TARGET_SYS=Darwin LUAJIT_A=$(notdir $@)
$(gtdialog_objs): gtdialog/gtdialog.c
$(CROSS)$(CC) -c $(CFLAGS) -std=c99 -pedantic $(plat_flag) -DNOHELP \
-DLIBRARY $(gtdialog_flags) $< -o $@
@@ -202,23 +189,16 @@ textadept_rc.o: textadept.rc ; $(CROSS)$(WINDRES) $< $@
# Target-specific variables.
-LexLPeg-curses.o LexLPegjit-curses.o: sci_flags += -DCURSES $(CURSES_CFLAGS)
+LexLPeg-curses.o: sci_flags += -DCURSES $(CURSES_CFLAGS)
lua_dep_objs = LexLPeg.o LexLPeg-curses.o textadept.o textadept-curses.o \
$(lua_objs) $(lua_lib_objs) lspawn.o lspawn-curses.o
-luajit_dep_objs = LexLPegjit.o LexLPegjit-curses.o textadeptjit.o \
- textadeptjit-curses.o $(luajit_lib_objs) lspawnjit.o \
- lspawnjit-curses.o
$(lua_dep_objs): LUA_CFLAGS += -Ilua/src
-$(luajit_dep_objs): LUA_CFLAGS += -Iluajit/src
$(textadept_gtk_objs): ta_flags += $(GTK_CFLAGS)
$(textadept_curses_objs): \
ta_flags += -Iscintilla/curses -Itermkey -Icdk $(CURSES_CFLAGS)
-lspawn.o lspawnjit.o: spawn_flags = -DGTK $(GLIB_CFLAGS)
+lspawn.o: spawn_flags = -DGTK $(GLIB_CFLAGS)
gtdialog.o: gtdialog_flags += $(GTK_CFLAGS)
gtdialog-curses.o: gtdialog_flags += -Icdk $(CURSES_CFLAGS)
-# Lua 5.3 compatibility with LuaJIT.
-lbitlib.o linit.o: LUA_CFLAGS += -DLUA_COMPAT_BITLIB -DLUA_COMPAT_APIINTCASTS
-lutf8libjit.o: LUA_CFLAGS += -Ilua/src
# Executables.
@@ -226,41 +206,21 @@ textadept: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \
scintilla-marshal.o textadept.o $(lua_objs) $(lua_lib_objs) \
lspawn.o gtdialog.o
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
-textadeptjit: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \
- scintilla-marshal.o textadeptjit.o $(luajit_lib_objs) \
- $(libluajit) lspawnjit.o gtdialog.o
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
textadept-curses: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \
$(sci_curses_objs) textadept-curses.o $(lua_objs) \
$(lua_lib_objs) lspawn-curses.o gtdialog-curses.o termkey.o \
$(termkey_unix_objs) $(cdk_objs)
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
-textadeptjit-curses: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \
- $(sci_curses_objs) textadeptjit-curses.o \
- $(luajit_lib_objs) $(libluajit) lspawnjit-curses.o \
- gtdialog-curses.o termkey.o $(termkey_unix_objs) \
- $(cdk_objs)
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
textadept.exe: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \
scintilla-marshal.o textadept.o textadept_rc.o $(lua_objs) \
$(lua_lib_objs) lspawn.o gtdialog.o
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
-textadeptjit.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \
- scintilla-marshal.o textadeptjit.o textadept_rc.o \
- $(luajit_lib_objs) $(libluajit) lspawnjit.o gtdialog.o
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
textadept-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \
$(sci_curses_objs) textadept-curses.o textadept_rc.o \
$(lua_objs) $(lua_lib_objs) lspawn-curses.o \
gtdialog-curses.o termkey.o $(termkey_win32_objs) \
$(cdk_objs)
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
-textadeptjit-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \
- $(sci_curses_objs) textadeptjit-curses.o \
- textadept_rc.o $(luajit_lib_objs) $(libluajit) \
- lspawnjit-curses.o gtdialog-curses.o termkey.o \
- $(termkey_win32_objs) $(cdk_objs)
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
# Install/uninstall.
@@ -289,9 +249,7 @@ uninstall:
# Clean.
-clean:
- $(MAKE) CC=$(CC) -C luajit clean
- rm -f *.o ../textadept*
+clean: ; rm -f *.o ../textadept*
# Documentation.
@@ -338,7 +296,7 @@ release: $(basedir).i386
tar czf /tmp/$<.tgz $< && rm -rf $< && gpg -ab /tmp/$<.tgz
$(basedir).x86_64: ; hg archive $@ -X ".hg*"
release64: $(basedir).x86_64
- make clean libluajit64
+ make clean
PKG_CONFIG_PATH=/opt/gtk64/lib/pkgconfig make -j4 CFLAGS="$(CFLAGS) -m64" \
CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++" || return 0
make -j4 CFLAGS="$(CFLAGS) -m64" \
@@ -355,12 +313,12 @@ win32-release: $(basedir).win32
rm -r $</lib/*.a $</lib/glib-2.0 $</lib/gtk-2.0/include $</lib/pkgconfig
make -j4 win32
make -j4 win32-curses
- cp -rL ../doc ../lexers ../textadept* luajit/src/lua51.dll $<
+ cp -rL ../doc ../lexers ../textadept* $<
cp *.asc $</src
zip -r /tmp/$<.zip $< && rm -rf $< && gpg -ab /tmp/$<.zip
$(basedir).osx: ; mkdir $@ && cp ../scripts/osx/ta $@
osx-release: $(basedir).osx
- make clean osx-deps libluajitosx
+ make clean osx-deps
make -j4 osx
make -j4 osx-curses
make osx-app && mv $(osxapp) $<
@@ -371,8 +329,7 @@ $(basedir).modules:
modules-release: $(basedir).modules
zip -r /tmp/$<.zip $< && rm -r $< && gpg -ab /tmp/$<.zip
-osx-app: ../textadept ../textadeptjit ../textadept-curses \
- ../textadeptjit-curses ../scripts/osx/textadept_osx
+osx-app: ../textadept ../textadept-curses ../scripts/osx/textadept_osx
mkdir -p $(osxapp_bin) $(osxapp_res)
cp Info.plist $(osxapp_bin)/../
cp $^ $(osxapp_bin)/
@@ -386,7 +343,7 @@ osx-app: ../textadept ../textadeptjit ../textadept-curses \
# External dependencies.
-base_deps = scintilla ../lexers lua lualibs luajit gtdialog cdk ../doc/bombay
+base_deps = scintilla ../lexers lua lualibs gtdialog cdk ../doc/bombay
deps: $(base_deps) termkey
win32-deps: $(base_deps) win32gtk win32curses
osx-deps: $(base_deps) gtkosx termkey
@@ -406,11 +363,6 @@ lua_tgz = lua-5.3.4.tar.gz
lpeg_tgz = lpeg-1.0.0.tar.gz
lfs_zip = v_1_6_3.zip
lspawn_zip = 9a8b4b5e4137.zip
-luajit_tgz = LuaJIT-2.0.3.tar.gz
-# Needed since LuaJIT will not cross-compile from x86 to x64 due to pointer size
-# mismatch.
-libluajit_tgz = libluajit_2.0.3.x86_64.tgz
-libluajit_osx_tgz = libluajit_2.0.3.osx.tgz
gtdialog_zip = 6435a42450c7.zip
cdk_tgz = cdk-5.0-20150928.tgz
termkey_tgz = libtermkey-0.20.tar.gz
@@ -444,24 +396,12 @@ lua: lua.patch | $(lua_tgz)
lualibs: lua/src/lib/lpeg lua/src/lib/lfs lua/src/lib/lspawn
lua/src/lib/lpeg: | $(lpeg_tgz)
mkdir -p $@ && tar xzf $| -C $@ && mv $@/*/*.c $@/*/*.h $(dir $@)
-lua/src/lib/lfs: lfs.patch | $(lfs_zip)
+lua/src/lib/lfs: | $(lfs_zip)
if [ -d $@ ]; then rm -r $@; fi
mkdir -p $@ && unzip -d $@ $| && mv $@/*/src/*.c $@/*/src/*.h $(dir $@)
patch -d $(dir $@) -N -p1 < $<
lua/src/lib/lspawn: | $(lspawn_zip)
mkdir -p $@ && unzip -d $@ $| && mv $@/*/*.c $(dir $@)
-lua/src/lib/lutf8lib.c: lutf8libjit.patch
- cp lua/src/$(notdir $@) $@
- patch -d $(dir $@) -N -p1 < $<
-$(luajit_tgz): ; wget http://luajit.org/download/$@
-luajit: luajit.patch | $(luajit_tgz)
- if [ -d $@ ]; then rm -r $@; fi
- mkdir $@ && tar xzf $| -C $@ && mv $@/*/* $@
- patch -d $@ -N -p1 < $<
-$(libluajit_tgz): ; wget http://foicica.com/textadept/download/$@
-libluajit64: | $(libluajit_tgz) ; tar xzf $|
-$(libluajit_osx_tgz): ; wget http://foicica.com/textadept/download/$@
-libluajitosx: | $(libluajit_osx_tgz) ; tar xzf $|
$(gtdialog_zip): ; wget $(gtdialog_url) -O $@
gtdialog: | $(gtdialog_zip) ; mkdir $@ && unzip -d $@ $| && mv $@/*/* $@
$(cdk_tgz): ; wget http://invisible-mirror.net/archives/cdk/$@
@@ -504,17 +444,16 @@ $(bombay_zip): ; wget http://foicica.com/hg/bombay/archive/tip.zip -O $@
mv $(notdir $@)/*/* $(dir $@)
$(cloc): ; wget http://prdownloads.sourceforge.net/cloc/$@ -O $@
sign-deps: | $(scintilla_tgz) $(lua_tgz) $(lpeg_tgz) $(lfs_zip) $(lspawn_zip) \
- $(luajit_tgz) $(libluajit_tgz) $(gtdialog_zip) $(cdk_tgz) \
- $(termkey_tgz) $(win32gtk_zip) $(win32iconv_bin_zip) \
- $(win32iconv_lib_zip) $(win32curses_zip) $(pdcurses_zip) \
- $(gtkosx_tgz)
+ $(gtdialog_zip) $(cdk_tgz) $(termkey_tgz) $(win32gtk_zip) \
+ $(win32iconv_bin_zip) $(win32iconv_lib_zip) $(win32curses_zip) \
+ $(pdcurses_zip) $(gtkosx_tgz)
@for file in $|; do gpg -ab $$file; done
verify-deps: | $(wildcard $(basename $(wildcard *.asc)))
@for file in $|; do echo "$$file"; gpg --verify $$file.asc || return 1; done
clean-deps:
- rm -rf scintilla ../lexers lua luajit gtdialog cdk termkey win32gtk \
- win32curses gtkosx $(notdir ../doc/bombay)
+ rm -rf scintilla ../lexers lua gtdialog cdk termkey win32gtk win32curses \
+ gtkosx $(notdir ../doc/bombay)
# Count lines of code and generate ctags.
diff --git a/src/lfs.patch b/src/lfs.patch
deleted file mode 100644
index 85391e65..00000000
--- a/src/lfs.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- lfs.c 2015-04-18 10:36:56.458722799 -0400
-+++ lib/lfs.c 2015-04-18 10:37:06.806736918 -0400
-@@ -78,7 +78,7 @@
- #endif
-
- #if LUA_VERSION_NUM < 502
--# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
-+# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,LFS_LIBNAME,l))
- #endif
-
- /* Define 'strerror' for systems that do not implement it */
diff --git a/src/lua.sym b/src/lua.sym
index 3927da21..0e2914d3 100644
--- a/src/lua.sym
+++ b/src/lua.sym
@@ -147,29 +147,3 @@ luaopen_package
luaopen_string
luaopen_table
luaopen_utf8
-# LuaJIT symbols to retain that are not listed above.
-lua_call
-lua_cpcall
-lua_equal
-lua_getfenv
-lua_insert
-lua_lessthan
-lua_loadx
-lua_objlen
-lua_pcall
-lua_remove
-lua_replace
-lua_setfenv
-lua_setlevel
-lua_tointeger
-lua_tonumber
-lua_yield
-luaL_findtable
-luaL_loadbuffer
-luaL_loadfile
-luaL_prepbuffer
-luaL_register
-luaL_typerror
-luaopen_bit
-luaopen_ffi
-luaopen_jit
diff --git a/src/luajit.patch b/src/luajit.patch
deleted file mode 100644
index 3f467d36..00000000
--- a/src/luajit.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -r a7133e1798ac src/Makefile
---- a/src/Makefile Thu Jun 13 08:39:50 2013 -0400
-+++ b/src/Makefile Thu Jun 13 08:43:22 2013 -0400
-@@ -100,7 +100,7 @@
- # enabled by default. Some other features that *might* break some existing
- # code (e.g. __pairs or os.execute() return values) can be enabled here.
- # Note: this does not provide full compatibility with Lua 5.2 at this time.
--#XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT
-+XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT
- #
- # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter.
- #XCFLAGS+= -DLUAJIT_DISABLE_JIT
-diff -r 509ca9567f6f src/luaconf.h
---- a/src/luaconf.h Wed Mar 19 23:15:13 2014 -0400
-+++ b/src/luaconf.h Wed Mar 19 23:22:19 2014 -0400
-@@ -21,9 +21,9 @@
- #define LUA_LDIR "!\\lua\\"
- #define LUA_CDIR "!\\"
- #define LUA_PATH_DEFAULT \
-- ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
-+ LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
- #define LUA_CPATH_DEFAULT \
-- ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
-+ LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
- #else
- /*
- ** Note to distribution maintainers: do NOT patch the following lines!
-@@ -35,7 +35,7 @@
- #ifndef LUA_LMULTILIB
- #define LUA_LMULTILIB "lib"
- #endif
--#define LUA_LROOT "/usr/local"
-+#define LUA_LROOT "/usr/"
- #define LUA_LUADIR "/lua/5.1/"
- #define LUA_LJDIR "/luajit-2.0.3/"
-
-@@ -51,20 +51,20 @@
- #define LUA_RCPATH
- #endif
-
--#define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua"
-+#define LUA_JPATH LUA_JROOT "/share" LUA_LJDIR "?.lua"
- #define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR
- #define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR
- #define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua"
--#define LUA_LCPATH1 ";" LUA_LCDIR "?.so"
-+#define LUA_LCPATH1 LUA_LCDIR "?.so"
- #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so"
-
--#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH
--#define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2
-+#define LUA_PATH_DEFAULT LUA_JPATH LUA_LLPATH LUA_RLPATH
-+#define LUA_CPATH_DEFAULT LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2
- #endif
-
- /* Environment variable names for path overrides and initialization code. */
--#define LUA_PATH "LUA_PATH"
--#define LUA_CPATH "LUA_CPATH"
-+#define LUA_PATH "TA_LUA_PATH"
-+#define LUA_CPATH "TA_LUA_CPATH"
- #define LUA_INIT "LUA_INIT"
-
- /* Special file system characters. */
diff --git a/src/lutf8libjit.patch b/src/lutf8libjit.patch
deleted file mode 100644
index 7910596d..00000000
--- a/src/lutf8libjit.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- lutf8lib.c 2015-01-12 18:46:22.334838510 -0500
-+++ lib/lutf8lib.c 2015-01-12 22:42:54.527406794 -0500
-@@ -246,8 +246,9 @@
- };
-
-
--LUAMOD_API int luaopen_utf8 (lua_State *L) {
-- luaL_newlib(L, funcs);
-+int luaopen_utf8 (lua_State *L) {
-+ lua_newtable(L), luaL_register(L, "utf8", funcs);
-+ lua_pushvalue(L, -1), lua_setglobal(L, "utf8");
- lua_pushlstring(L, UTF8PATT, sizeof(UTF8PATT)/sizeof(char) - 1);
- lua_setfield(L, -2, "charpattern");
- return 1;
diff --git a/src/textadept.c b/src/textadept.c
index e077e983..3433a149 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -104,24 +104,7 @@ typedef void Scintilla;
l_setcfunction(l, -1, "__newindex", __newindex); \
} \
lua_setmetatable(l, (n > 0) ? n : n - 1);
-// Translate Lua 5.3 API to LuaJIT API (Lua 5.1) for compatibility.
-#if LUA_VERSION_NUM == 501
-#define LUA_OK 0
-#define lua_rawlen lua_objlen
-#define LUA_OPEQ 0
-#undef lua_getglobal
-#define lua_getglobal(l, n) \
- (lua_getfield(l, LUA_GLOBALSINDEX, (n)), lua_type(l, -1))
-#define lua_getfield(l, t, k) (lua_getfield(l, t, k), lua_type(l, -1))
-#define lua_rawgeti(l, i, n) (lua_rawgeti(l, i, n), lua_type(l, -1))
-#define lua_gettable(l, i) (lua_gettable(l, i), lua_type(l, -1))
-#define luaL_openlibs(l) luaL_openlibs(l), luaopen_utf8(l)
-#define lL_openlib(l, n) \
- (lua_pushcfunction(l, luaopen_##n), lua_pushstring(l, #n), lua_call(l, 1, 0))
-LUALIB_API int luaopen_utf8(lua_State *);
-#else
#define lL_openlib(l, n) (luaL_requiref(l, #n, luaopen_##n, 1), lua_pop(l, 1))
-#endif
static char *textadept_home, *platform;
@@ -1513,13 +1496,9 @@ static int lL_init(lua_State *L, int argc, char **argv, int reinit) {
lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
lL_cleartable(L, lua_gettop(L));
lua_pop(L, 1); // _LOADED
-#if LUA_VERSION_NUM >= 502
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
lL_cleartable(L, lua_gettop(L));
lua_pop(L, 1); // _G
-#else
- lL_cleartable(L, LUA_GLOBALSINDEX);
-#endif
}
lua_pushinteger(L, (sptr_t)L), lua_setglobal(L, "_LUA");
luaL_openlibs(L);