Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lua-cjson
  9. PKG_VERSION:=2.1.0
  10. PKG_RELEASE:=2
  11. PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
  12. PKG_LICENSE:=MIT
  13. PKG_LICENSE_FILES:=LICENSE
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=http://www.kyne.com.au/~mark/software/download/
  16. PKG_MD5SUM:=24f270663e9f6ca8ba2a02cef19f7963
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  18. HOST_BUILD_DEPENDS:=lua/host
  19. include $(INCLUDE_DIR)/host-build.mk
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/lua-cjson
  23. SUBMENU:=Lua
  24. SECTION:=lang
  25. CATEGORY:=Languages
  26. TITLE:=Lua CJSON parser
  27. URL:=https://github.com/mpx/lua-cjson
  28. DEPENDS:= +lua
  29. endef
  30. define Package/lua-cjson/description
  31. Lua CJSON is a fast JSON encoding/parsing module for Lua.
  32. endef
  33. CMAKE_OPTIONS += \
  34. -DUSE_LUA=ON
  35. CMAKE_HOST_OPTIONS += \
  36. -DLUA_MATH_LIBRARY=m
  37. define Package/lua-cjson/install
  38. $(INSTALL_DIR) $(1)/usr/lib/lua
  39. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cjson.so $(1)/usr/lib/lua/
  40. $(INSTALL_DIR) $(1)/usr/lib/lua/cjson
  41. $(INSTALL_DATA) $(PKG_BUILD_DIR)/lua/cjson/util.lua $(1)/usr/lib/lua/cjson
  42. endef
  43. $(eval $(call HostBuild))
  44. $(eval $(call BuildPackage,lua-cjson))