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.

91 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2018 Jianhui Zhao
  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:=libuwsc
  9. PKG_VERSION:=3.3.5
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL=https://github.com/zhaojh329/libuwsc/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=a06b7324671e181ffe3165e93e6f94c7ac1380f69e32a52e80c8da7016acd60d
  14. PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
  15. PKG_LICENSE:=MIT
  16. PKG_LICENSE_FILES:=LICENSE
  17. CMAKE_INSTALL:=1
  18. PKG_CONFIG_DEPENDS:= \
  19. CONFIG_LIBUWSC_openssl_LUA_BINDING \
  20. CONFIG_LIBUWSC_wolfssl_LUA_BINDING \
  21. CONFIG_LIBUWSC_mbedtls_LUA_BINDING \
  22. CONFIG_LIBUWSC_nossl_LUA_BINDING
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. define Package/libuwsc/Default
  26. SECTION:=libs
  27. CATEGORY:=Libraries
  28. SUBMENU:=Networking
  29. TITLE:=A lightweight WebSocket client library based on libev
  30. URL:=https://github.com/zhaojh329/libuwsc
  31. DEPENDS:=+libev $(2)
  32. VARIANT:=$(1)
  33. PROVIDES:=libuwsc
  34. endef
  35. Package/libuwsc-openssl=$(call Package/libuwsc/Default,openssl,+PACKAGE_libuwsc-openssl:libopenssl)
  36. Package/libuwsc-wolfssl=$(call Package/libuwsc/Default,wolfssl,+PACKAGE_libuwsc-wolfssl:libwolfssl)
  37. Package/libuwsc-mbedtls=$(call Package/libuwsc/Default,mbedtls,+PACKAGE_libuwsc-mbedtls:libmbedtls)
  38. Package/libuwsc-nossl=$(call Package/libuwsc/Default,nossl)
  39. define Package/libuwsc/config
  40. menu "Configuration"
  41. depends on PACKAGE_libuwsc-$(1)
  42. config LIBUWSC_$(1)_LUA_BINDING
  43. bool
  44. default n
  45. prompt "Lua binding for libuwsc"
  46. endmenu
  47. endef
  48. Package/libuwsc-openssl/config=$(call Package/libuwsc/config,openssl)
  49. Package/libuwsc-wolfssl/config=$(call Package/libuwsc/config,wolfssl)
  50. Package/libuwsc-mbedtls/config=$(call Package/libuwsc/config,mbedtls)
  51. Package/libuwsc-nossl/config=$(call Package/libuwsc/config,nossl)
  52. ifeq ($(BUILD_VARIANT),openssl)
  53. CMAKE_OPTIONS += -DUWSC_USE_OPENSSL=ON
  54. else ifeq ($(BUILD_VARIANT),wolfssl)
  55. CMAKE_OPTIONS += -DUWSC_USE_WOLFSSL=ON
  56. else ifeq ($(BUILD_VARIANT),mbedtls)
  57. CMAKE_OPTIONS += -DUWSC_USE_MBEDTLS=ON
  58. else
  59. CMAKE_OPTIONS += -DUWSC_SSL_SUPPORT=OFF
  60. endif
  61. ifneq ($(CONFIG_LIBUWSC_$(BUILD_VARIANT)_LUA_BINDING),)
  62. CMAKE_OPTIONS += -DUWSC_LUA_SUPPORT=ON
  63. endif
  64. define Package/libuwsc-$(BUILD_VARIANT)/install
  65. $(INSTALL_DIR) $(1)/usr/lib
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuwsc.so* $(1)/usr/lib/
  67. ifneq ($(CONFIG_LIBUWSC_$(BUILD_VARIANT)_LUA_BINDING),)
  68. $(INSTALL_DIR) $(1)/usr/lib/lua
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/uwsc.so $(1)/usr/lib/lua
  70. endif
  71. endef
  72. $(eval $(call BuildPackage,libuwsc-openssl))
  73. $(eval $(call BuildPackage,libuwsc-wolfssl))
  74. $(eval $(call BuildPackage,libuwsc-mbedtls))
  75. $(eval $(call BuildPackage,libuwsc-nossl))