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