Add qt5network (#1057)

* Add qt5network

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Try to fix qt5network

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

Co-authored-by: ruki <waruqi@gmail.com>
pull/1064/head
Jérôme Leclercq 3 years ago committed by GitHub
parent acc4aedb80
commit a373319a2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/o/openssl/xmake.lua
  2. 41
      packages/q/qt5network/xmake.lua

@ -3,7 +3,7 @@ package("openssl")
set_homepage("https://www.openssl.org/")
set_description("A robust, commercial-grade, and full-featured toolkit for TLS and SSL.")
add_urls("https://github.com/openssl/openssl/archive/OpenSSL_$(version).zip", {version = function (version)
add_urls("https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_$(version).zip", {version = function (version)
return version:gsub("%.", "_")
end, excludes = "*/fuzz/*"})
add_versions("1.1.1m", "dab2287910427d82674618d512ba2571401539ca6ed12ab3c3143a0db9fad542")

@ -0,0 +1,41 @@
package("qt5network")
set_base("qt5lib")
set_kind("library")
on_load(function (package)
package:add("deps", "qt5core", {debug = package:is_debug(), version = package:version_str()})
package:data_set("libname", "Network")
if package:is_plat("linux") then
-- we need system openssl with evp-kdf
-- @see https://github.com/xmake-io/xmake-repo/pull/1057#issuecomment-1069006866
if linuxos.name() == "fedora" then
package:add("deps", "openssl", {system = true})
else
package:add("deps", "openssl")
end
elseif package:is_plat("iphoneos") then
package:data_set("frameworks", {"GSS", "IOKit", "Security", "SystemConfiguration"})
end
package:base():script("load")(package)
package:set("kind", "library")
end)
on_test(function (package)
local cxflags
if not package:is_plat("windows") then
cxflags = "-fPIC"
end
assert(package:check_cxxsnippets({test = [[
int test(int argc, char** argv) {
QCoreApplication app(argc, argv);
QByteArray datagram = "Hello from xmake!";
QUdpSocket udpSocket;
udpSocket.writeDatagram(datagram, QHostAddress::Broadcast, 45454);
return app.exec();
}
]]}, {configs = {languages = "c++14", cxflags = cxflags}, includes = {"QCoreApplication", "QByteArray", "QUdpSocket"}}))
end)
Loading…
Cancel
Save