From b2046d47f928d1153a29ad72af6e289e76f12210 Mon Sep 17 00:00:00 2001 From: "Stephen E. Baker" Date: Sun, 10 Mar 2024 16:06:46 -0400 Subject: [PATCH] [luasec] bump version and add unix Static linking cannot work on any platform due to the conflict with luasocket. There is a PR against luasocket that would resolve the situation but it has not been merged in a number of years: https://github.com/lunarmodules/luasocket/pull/346 --- ports/luasec/CMakeLists.txt | 18 +++++++++++++----- ports/luasec/portfile.cmake | 8 +++----- ports/luasec/vcpkg.json | 4 ++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ports/luasec/CMakeLists.txt b/ports/luasec/CMakeLists.txt index 386af144077248..6432cef0f9a5c1 100644 --- a/ports/luasec/CMakeLists.txt +++ b/ports/luasec/CMakeLists.txt @@ -10,8 +10,10 @@ set(LUASEC_LIBRARIES ${LUA_LIBRARY} OpenSSL::SSL OpenSSL::Crypto - OpenSSL::applink - ws2_32) + OpenSSL::applink) +if(WIN32) + set(PLATFORM_LIBRARIES ws2_32) +endif() add_library(lua-ssl src/config.c @@ -22,11 +24,17 @@ add_library(lua-ssl src/options.c src/luasocket/buffer.c src/luasocket/io.c - src/luasocket/timeout.c - src/luasocket/wsocket.c) + src/luasocket/timeout.c) +if(WIN32) + target_sources(lua-ssl PRIVATE + src/luasocket/wsocket.c) +else() + target_sources(lua-ssl PRIVATE + src/luasocket/usocket.c) +endif() target_include_directories(lua-ssl PRIVATE ${LUASEC_INCLUDES}) -target_link_libraries(lua-ssl PRIVATE ${LUASEC_LIBRARIES}) +target_link_libraries(lua-ssl PRIVATE ${LUASEC_LIBRARIES} ${PLATFORM_LIBRARIES}) set_target_properties(lua-ssl PROPERTIES PREFIX "") install(TARGETS lua-ssl diff --git a/ports/luasec/portfile.cmake b/ports/luasec/portfile.cmake index ced0899615310e..1912c202512fce 100644 --- a/ports/luasec/portfile.cmake +++ b/ports/luasec/portfile.cmake @@ -1,13 +1,11 @@ set(LUASEC_REVISION "v${VERSION}") -set(LUASEC_HASH cfa4187518445abc6591bd0c24924122b62252be25ffd5564cf291f9a2ae3702a5fa299ffd265d2e0e8315b90d6783eccace4ff560f54f299161d3c5e3749508) +set(LUASEC_HASH 8f0c4b5ff87c024685b23770e1d342467554b8dc19a1704076e184d9e84b966f171091c31d1da135ab009e850275adc2bf2720fc9f32c83ac23f0a42f13d311f) -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) -endif() +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO brunoos/luasec + REPO lunarmodules/luasec REF ${LUASEC_REVISION} SHA512 ${LUASEC_HASH} HEAD_REF master diff --git a/ports/luasec/vcpkg.json b/ports/luasec/vcpkg.json index 25b94e81563286..f6da8b516fb127 100644 --- a/ports/luasec/vcpkg.json +++ b/ports/luasec/vcpkg.json @@ -1,11 +1,11 @@ { "name": "luasec", - "version": "1.3.1", + "version": "1.3.2", "maintainers": "Stephen Baker ", "description": "LuaSec depends on OpenSSL, and integrates with LuaSocket to make it easy to add secure connections to any Lua applications or scripts.", "homepage": "https://github.com/brunoos/luasec", "license": "MIT", - "supports": "!(windows & static)", + "supports": "!static", "dependencies": [ "lua", "luasocket",