You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.5 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=luajit
  3. PKG_VERSION:=2.1.0-beta3
  4. PKG_RELEASE:=4
  5. PKG_SOURCE:=LuaJIT-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://luajit.org/download
  7. PKG_HASH:=1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3
  8. PKG_BUILD_DIR:=$(BUILD_DIR)/LuaJIT-$(PKG_VERSION)
  9. PKG_MAINTAINER:=Morteza Milani <milani@pichak.co>
  10. PKG_LICENSE:=MIT
  11. PKG_LICENSE_FILES:=COPYRIGHT
  12. PKG_USE_MIPS16:=0
  13. include $(INCLUDE_DIR)/package.mk
  14. include $(INCLUDE_DIR)/host-build.mk
  15. define Package/luajit
  16. SUBMENU:=Lua
  17. SECTION:=lang
  18. CATEGORY:=Languages
  19. TITLE:=LuaJIT
  20. URL:=https://www.luajit.org
  21. DEPENDS:=@(i386||x86_64||arm||armeb||aarch64||powerpc||mips||mipsel||mips64)
  22. endef
  23. define Package/luajit/description
  24. LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. *** Requires GCC Multilib on host system to build! ***
  25. endef
  26. ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH), x86_64 mips64))
  27. ifeq ($(CONFIG_ARCH_64BIT),)
  28. HOST_BITS := -m32
  29. endif
  30. endif
  31. define Build/Compile
  32. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  33. HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
  34. CROSS="$(TARGET_CROSS)" \
  35. DPREFIX=$(PKG_INSTALL_DIR)/usr \
  36. PREFIX=/usr \
  37. TARGET_SYS=Linux \
  38. TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  39. BUILDMODE=dynamic
  40. rm -rf $(PKG_INSTALL_DIR)
  41. mkdir -p $(PKG_INSTALL_DIR)
  42. $(MAKE) -C $(PKG_BUILD_DIR) \
  43. DPREFIX=$(PKG_INSTALL_DIR)/usr \
  44. PREFIX=/usr \
  45. TARGET_SYS=Linux \
  46. install
  47. endef
  48. define Build/InstallDev
  49. $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
  50. $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.{h,hpp} $(1)/usr/include/luajit-2.1
  51. $(INSTALL_DIR) $(1)/usr/lib
  52. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*so* $(1)/usr/lib/
  53. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  54. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
  55. $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_VERSION) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
  56. endef
  57. define Package/luajit/install
  58. $(INSTALL_DIR) $(1)/usr/lib/
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  60. $(INSTALL_DIR) $(1)/usr/bin
  61. $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_VERSION) $(1)/usr/bin/$(PKG_NAME)
  62. endef
  63. define Host/Compile
  64. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
  65. DPREFIX=$(STAGING_DIR_HOSTPKG) \
  66. TARGET_CFLAGS="$(HOST_CFLAGS)" \
  67. TARGET_LDFLAGS="$(HOST_LDFLAGS)"
  68. endef
  69. define Host/Install
  70. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
  71. DPREFIX=$(STAGING_DIR_HOSTPKG) \
  72. install
  73. $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-$(PKG_VERSION) $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
  74. endef
  75. $(eval $(call HostBuild,luajit))
  76. $(eval $(call BuildPackage,luajit))