Skip to content

Commit

Permalink
[luasec] new port (#17957)
Browse files Browse the repository at this point in the history
* Add port for luasec

* Mark luasec:x64-windows-static as fail

* Set versions for luasec
  • Loading branch information
TheCycoONE committed Jun 9, 2021
1 parent c867e68 commit 17378cf
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
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)

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)
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 @@ -863,6 +863,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 @@ -3812,6 +3812,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
}
]
}

0 comments on commit 17378cf

Please sign in to comment.