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.

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