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.

63 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:=34.1.1
  8. PKG_RELEASE:=1
  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:=7948f4ac8b953172e928753632e37ad97cc3014df74b524fe7839f71216a7e90
  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_CFLAGS += \
  30. -I$(STAGING_DIR)/usr/include
  31. define Build/Compile
  32. cd $(PKG_BUILD_DIR) && \
  33. LDFLAGS="$(TARGET_LDFLAGS) $(FPIC)" \
  34. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  35. CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
  36. LUA_PKGNAME=lua5.1 \
  37. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  38. luarocks make --force --deps-mode=none --pack-binary-rock luaposix-$(PKG_VERSION)-1.rockspec \
  39. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  40. LUA_PKGNAME=lua5.1 \
  41. CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
  42. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  43. LDFLAGS="$(TARGET_LDFLAGS)"
  44. endef
  45. define Package/luaposix/install
  46. $(INSTALL_DIR) $(1)/usr/lib/lua/posix/sys
  47. $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/*.so $(1)/usr/lib/lua/posix/
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/posix/sys/*.so $(1)/usr/lib/lua/posix/sys/
  49. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/posix/*.lua $(1)/usr/lib/lua/posix/
  50. rm -f $(1)/usr/lib/lua/posix/{deprecated,compat}.lua
  51. endef
  52. $(eval $(call BuildPackage,luaposix))