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.

66 lines
1.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=lyaml
  3. PKG_VERSION:=6.2.7
  4. PKG_RELEASE:=2
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://codeload.github.com/gvvaughan/lyaml/tar.gz/v$(PKG_VERSION)?
  7. PKG_HASH:=9bb489cefae48b150d66f6bab4141d8d5831fcb7465bfc52a9845fa01efc63b0
  8. PKG_MAINTAINER:=Mathew McBride <matt@traverse.com.au>
  9. PKG_LICENSE:=MIT
  10. PKG_LICENSE_FILES:=LICENSE
  11. PKG_BUILD_DEPENDS:=lua/host luarocks/host HOST_OS_MACOS:fakeuname/host
  12. include $(INCLUDE_DIR)/package.mk
  13. ifeq ($(CONFIG_HOST_OS_MACOS),y)
  14. include ../../utils/fakeuname/fakeuname.mk
  15. endif
  16. define Package/lyaml
  17. SUBMENU:=Lua
  18. SECTION:=lang
  19. CATEGORY:=Languages
  20. TITLE:=Lua lib-yaml bindings
  21. URL:=https://github.com/gvvaughan/lyaml
  22. DEPENDS:= +lua +libyaml
  23. endef
  24. define Package/lyaml/description
  25. Lua bindings for libyaml
  26. endef
  27. TARGET_CFLAGS += \
  28. -I$(STAGING_DIR)/usr/include
  29. # Note: the duplicate environment exports are not a typo!
  30. # First is for luarocks, then the second is for the compilation
  31. # invoked by luarocks
  32. # (Same setup as luaposix)
  33. define Build/Compile
  34. cd $(PKG_BUILD_DIR) && \
  35. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  36. LUA_PKGNAME=lua5.1 \
  37. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  38. LDFLAGS="$(TARGET_LDFLAGS)" \
  39. CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
  40. $(if $(CONFIG_HOST_OS_MACOS),PATH=$(FAKEUNAME_PATH):$(TARGET_PATH_PKG)) \
  41. luarocks make --pack-binary-rock lyaml-$(PKG_VERSION)-1.rockspec \
  42. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  43. YAML_DIR=$(STAGING_DIR)/usr \
  44. LUA_INCDIR=$(STAGING_DIR)/usr/include \
  45. LUA_PKGNAME=lua5.1 \
  46. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  47. LDFLAGS="$(TARGET_LDFLAGS)" \
  48. CC="$(TARGET_CC)" LD="$(TARGET_CC)"
  49. endef
  50. define Package/lyaml/install
  51. $(INSTALL_DIR) $(1)/usr/lib/lua/lyaml
  52. $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/yaml.so $(1)/usr/lib/lua/
  53. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/lyaml/*.lua $(1)/usr/lib/lua/lyaml/
  54. endef
  55. $(eval $(call BuildPackage,lyaml))