Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[luasec] new port #17957

Merged
merged 3 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions ports/luasec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.20.0)
project(luasec)

find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua)
find_library(LUA_LIBRARY lua)
find_package(OpenSSL)

set(LUASEC_INCLUDES ${LUA_INCLUDE_DIR} src)
set(LUASEC_LIBRARIES
${LUA_LIBRARY}
OpenSSL::SSL
OpenSSL::Crypto
OpenSSL::applink
ws2_32)

add_library(lua-ssl
src/config.c
src/ssl.c
src/context.c
src/x509.c
src/ec.c
src/options.c
src/luasocket/buffer.c
src/luasocket/io.c
src/luasocket/timeout.c
src/luasocket/wsocket.c)

target_include_directories(lua-ssl PRIVATE ${LUASEC_INCLUDES})
target_link_libraries(lua-ssl PRIVATE ${LUASEC_LIBRARIES})
set_target_properties(lua-ssl PROPERTIES PREFIX "")

install(TARGETS lua-ssl
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

install(FILES src/ssl.lua DESTINATION share/lua)
install(FILES src/https.lua DESTINATION share/lua/ssl)
33 changes: 33 additions & 0 deletions ports/luasec/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
set(LUASEC_REVISION v1.0.1)
set(LUASEC_HASH 21ae200e40f13a35eebca95cdac25ae13532a3008b2f9ec97a079033b9efde69e81954354453623eb77340368f482d3c69adb26881a6c0d7c4897df31301af93)

TheCycoONE marked this conversation as resolved.
Show resolved Hide resolved
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO brunoos/luasec
REF ${LUASEC_REVISION}
SHA512 ${LUASEC_HASH}
HEAD_REF master
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)

vcpkg_install_cmake()
vcpkg_copy_pdbs()

# Remove debug share
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

# Allow empty include directory
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions ports/luasec/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "luasec",
"version": "1.0.1",
"maintainers": "Stephen Baker <baker.stephen.e@gmail.com>",
"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",
"dependencies": [
"lua",
"luasocket",
"openssl"
]
}
1 change: 1 addition & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ luajit:x64-windows = skip
luajit:x64-windows-static = skip
luajit:x64-windows-static-md=skip
luajit:x86-windows = skip
luasec:x64-windows-static=fail
luasocket:x64-linux=fail
luasocket:x64-osx=fail
lzfse:arm-uwp=fail
Expand Down
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3796,6 +3796,10 @@
"baseline": "2.0.5-3",
"port-version": 0
},
"luasec": {
"baseline": "1.0.1",
"port-version": 0
},
"luasocket": {
"baseline": "2020-09-14",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/luasec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "2529ee34af0b23fb576f0e8ed672ceba83c4c305",
"version": "1.0.1",
"port-version": 0
}
]
}