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.

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