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.

106 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2014-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:=libwebsockets
  9. PKG_VERSION:=4.1.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
  14. PKG_HASH:=402e9a8df553c9cd2aff5d7a9758e9e5285bf3070c82539082864633db3deb83
  15. PKG_SOURCE_VERSION:=v$(PKG_VERSION)
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE
  18. CMAKE_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. CMAKE_OPTIONS += -DLWS_IPV6=$(if $(CONFIG_IPV6),ON,OFF)
  22. CMAKE_OPTIONS += -DISABLE_WERROR=ON
  23. CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Release
  24. # turn off all test apps
  25. CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
  26. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_SERVER=ON
  27. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON
  28. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_PING=ON
  29. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_CLIENT=ON
  30. define Package/libwebsockets/Default
  31. SECTION:=libs
  32. CATEGORY:=Libraries
  33. TITLE:=libwebsockets
  34. DEPENDS:=+zlib +libcap
  35. URL:=https://libwebsockets.org
  36. MAINTAINER:=Karl Palsson <karlp@etactica.com>
  37. PROVIDES:= libwebsockets
  38. endef
  39. define Package/libwebsockets-openssl
  40. $(call Package/libwebsockets/Default)
  41. TITLE += (OpenSSL)
  42. DEPENDS += +libopenssl
  43. VARIANT:=openssl
  44. endef
  45. define Package/libwebsockets-mbedtls
  46. $(call Package/$(PKG_NAME)/Default)
  47. TITLE += (mbedTLS)
  48. DEPENDS += +libmbedtls
  49. VARIANT:=mbedtls
  50. endef
  51. define Package/libwebsockets-full
  52. $(call Package/libwebsockets/Default)
  53. TITLE += (Full - OpenSSL, libuv, plugins, CGI)
  54. DEPENDS += +libopenssl +libuv
  55. VARIANT:=full
  56. endef
  57. ifeq ($(BUILD_VARIANT),openssl)
  58. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  59. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  60. endif
  61. ifeq ($(BUILD_VARIANT),mbedtls)
  62. CMAKE_OPTIONS += -DLWS_WITH_MBEDTLS=1
  63. endif
  64. ifeq ($(BUILD_VARIANT),full)
  65. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  66. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  67. CMAKE_OPTIONS += -DLWS_WITH_LIBUV=ON
  68. CMAKE_OPTIONS += -DLWS_WITH_PLUGINS=ON
  69. CMAKE_OPTIONS += -DLWS_WITH_SERVER_STATUS=ON
  70. CMAKE_OPTIONS += -DLWS_WITH_ACCESS_LOG=ON
  71. CMAKE_OPTIONS += -DLWS_WITH_CGI=ON
  72. CMAKE_OPTIONS += -DLWS_UNIX_SOCK=ON
  73. endif
  74. define Package/libwebsockets/install
  75. $(INSTALL_DIR) $(1)/usr/lib
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
  77. endef
  78. Package/libwebsockets-mbedtls/install = $(Package/libwebsockets/install)
  79. Package/libwebsockets-openssl/install = $(Package/libwebsockets/install)
  80. define Package/libwebsockets-full/install
  81. $(call Package/libwebsockets/install,$(1))
  82. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets-evlib_uv.so* $(1)/usr/lib
  83. endef
  84. $(eval $(call BuildPackage,libwebsockets-openssl))
  85. $(eval $(call BuildPackage,libwebsockets-mbedtls))
  86. $(eval $(call BuildPackage,libwebsockets-full))