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.

87 lines
2.4 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=luajit
  3. PKG_VERSION:=2.1.0-beta3
  4. PKG_RELEASE:=1
  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||powerpc||mips||mipsel)
  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),x86_64)
  27. ifeq ($(CONFIG_x86_64),)
  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_CFLAGS="$(TARGET_CFLAGS)"
  38. rm -rf $(PKG_INSTALL_DIR)
  39. mkdir -p $(PKG_INSTALL_DIR)
  40. $(MAKE) -C $(PKG_BUILD_DIR) \
  41. DPREFIX=$(PKG_INSTALL_DIR)/usr \
  42. PREFIX=/usr \
  43. install
  44. endef
  45. define Build/InstallDev
  46. $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
  47. $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.{h,hpp} $(1)/usr/include/luajit-2.1
  48. $(INSTALL_DIR) $(1)/usr/lib
  49. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  50. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  51. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
  52. $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_VERSION) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
  53. endef
  54. define Package/luajit/install
  55. $(INSTALL_DIR) $(1)/usr/lib/
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  57. $(INSTALL_DIR) $(1)/usr/bin
  58. $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_VERSION) $(1)/usr/bin/$(PKG_NAME)
  59. endef
  60. define Host/Compile
  61. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
  62. DPREFIX=$(STAGING_DIR_HOSTPKG) \
  63. TARGET_CFLAGS="$(HOST_CFLAGS)" \
  64. TARGET_LDFLAGS="$(HOST_LDFLAGS)"
  65. endef
  66. define Host/Install
  67. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
  68. DPREFIX=$(STAGING_DIR_HOSTPKG) \
  69. install
  70. $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-$(PKG_VERSION) $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
  71. endef
  72. $(eval $(call HostBuild,luajit))
  73. $(eval $(call BuildPackage,luajit))