mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 16:47:15 +04:00
Also refresh 020-riscv64-support.patch from the current state of openresty/luajit2#236. The previous snapshot defined asm_tail_prep(ASMState *as), but since openresty/luajit2 commit 68354f44 the callers pass a second TraceNo argument, so the riscv64 build failed with: lj_asm.c:2559:5: error: too many arguments to function 'asm_tail_prep' The refreshed patch carries the upstream adaptation and restores the build. The other four patches apply unchanged. Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
98 lines
2.7 KiB
Makefile
98 lines
2.7 KiB
Makefile
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=luajit2
|
|
PKG_SOURCE_DATE:=2026-07-31
|
|
PKG_VERSION:=2.1.$(subst -,.,$(PKG_SOURCE_DATE))
|
|
PKG_RELEASE:=1
|
|
|
|
PKG_SOURCE_PROTO:=git
|
|
PKG_SOURCE_URL:=https://github.com/openresty/luajit2
|
|
PKG_MIRROR_HASH:=cf3ae553640fcd6400bc545d87c9a7a3317b9e944216bd76433b84eabb756c3e
|
|
PKG_SOURCE_VERSION:=52f52587b37867ab19236eb6917001c2d6b662e7
|
|
|
|
PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
|
|
PKG_LICENSE:=MIT
|
|
PKG_LICENSE_FILES:=COPYRIGHT
|
|
|
|
PKG_BUILD_FLAGS:=no-mips16
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
include $(INCLUDE_DIR)/host-build.mk
|
|
|
|
# HAS_LUAJIT_ARCH config is defined in luajit and is used to define
|
|
# arch deoendency for luajit. Since luajit2 is an improved version of
|
|
# luajit, they share the same arch dependency. Refer there to update
|
|
# dependency for them.
|
|
define Package/luajit2
|
|
SECTION:=lang
|
|
CATEGORY:=Languages
|
|
SUBMENU:=Lua
|
|
TITLE:=LuaJIT from OpenResty
|
|
URL:=https://www.luajit.org
|
|
DEPENDS:=@HAS_LUAJIT_ARCH
|
|
PROVIDES:=luajit
|
|
endef
|
|
|
|
define Package/luajit2/description
|
|
OpenResty's maintained branch of LuaJIT, a Just-In-Time (JIT) compiler for the Lua programming language
|
|
endef
|
|
|
|
ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH), x86_64 mips64))
|
|
ifeq ($(CONFIG_ARCH_64BIT),)
|
|
HOST_BITS := -m32
|
|
endif
|
|
endif
|
|
|
|
define Build/Compile
|
|
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
|
|
CROSS="$(TARGET_CROSS)" \
|
|
DESTDIR=$(PKG_INSTALL_DIR) \
|
|
PREFIX=/usr \
|
|
TARGET_SYS=Linux \
|
|
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
|
|
BUILDMODE=dynamic
|
|
$(RM) -rf $(PKG_INSTALL_DIR)
|
|
mkdir -p $(PKG_INSTALL_DIR)
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
DESTDIR=$(PKG_INSTALL_DIR) \
|
|
PREFIX=/usr \
|
|
TARGET_SYS=Linux \
|
|
install
|
|
endef
|
|
|
|
define Build/InstallDev
|
|
$(INSTALL_DIR) $(1)/usr/include/luajit-2.1
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.{h,hpp} $(1)/usr/include/luajit-2.1
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*so* $(1)/usr/lib/
|
|
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-* $(1)/usr/bin/$(PKG_NAME)
|
|
endef
|
|
|
|
define Package/luajit2/install
|
|
$(INSTALL_DIR) $(1)/usr/lib/
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-* $(1)/usr/bin/$(PKG_NAME)
|
|
endef
|
|
|
|
define Host/Compile
|
|
$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
|
|
DPREFIX=$(STAGING_DIR_HOSTPKG) \
|
|
TARGET_CFLAGS="$(HOST_CFLAGS)" \
|
|
TARGET_LDFLAGS="$(HOST_LDFLAGS)"
|
|
endef
|
|
|
|
define Host/Install
|
|
$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
|
|
DPREFIX=$(STAGING_DIR_HOSTPKG) \
|
|
install
|
|
$(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-* $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
|
|
endef
|
|
|
|
$(eval $(call HostBuild,luajit2))
|
|
$(eval $(call BuildPackage,luajit2))
|