Skip to content

Commit

Permalink
[luasec] bump version and add unix
Browse files Browse the repository at this point in the history
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:
lunarmodules/luasocket#346
  • Loading branch information
TheCycoONE committed Mar 10, 2024
1 parent 0719a71 commit b2046d4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
18 changes: 13 additions & 5 deletions ports/luasec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions ports/luasec/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions ports/luasec/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "luasec",
"version": "1.3.1",
"version": "1.3.2",
"maintainers": "Stephen Baker <[email protected]>",
"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",
Expand Down

0 comments on commit b2046d4

Please sign in to comment.