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.

92 lines
2.6 KiB

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