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.

107 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.2.1
  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:=842da21f73ccba2be59e680de10a8cce7928313048750eb6ad73b6fa50763c51
  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. CMAKE_OPTIONS += -DLWS_WITH_ULOOP=ON
  25. # turn off all test apps
  26. CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=ON
  27. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_SERVER=ON
  28. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON
  29. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_PING=ON
  30. CMAKE_OPTIONS += -DLWS_WITHOUT_TEST_CLIENT=ON
  31. define Package/libwebsockets/Default
  32. SECTION:=libs
  33. CATEGORY:=Libraries
  34. TITLE:=libwebsockets
  35. DEPENDS:=+zlib +libcap
  36. URL:=https://libwebsockets.org
  37. MAINTAINER:=Karl Palsson <karlp@etactica.com>
  38. PROVIDES:= libwebsockets
  39. endef
  40. define Package/libwebsockets-openssl
  41. $(call Package/libwebsockets/Default)
  42. TITLE += (OpenSSL)
  43. DEPENDS += +libopenssl
  44. VARIANT:=openssl
  45. endef
  46. define Package/libwebsockets-mbedtls
  47. $(call Package/$(PKG_NAME)/Default)
  48. TITLE += (mbedTLS)
  49. DEPENDS += +libmbedtls
  50. VARIANT:=mbedtls
  51. endef
  52. define Package/libwebsockets-full
  53. $(call Package/libwebsockets/Default)
  54. TITLE += (Full - OpenSSL, libuv, plugins, CGI)
  55. DEPENDS += +libopenssl +libuv
  56. VARIANT:=full
  57. endef
  58. ifeq ($(BUILD_VARIANT),openssl)
  59. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  60. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  61. endif
  62. ifeq ($(BUILD_VARIANT),mbedtls)
  63. CMAKE_OPTIONS += -DLWS_WITH_MBEDTLS=1
  64. endif
  65. ifeq ($(BUILD_VARIANT),full)
  66. CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
  67. CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
  68. CMAKE_OPTIONS += -DLWS_WITH_LIBUV=ON
  69. CMAKE_OPTIONS += -DLWS_WITH_PLUGINS=ON
  70. CMAKE_OPTIONS += -DLWS_WITH_SERVER_STATUS=ON
  71. CMAKE_OPTIONS += -DLWS_WITH_ACCESS_LOG=ON
  72. CMAKE_OPTIONS += -DLWS_WITH_CGI=ON
  73. CMAKE_OPTIONS += -DLWS_UNIX_SOCK=ON
  74. endif
  75. define Package/libwebsockets/install
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
  78. endef
  79. Package/libwebsockets-mbedtls/install = $(Package/libwebsockets/install)
  80. Package/libwebsockets-openssl/install = $(Package/libwebsockets/install)
  81. define Package/libwebsockets-full/install
  82. $(call Package/libwebsockets/install,$(1))
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets-evlib_uv.so* $(1)/usr/lib
  84. endef
  85. $(eval $(call BuildPackage,libwebsockets-openssl))
  86. $(eval $(call BuildPackage,libwebsockets-mbedtls))
  87. $(eval $(call BuildPackage,libwebsockets-full))