2022-05-03 09:18:47 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=lua-eco
|
|
|
|
PKG_VERSION:=1.0.0
|
2022-10-03 17:03:15 +00:00
|
|
|
PKG_RELEASE:=4
|
2022-05-03 09:18:47 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL=https://github.com/zhaojh329/lua-eco/releases/download/v$(PKG_VERSION)
|
|
|
|
PKG_HASH:=d9fd04acb4bd64f47a3a3e6a8d30ee1d0860221c5798ca528cf52260470b4155
|
|
|
|
|
|
|
|
PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
|
|
|
|
PKG_LICENSE:=MIT
|
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
|
|
|
|
lua-eco: rework SSL library dependency & selection
Currently, lua-eco will add dependencies to all SSL libraries that are
selected, even though it will only use one of them. That means that the
package downloaded from the regular repository will install OpenSSL,
wolfSSL and mbedTLS, even though it will only use OpenSSL.
Fix that by adding a built option so that the default can be changed at
build-time. To maintain the author's intention, a default symbol is
computed based on what libraries are being built into the image, or just
selected as a module. Originally, the order or preference was OpenSSL,
wolfSSL, then mbedTLS.
One change was made to the original order: if OpenSSL and wolfSSL are
both selected as module, and mbedTLS is not built into the image,
wolfSSL will be preferred over OpenSSL. This is being done to keep the
package consistent with OpenWRT's selection of wolfSSL as the default
SSL library. If they are both included in the image, then OpenSSL will
be preferred.
The order of preference is:
1. If at least one library is included in the image, use the first of
OpenSSL, wolfSSL, and mbedTLS that is included in the image.
2. If at least one library is selected, but none included in the image,
prefer wolfSSL, then OpenSSL, then mbedTLS.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-08 13:04:33 +00:00
|
|
|
PKG_CONFIG_DEPENDS:= \
|
|
|
|
LUA_ECO_OPENSSL \
|
|
|
|
LUA_ECO_WOLFSSL \
|
|
|
|
LUA_ECO_MBEDTLS
|
|
|
|
|
2022-05-03 09:18:47 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
include $(INCLUDE_DIR)/cmake.mk
|
|
|
|
|
|
|
|
define Package/lua-eco
|
|
|
|
TITLE:=A Lua coroutine library
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
|
|
|
SUBMENU:=Lua
|
|
|
|
URL:=https://github.com/zhaojh329/lua-eco
|
|
|
|
DEPENDS:=+libev
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-eco/description
|
|
|
|
Lua-eco is a Lua coroutine library which was implemented based on IO event.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-eco/Module
|
|
|
|
TITLE:=$1 support for lua-eco
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
|
|
|
SUBMENU:=Lua
|
|
|
|
URL:=https://github.com/zhaojh329/lua-eco
|
|
|
|
DEPENDS:=+lua-eco $2
|
|
|
|
endef
|
|
|
|
|
|
|
|
Package/lua-eco-log=$(call Package/lua-eco/Module,Log utils)
|
|
|
|
Package/lua-eco-sys=$(call Package/lua-eco/Module,System utils)
|
|
|
|
Package/lua-eco-dns=$(call Package/lua-eco/Module,DNS)
|
|
|
|
Package/lua-eco-socket=$(call Package/lua-eco/Module,Socket)
|
|
|
|
Package/lua-eco-ssl=$(call Package/lua-eco/Module,SSL,\
|
|
|
|
@(PACKAGE_libopenssl||PACKAGE_libwolfssl||PACKAGE_libmbedtls) \
|
lua-eco: rework SSL library dependency & selection
Currently, lua-eco will add dependencies to all SSL libraries that are
selected, even though it will only use one of them. That means that the
package downloaded from the regular repository will install OpenSSL,
wolfSSL and mbedTLS, even though it will only use OpenSSL.
Fix that by adding a built option so that the default can be changed at
build-time. To maintain the author's intention, a default symbol is
computed based on what libraries are being built into the image, or just
selected as a module. Originally, the order or preference was OpenSSL,
wolfSSL, then mbedTLS.
One change was made to the original order: if OpenSSL and wolfSSL are
both selected as module, and mbedTLS is not built into the image,
wolfSSL will be preferred over OpenSSL. This is being done to keep the
package consistent with OpenWRT's selection of wolfSSL as the default
SSL library. If they are both included in the image, then OpenSSL will
be preferred.
The order of preference is:
1. If at least one library is included in the image, use the first of
OpenSSL, wolfSSL, and mbedTLS that is included in the image.
2. If at least one library is selected, but none included in the image,
prefer wolfSSL, then OpenSSL, then mbedTLS.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-08 13:04:33 +00:00
|
|
|
LUA_ECO_OPENSSL:libopenssl LUA_ECO_WOLFSSL:libwolfssl \
|
|
|
|
LUA_ECO_MBEDTLS:libmbedtls +LUA_ECO_MBEDTLS:zlib)
|
2022-05-03 09:18:47 +00:00
|
|
|
Package/lua-eco-iw=$(call Package/lua-eco/Module,IW utils,+libmnl)
|
|
|
|
Package/lua-eco-ip=$(call Package/lua-eco/Module,IP utils,+libmnl)
|
|
|
|
Package/lua-eco-file=$(call Package/lua-eco/Module,File utils)
|
|
|
|
Package/lua-eco-ubus=$(call Package/lua-eco/Module,Ubus,+libubus)
|
|
|
|
|
lua-eco: rework SSL library dependency & selection
Currently, lua-eco will add dependencies to all SSL libraries that are
selected, even though it will only use one of them. That means that the
package downloaded from the regular repository will install OpenSSL,
wolfSSL and mbedTLS, even though it will only use OpenSSL.
Fix that by adding a built option so that the default can be changed at
build-time. To maintain the author's intention, a default symbol is
computed based on what libraries are being built into the image, or just
selected as a module. Originally, the order or preference was OpenSSL,
wolfSSL, then mbedTLS.
One change was made to the original order: if OpenSSL and wolfSSL are
both selected as module, and mbedTLS is not built into the image,
wolfSSL will be preferred over OpenSSL. This is being done to keep the
package consistent with OpenWRT's selection of wolfSSL as the default
SSL library. If they are both included in the image, then OpenSSL will
be preferred.
The order of preference is:
1. If at least one library is included in the image, use the first of
OpenSSL, wolfSSL, and mbedTLS that is included in the image.
2. If at least one library is selected, but none included in the image,
prefer wolfSSL, then OpenSSL, then mbedTLS.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-08 13:04:33 +00:00
|
|
|
define Package/lua-eco-ssl/config
|
|
|
|
config LUA_ECO_DEFAULT_WOLFSSL
|
|
|
|
bool
|
|
|
|
default y if PACKAGE_libopenssl != y && \
|
2022-08-08 13:30:56 +00:00
|
|
|
(PACKAGE_libwolfssl >= PACKAGE_libopenssl || \
|
|
|
|
PACKAGE_libwolfsslcpu-crypto >= PACKAGE_libopenssl) && \
|
|
|
|
(PACKAGE_libwolfssl >= PACKAGE_libmbedtls || \
|
|
|
|
PACKAGE_libwolfsslcpu-crypto >= PACKAGE_libmbedtls)
|
lua-eco: rework SSL library dependency & selection
Currently, lua-eco will add dependencies to all SSL libraries that are
selected, even though it will only use one of them. That means that the
package downloaded from the regular repository will install OpenSSL,
wolfSSL and mbedTLS, even though it will only use OpenSSL.
Fix that by adding a built option so that the default can be changed at
build-time. To maintain the author's intention, a default symbol is
computed based on what libraries are being built into the image, or just
selected as a module. Originally, the order or preference was OpenSSL,
wolfSSL, then mbedTLS.
One change was made to the original order: if OpenSSL and wolfSSL are
both selected as module, and mbedTLS is not built into the image,
wolfSSL will be preferred over OpenSSL. This is being done to keep the
package consistent with OpenWRT's selection of wolfSSL as the default
SSL library. If they are both included in the image, then OpenSSL will
be preferred.
The order of preference is:
1. If at least one library is included in the image, use the first of
OpenSSL, wolfSSL, and mbedTLS that is included in the image.
2. If at least one library is selected, but none included in the image,
prefer wolfSSL, then OpenSSL, then mbedTLS.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-08 13:04:33 +00:00
|
|
|
|
|
|
|
config LUA_ECO_DEFAULT_OPENSSL
|
|
|
|
bool
|
|
|
|
default y if !LUA_ECO_DEFAULT_WOLFSSL && \
|
|
|
|
PACKAGE_libopenssl >= PACKAGE_libmbedtls
|
|
|
|
|
|
|
|
config LUA_ECO_DEFAULT_MBEDTLS
|
|
|
|
bool
|
|
|
|
default y if !LUA_ECO_DEFAULT_WOLFSSL && \
|
|
|
|
!LUA_ECO_DEFAULT_OPENSSL
|
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "SSL Library"
|
|
|
|
default LUA_ECO_OPENSSL if LUA_ECO_DEFAULT_OPENSSL
|
|
|
|
default LUA_ECO_WOLFSSL if LUA_ECO_DEFAULT_WOLFSSL
|
|
|
|
default LUA_ECO_MBEDTLS if LUA_ECO_DEFAULT_MBEDTLS
|
|
|
|
config LUA_ECO_OPENSSL
|
|
|
|
bool "OpenSSL"
|
|
|
|
depends on PACKAGE_libopenssl
|
|
|
|
config LUA_ECO_WOLFSSL
|
|
|
|
bool "wolfSSL"
|
2022-08-08 13:30:56 +00:00
|
|
|
depends on PACKAGE_libwolfssl || PACKAGE_libwolfsslcpu-crypto
|
lua-eco: rework SSL library dependency & selection
Currently, lua-eco will add dependencies to all SSL libraries that are
selected, even though it will only use one of them. That means that the
package downloaded from the regular repository will install OpenSSL,
wolfSSL and mbedTLS, even though it will only use OpenSSL.
Fix that by adding a built option so that the default can be changed at
build-time. To maintain the author's intention, a default symbol is
computed based on what libraries are being built into the image, or just
selected as a module. Originally, the order or preference was OpenSSL,
wolfSSL, then mbedTLS.
One change was made to the original order: if OpenSSL and wolfSSL are
both selected as module, and mbedTLS is not built into the image,
wolfSSL will be preferred over OpenSSL. This is being done to keep the
package consistent with OpenWRT's selection of wolfSSL as the default
SSL library. If they are both included in the image, then OpenSSL will
be preferred.
The order of preference is:
1. If at least one library is included in the image, use the first of
OpenSSL, wolfSSL, and mbedTLS that is included in the image.
2. If at least one library is selected, but none included in the image,
prefer wolfSSL, then OpenSSL, then mbedTLS.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-08 13:04:33 +00:00
|
|
|
config LUA_ECO_MBEDTLS
|
|
|
|
bool "mbedTLS"
|
|
|
|
depends on PACKAGE_libmbedtls
|
|
|
|
endchoice
|
|
|
|
endef
|
|
|
|
|
2022-05-03 09:18:47 +00:00
|
|
|
CMAKE_OPTIONS += \
|
|
|
|
-DECO_LOG_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-log),N,FF) \
|
|
|
|
-DECO_SYS_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-sys),N,FF) \
|
|
|
|
-DECO_DNS_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-dns),N,FF) \
|
|
|
|
-DECO_SOCKET_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-socket),N,FF) \
|
|
|
|
-DECO_IW_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-iw),N,FF) \
|
|
|
|
-DECO_IP_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-ip),N,FF) \
|
|
|
|
-DECO_FILE_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-file),N,FF) \
|
|
|
|
-DECO_UBUS_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-ubus),N,FF) \
|
|
|
|
-DECO_SSL_SUPPORT=O$(if $(CONFIG_PACKAGE_lua-eco-ssl),N,FF)
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_PACKAGE_lua-eco-ssl),)
|
lua-eco: rework SSL library dependency & selection
Currently, lua-eco will add dependencies to all SSL libraries that are
selected, even though it will only use one of them. That means that the
package downloaded from the regular repository will install OpenSSL,
wolfSSL and mbedTLS, even though it will only use OpenSSL.
Fix that by adding a built option so that the default can be changed at
build-time. To maintain the author's intention, a default symbol is
computed based on what libraries are being built into the image, or just
selected as a module. Originally, the order or preference was OpenSSL,
wolfSSL, then mbedTLS.
One change was made to the original order: if OpenSSL and wolfSSL are
both selected as module, and mbedTLS is not built into the image,
wolfSSL will be preferred over OpenSSL. This is being done to keep the
package consistent with OpenWRT's selection of wolfSSL as the default
SSL library. If they are both included in the image, then OpenSSL will
be preferred.
The order of preference is:
1. If at least one library is included in the image, use the first of
OpenSSL, wolfSSL, and mbedTLS that is included in the image.
2. If at least one library is selected, but none included in the image,
prefer wolfSSL, then OpenSSL, then mbedTLS.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-08 13:04:33 +00:00
|
|
|
ifneq ($(CONFIG_LUA_ECO_OPENSSL),)
|
2022-05-03 09:18:47 +00:00
|
|
|
CMAKE_OPTIONS += -DUSE_OPENSSL=ON
|
lua-eco: rework SSL library dependency & selection
Currently, lua-eco will add dependencies to all SSL libraries that are
selected, even though it will only use one of them. That means that the
package downloaded from the regular repository will install OpenSSL,
wolfSSL and mbedTLS, even though it will only use OpenSSL.
Fix that by adding a built option so that the default can be changed at
build-time. To maintain the author's intention, a default symbol is
computed based on what libraries are being built into the image, or just
selected as a module. Originally, the order or preference was OpenSSL,
wolfSSL, then mbedTLS.
One change was made to the original order: if OpenSSL and wolfSSL are
both selected as module, and mbedTLS is not built into the image,
wolfSSL will be preferred over OpenSSL. This is being done to keep the
package consistent with OpenWRT's selection of wolfSSL as the default
SSL library. If they are both included in the image, then OpenSSL will
be preferred.
The order of preference is:
1. If at least one library is included in the image, use the first of
OpenSSL, wolfSSL, and mbedTLS that is included in the image.
2. If at least one library is selected, but none included in the image,
prefer wolfSSL, then OpenSSL, then mbedTLS.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-08 13:04:33 +00:00
|
|
|
else ifneq ($(CONFIG_LUA_ECO_WOLFSSL),)
|
|
|
|
CMAKE_OPTIONS += -DUSE_WOLFSSL=ON
|
|
|
|
else ifneq ($(CONFIG_LUA_ECO_MBEDTLS),)
|
|
|
|
CMAKE_OPTIONS += -DUSE_MBEDTLS=ON
|
2022-05-03 09:18:47 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
define Package/lua-eco/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/lua
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/eco.so $(1)/usr/lib/lua
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/lua-eco/Module/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/lua/eco
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$2.so $(1)/usr/lib/lua/eco
|
|
|
|
endef
|
|
|
|
|
|
|
|
Package/lua-eco-log/install=$(call Package/lua-eco/Module/install,$1,log)
|
|
|
|
Package/lua-eco-sys/install=$(call Package/lua-eco/Module/install,$1,sys)
|
|
|
|
Package/lua-eco-dns/install=$(call Package/lua-eco/Module/install,$1,dns)
|
|
|
|
Package/lua-eco-socket/install=$(call Package/lua-eco/Module/install,$1,socket)
|
|
|
|
Package/lua-eco-ssl/install=$(call Package/lua-eco/Module/install,$1,ssl)
|
|
|
|
Package/lua-eco-iw/install=$(call Package/lua-eco/Module/install,$1,iw)
|
|
|
|
Package/lua-eco-ip/install=$(call Package/lua-eco/Module/install,$1,ip)
|
|
|
|
Package/lua-eco-file/install=$(call Package/lua-eco/Module/install,$1,file)
|
|
|
|
Package/lua-eco-ubus/install=$(call Package/lua-eco/Module/install,$1,ubus)
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,lua-eco))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-log))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-sys))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-dns))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-socket))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-ssl))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-iw))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-ip))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-file))
|
|
|
|
$(eval $(call BuildPackage,lua-eco-ubus))
|