Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=libubox
  3. PKG_RELEASE=1
  4. PKG_SOURCE_PROTO:=git
  5. PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git
  6. PKG_SOURCE_DATE:=2018-11-16
  7. PKG_SOURCE_VERSION:=4382c76d1f225e462c6adf37e577fea0d046b854
  8. PKG_MIRROR_HASH:=17188fdd604f028dde8366a0dca24dd873df28acea1b25a34c8b4db4ef29baac
  9. CMAKE_INSTALL:=1
  10. PKG_LICENSE:=ISC
  11. PKG_LICENSE_FILES:=
  12. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  13. PKG_BUILD_DEPENDS:=lua
  14. include $(INCLUDE_DIR)/package.mk
  15. include $(INCLUDE_DIR)/host-build.mk
  16. include $(INCLUDE_DIR)/cmake.mk
  17. define Package/libubox
  18. SECTION:=libs
  19. CATEGORY:=Libraries
  20. TITLE:=Basic utility library
  21. ABI_VERSION:=$(PKG_VERSION)
  22. DEPENDS:=
  23. endef
  24. define Package/libblobmsg-json
  25. SECTION:=libs
  26. CATEGORY:=Libraries
  27. TITLE:=blobmsg <-> json conversion library
  28. DEPENDS:=+libjson-c +libubox
  29. endef
  30. define Package/jshn
  31. SECTION:=utils
  32. CATEGORY:=Utilities
  33. DEPENDS:=+libjson-c +libubox +libblobmsg-json
  34. TITLE:=JSON SHell Notation
  35. endef
  36. define Package/jshn/description
  37. Library for parsing and generating JSON from shell scripts
  38. endef
  39. define Package/libjson-script
  40. SECTION:=utils
  41. CATEGORY:=Utilities
  42. DEPENDS:=+libubox
  43. TITLE:=Minimalistic JSON based scripting engine
  44. endef
  45. define Package/libubox-lua
  46. SECTION:=libs
  47. CATEGORY:=Libraries
  48. DEPENDS:=+libubox +liblua
  49. TITLE:=Lua binding for the OpenWrt Basic utility library
  50. endef
  51. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  52. CMAKE_OPTIONS = \
  53. -DLUAPATH=/usr/lib/lua
  54. define Package/libubox/install
  55. $(INSTALL_DIR) $(1)/lib/
  56. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libubox.so $(1)/lib/
  57. endef
  58. define Package/libblobmsg-json/install
  59. $(INSTALL_DIR) $(1)/lib/
  60. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblobmsg_json.so $(1)/lib/
  61. endef
  62. define Package/jshn/install
  63. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/libubox
  64. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jshn $(1)/usr/bin
  65. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libubox/jshn.sh $(1)/usr/share/libubox
  66. endef
  67. define Package/libjson-script/install
  68. $(INSTALL_DIR) $(1)/lib/
  69. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so $(1)/lib/
  70. endef
  71. define Package/libubox-lua/install
  72. $(INSTALL_DIR) $(1)/usr/lib/lua
  73. $(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
  74. endef
  75. CMAKE_HOST_OPTIONS += \
  76. -DBUILD_LUA=OFF \
  77. -DBUILD_EXAMPLES=OFF \
  78. $(eval $(call BuildPackage,libubox))
  79. $(eval $(call BuildPackage,libblobmsg-json))
  80. $(eval $(call BuildPackage,jshn))
  81. $(eval $(call BuildPackage,libjson-script))
  82. $(eval $(call BuildPackage,libubox-lua))
  83. $(eval $(call HostBuild))