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.

65 lines
1.9 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:=luaposix
  7. PKG_VERSION:=35.1
  8. PKG_RELEASE:=$(AUTORELEASE)
  9. PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)?
  10. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  11. PKG_HASH:=1b5c48d2abd59de0738d1fc1e6204e44979ad2a1a26e8e22a2d6215dd502c797
  12. PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
  13. PKG_LICENSE:=MIT
  14. PKG_LICENSE_FILES:=COPYING
  15. PKG_BUILD_DEPENDS:=luarocks/host
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/luaposix
  18. SUBMENU:=Lua
  19. SECTION:=lang
  20. CATEGORY:=Languages
  21. TITLE:=POSIX binding for LuaJIT, Lua 5.1, 5.2 and 5.3
  22. URL:=https://github.com/luaposix/luaposix
  23. DEPENDS:=+lua +lua-bit32
  24. endef
  25. define Package/luaposix/description
  26. luaposix is a general POSIX library for Lua providing access
  27. to various low level libc functions.
  28. endef
  29. TARGET_PATH_PKG:=$(CURDIR)/scripts:$(TARGET_PATH_PKG)
  30. TARGET_CFLAGS += \
  31. -I$(STAGING_DIR)/usr/include
  32. define Build/Compile
  33. cd $(PKG_BUILD_DIR) && \
  34. LDFLAGS="$(TARGET_LDFLAGS) $(FPIC)" \
  35. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  36. CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
  37. LUA_PKGNAME=lua5.1 \
  38. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  39. luarocks make --force --deps-mode=none --pack-binary-rock luaposix-$(PKG_VERSION)-1.rockspec \
  40. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  41. LUA_PKGNAME=lua5.1 \
  42. CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
  43. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  44. LDFLAGS="$(TARGET_LDFLAGS)"
  45. endef
  46. define Package/luaposix/install
  47. $(INSTALL_DIR) $(1)/usr/lib/lua/posix/sys
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/*.so $(1)/usr/lib/lua/posix/
  49. $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/sys/*.so $(1)/usr/lib/lua/posix/sys/
  50. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/posix/*.lua $(1)/usr/lib/lua/posix/
  51. rm -f $(1)/usr/lib/lua/posix/{deprecated,compat}.lua
  52. endef
  53. $(eval $(call BuildPackage,luaposix))