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.

63 lines
1.9 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.1.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL=https://codeload.github.com/zhaojh329/libuwsc/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=1a89d1d7464ab2881a1153cddc36dfe19ee2acb706b8a7d9d42fb13d5572ab50
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Jianhui Zhao <jianhuizhao329@gmail.com>
  16. PKG_LICENSE:=LGPL-2.1
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_BUILD_PARALLEL:=1
  19. CMAKE_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/libuwsc/Default
  23. TITLE:=A lightweight WebSocket client library based on libev
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. SUBMENU:=Networking
  27. URL:=https://github.com/zhaojh329/libuwsc
  28. DEPENDS:=+libev $(2)
  29. VARIANT:=$(1)
  30. PROVIDES:=libuwsc
  31. endef
  32. Package/libuwsc-openssl=$(call Package/libuwsc/Default,openssl,+PACKAGE_libuwsc-openssl:libopenssl)
  33. Package/libuwsc-wolfssl=$(call Package/libuwsc/Default,wolfssl,+PACKAGE_libuwsc-wolfssl:libwolfssl)
  34. Package/libuwsc-mbedtls=$(call Package/libuwsc/Default,mbedtls,+PACKAGE_libuwsc-mbedtls:libmbedtls)
  35. Package/libuwsc-nossl=$(call Package/libuwsc/Default,nossl)
  36. ifeq ($(BUILD_VARIANT),openssl)
  37. CMAKE_OPTIONS += -DUWSC_USE_OPENSSL=ON
  38. else ifeq ($(BUILD_VARIANT),wolfssl)
  39. CMAKE_OPTIONS += -DUWSC_USE_WOLFSSL=ON
  40. else ifeq ($(BUILD_VARIANT),mbedtls)
  41. CMAKE_OPTIONS += -DUWSC_USE_MBEDTLS=ON
  42. else
  43. CMAKE_OPTIONS += -DUWSC_SSL_SUPPORT=OFF
  44. endif
  45. define Package/libuwsc-$(BUILD_VARIANT)/install
  46. $(INSTALL_DIR) $(1)/usr/lib/
  47. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuwsc.so* $(1)/usr/lib/
  48. endef
  49. $(eval $(call BuildPackage,libuwsc-openssl))
  50. $(eval $(call BuildPackage,libuwsc-wolfssl))
  51. $(eval $(call BuildPackage,libuwsc-mbedtls))
  52. $(eval $(call BuildPackage,libuwsc-nossl))