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.

62 lines
1.7 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=lyaml
  3. PKG_VERSION:=6.2.7
  4. PKG_RELEASE:=1
  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
  12. include $(INCLUDE_DIR)/package.mk
  13. define Package/lyaml
  14. SUBMENU:=Lua
  15. SECTION:=lang
  16. CATEGORY:=Languages
  17. TITLE:=Lua lib-yaml bindings
  18. URL:=https://github.com/gvvaughan/lyaml
  19. DEPENDS:= +lua +libyaml
  20. endef
  21. define Package/lyaml/description
  22. Lua bindings for libyaml
  23. endef
  24. TARGET_CFLAGS += \
  25. -I$(STAGING_DIR)/usr/include
  26. # Note: the duplicate environment exports are not a typo!
  27. # First is for luarocks, then the second is for the compilation
  28. # invoked by luarocks
  29. # (Same setup as luaposix)
  30. define Build/Compile
  31. cd $(PKG_BUILD_DIR) && \
  32. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  33. LUA_PKGNAME=lua5.1 \
  34. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  35. LDFLAGS="$(TARGET_LDFLAGS)" \
  36. CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
  37. luarocks make --pack-binary-rock lyaml-$(PKG_VERSION)-1.rockspec \
  38. LUA_LIBDIR=$(STAGING_DIR)/usr/lib/lua \
  39. YAML_DIR=$(STAGING_DIR)/usr \
  40. LUA_INCDIR=$(STAGING_DIR)/usr/include \
  41. LUA_PKGNAME=lua5.1 \
  42. CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \
  43. LDFLAGS="$(TARGET_LDFLAGS)" \
  44. CC="$(TARGET_CC)" LD="$(TARGET_CC)"
  45. endef
  46. define Package/lyaml/install
  47. $(INSTALL_DIR) $(1)/usr/lib/lua/lyaml
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/linux/yaml.so $(1)/usr/lib/lua/
  49. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/lyaml/*.lua $(1)/usr/lib/lua/lyaml/
  50. endef
  51. $(eval $(call BuildPackage,lyaml))