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.

59 lines
1.5 KiB

  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=lua-bit32
  7. PKG_VERSION:=5.3.0
  8. PKG_RELEASE:=1
  9. PKG_SRC_NAME:=lua-compat-5.2
  10. PKG_SRC_VERSION:=0.3
  11. PKG_SOURCE_URL=https://codeload.github.com/keplerproject/$(PKG_SRC_NAME)/tar.gz/v$(PKG_SRC_VERSION)?
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_HASH:=627e842c488c1afece4383da9f9a839a7ddbc2f7fedfc456f76e3a590d4ca67f
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SRC_NAME)-$(PKG_SRC_VERSION)
  15. PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_BUILD_DEPENDS:=luarocks/host
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/lua-bit32
  21. SUBMENU:=Lua
  22. SECTION:=lang
  23. CATEGORY:=Languages
  24. TITLE:=Lua 5.2 bit manipulation library
  25. DEPENDS:=+lua
  26. endef
  27. define Package/lua-bit32/description
  28. lua-bit32 is the native Lua 5.2 bit manipulation library,
  29. backported to Lua 5.1
  30. endef
  31. TARGET_CFLAGS += \
  32. -I$(STAGING_DIR)/usr/include
  33. define Build/Compile
  34. cd $(PKG_BUILD_DIR) && \
  35. luarocks make --pack-binary-rock bit32-scm-1.rockspec \
  36. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  37. LUA_PKGNAME=lua5.1 \
  38. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  39. LDFLAGS="$(TARGET_LDFLAGS)" \
  40. CC="$(TARGET_CC)" LD="$(TARGET_CC)"
  41. endef
  42. define Package/$(PKG_NAME)/install
  43. $(INSTALL_DIR) $(1)/usr/lib/lua
  44. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bit32.so $(1)/usr/lib/lua
  45. endef
  46. $(eval $(call BuildPackage,lua-bit32))