Leonid Plyushch
5 years ago
4 changed files with 136 additions and 0 deletions
@ -0,0 +1,51 @@ |
|||
TERMUX_PKG_HOMEPAGE=https://luajit.org/ |
|||
TERMUX_PKG_DESCRIPTION="Just-In-Time Compiler for Lua" |
|||
TERMUX_PKG_LICENSE="MIT" |
|||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com" |
|||
TERMUX_PKG_VERSION=2.1.0~beta3 |
|||
TERMUX_PKG_REVISION=2 |
|||
TERMUX_PKG_SRCURL=https://github.com/LuaJIT/LuaJIT/archive/v2.1.0-beta3.tar.gz |
|||
TERMUX_PKG_SHA256=409f7fe570d3c16558e594421c47bdd130238323c9d6fd6c83dedd2aaeb082a8 |
|||
TERMUX_PKG_BREAKS="libluajit-dev" |
|||
TERMUX_PKG_REPLACES="libluajit-dev" |
|||
TERMUX_PKG_EXTRA_MAKE_ARGS="amalg PREFIX=$TERMUX_PREFIX" |
|||
TERMUX_PKG_BUILD_IN_SRC=true |
|||
|
|||
termux_step_pre_configure() { |
|||
# luajit wants same pointer size for host and target build |
|||
export HOST_CC="gcc" |
|||
if [ $TERMUX_ARCH_BITS = "32" ]; then |
|||
if [ $(uname) = "Linux" ]; then |
|||
# NOTE: "apt install libc6-dev-i386" for 32-bit headers |
|||
export HOST_CFLAGS="-m32" |
|||
export HOST_LDFLAGS="-m32" |
|||
elif [ $(uname) = "Darwin" ]; then |
|||
export HOST_CFLAGS="-m32 -arch i386" |
|||
export HOST_LDFLAGS="-arch i386" |
|||
fi |
|||
fi |
|||
export TARGET_FLAGS="$CFLAGS $CPPFLAGS $LDFLAGS" |
|||
export TARGET_SYS=Linux |
|||
unset CFLAGS LDFLAGS |
|||
} |
|||
|
|||
termux_step_make_install () { |
|||
mkdir -p $TERMUX_PREFIX/include/luajit-2.0/ |
|||
cp -f $TERMUX_PKG_SRCDIR/src/{lauxlib.h,lua.h,lua.hpp,luaconf.h,luajit.h,lualib.h} $TERMUX_PREFIX/include/luajit-2.0/ |
|||
rm -f $TERMUX_PREFIX/lib/libluajit* |
|||
|
|||
install -Dm600 $TERMUX_PKG_SRCDIR/src/libluajit.so $TERMUX_PREFIX/lib/libluajit-5.1.so |
|||
(cd $TERMUX_PREFIX/lib; ln -s -f libluajit-5.1.so libluajit.so) |
|||
|
|||
install -Dm600 $TERMUX_PKG_SRCDIR/etc/luajit.1 $TERMUX_PREFIX/share/man/man1/luajit.1 |
|||
install -Dm600 $TERMUX_PKG_SRCDIR/etc/luajit.pc $TERMUX_PREFIX/lib/pkgconfig/luajit.pc |
|||
install -Dm700 $TERMUX_PKG_SRCDIR/src/luajit $TERMUX_PREFIX/bin/luajit |
|||
|
|||
# Files needed for the -b option (http://luajit.org/running.html) to work. |
|||
# Note that they end up in the 'luajit' subpackage, not the 'libluajit' one. |
|||
TERMUX_LUAJIT_JIT_FOLDER_RELATIVE=share/luajit-$TERMUX_PKG_VERSION/jit |
|||
local TERMUX_LUAJIT_JIT_FOLDER=$TERMUX_PREFIX/$TERMUX_LUAJIT_JIT_FOLDER_RELATIVE |
|||
rm -Rf $TERMUX_LUAJIT_JIT_FOLDER |
|||
mkdir -p $TERMUX_LUAJIT_JIT_FOLDER |
|||
cp $TERMUX_PKG_SRCDIR/src/jit/*lua $TERMUX_LUAJIT_JIT_FOLDER |
|||
} |
@ -0,0 +1,12 @@ |
|||
diff -uNr LuaJIT-2.1.0-beta3/etc/luajit.pc LuaJIT-2.1.0-beta3.mod/etc/luajit.pc
|
|||
--- LuaJIT-2.1.0-beta3/etc/luajit.pc 2017-05-01 22:03:01.000000000 +0300
|
|||
+++ LuaJIT-2.1.0-beta3.mod/etc/luajit.pc 2019-07-01 17:40:16.877257398 +0300
|
|||
@@ -5,7 +5,7 @@
|
|||
version=${majver}.${minver}.${relver}-beta3 |
|||
abiver=5.1 |
|||
|
|||
-prefix=/usr/local
|
|||
+prefix=@TERMUX_PREFIX@
|
|||
multilib=lib |
|||
exec_prefix=${prefix} |
|||
libdir=${exec_prefix}/${multilib} |
@ -0,0 +1,2 @@ |
|||
TERMUX_SUBPKG_INCLUDE="bin/luajit share/man/man1 $TERMUX_LUAJIT_JIT_FOLDER_RELATIVE" |
|||
TERMUX_SUBPKG_DESCRIPTION="Just-In-Time compiler for Lua - command line tool" |
@ -0,0 +1,71 @@ |
|||
diff -uNr LuaJIT-2.1.0-beta3/src/Makefile LuaJIT-2.1.0-beta3.mod/src/Makefile
|
|||
--- LuaJIT-2.1.0-beta3/src/Makefile 2017-05-01 22:03:01.000000000 +0300
|
|||
+++ LuaJIT-2.1.0-beta3.mod/src/Makefile 2019-07-01 21:33:38.426284669 +0300
|
|||
@@ -27,7 +27,7 @@
|
|||
DEFAULT_CC = gcc |
|||
# |
|||
# LuaJIT builds as a native 32 or 64 bit binary by default. |
|||
-CC= $(DEFAULT_CC)
|
|||
+CC?= $(DEFAULT_CC)
|
|||
# |
|||
# Use this if you want to force a 32 bit build on a 64 bit multilib OS. |
|||
#CC= $(DEFAULT_CC) -m32 |
|||
@@ -71,14 +71,14 @@
|
|||
# as dynamic mode. |
|||
# |
|||
# Mixed mode creates a static + dynamic library and a statically linked luajit. |
|||
-BUILDMODE= mixed
|
|||
+#BUILDMODE= mixed
|
|||
# |
|||
# Static mode creates a static library and a statically linked luajit. |
|||
#BUILDMODE= static |
|||
# |
|||
# Dynamic mode creates a dynamic library and a dynamically linked luajit. |
|||
# Note: this executable will only run when the library is installed! |
|||
-#BUILDMODE= dynamic
|
|||
+BUILDMODE= dynamic
|
|||
# |
|||
############################################################################## |
|||
|
|||
@@ -190,7 +190,7 @@
|
|||
CCOPTIONS= $(CCDEBUG) $(ASOPTIONS) |
|||
LDOPTIONS= $(CCDEBUG) $(LDFLAGS) |
|||
|
|||
-HOST_CC= $(CC)
|
|||
+HOST_CC?= $(CC)
|
|||
HOST_RM= rm -f |
|||
# If left blank, minilua is built and used. You can supply an installed |
|||
# copy of (plain) Lua 5.1 or 5.2, plus Lua BitOp. E.g. with: HOST_LUA=lua |
|||
@@ -203,17 +203,17 @@
|
|||
HOST_ALDFLAGS= $(LDOPTIONS) $(HOST_XLDFLAGS) $(HOST_LDFLAGS) |
|||
HOST_ALIBS= $(HOST_XLIBS) $(LIBS) $(HOST_LIBS) |
|||
|
|||
-STATIC_CC = $(CROSS)$(CC)
|
|||
-DYNAMIC_CC = $(CROSS)$(CC) -fPIC
|
|||
+STATIC_CC = $(CC)
|
|||
+DYNAMIC_CC = $(CC) -fPIC
|
|||
TARGET_CC= $(STATIC_CC) |
|||
TARGET_STCC= $(STATIC_CC) |
|||
TARGET_DYNCC= $(DYNAMIC_CC) |
|||
-TARGET_LD= $(CROSS)$(CC)
|
|||
-TARGET_AR= $(CROSS)ar rcus 2>/dev/null
|
|||
-TARGET_STRIP= $(CROSS)strip
|
|||
+TARGET_LD= $(CC)
|
|||
+TARGET_AR= $(AR) rcus 2>/dev/null
|
|||
+TARGET_STRIP= $(STRIP)
|
|||
|
|||
TARGET_LIBPATH= $(or $(PREFIX),/usr/local)/$(or $(MULTILIB),lib) |
|||
-TARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER)
|
|||
+TARGET_SONAME= libluajit-$(ABIVER).so
|
|||
TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib |
|||
TARGET_DYLIBPATH= $(TARGET_LIBPATH)/$(TARGET_DYLIBNAME) |
|||
TARGET_DLLNAME= lua$(NODOTABIVER).dll |
|||
@@ -585,7 +585,7 @@
|
|||
endif |
|||
endif |
|||
|
|||
-Q= @
|
|||
+Q=
|
|||
E= @echo |
|||
#Q= |
|||
#E= @: |
Loading…
Reference in new issue