Skip to content

Commit

Permalink
[libtins] no absolute paths (#21697)
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort authored Nov 30, 2021
1 parent e873f77 commit c5a60d4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
21 changes: 13 additions & 8 deletions ports/libtins/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,31 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore
set(ENABLE_PCAP TRUE)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DLIBTINS_BUILD_SHARED=${LIBTINS_BUILD_SHARED}
-DLIBTINS_ENABLE_PCAP=${ENABLE_PCAP}
-DLIBTINS_ENABLE_CXX11=1
)

vcpkg_install_cmake()
vcpkg_cmake_install()

if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") #Windows
vcpkg_fixup_cmake_targets(CONFIG_PATH CMake)
vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
else() #Linux/Unix/Darwin
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libtins)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libtins)
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/libtins/libtinsConfig.cmake" "set(LIBTINS_INCLUDE_DIRS \"${SOURCE_PATH}/include\")" [[
get_filename_component(LIBTINS_CMAKE_DIR "${LIBTINS_CMAKE_DIR}" PATH)
get_filename_component(LIBTINS_CMAKE_DIR "${LIBTINS_CMAKE_DIR}" PATH)
set(LIBTINS_INCLUDE_DIRS "${LIBTINS_CMAKE_DIR}/include")
]])

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

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

vcpkg_fixup_pkgconfig()
10 changes: 9 additions & 1 deletion ports/libtins/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"name": "libtins",
"version-string": "4.3",
"port-version": 2,
"port-version": 3,
"description": "High-level, multiplatform C++ network packet sniffing and crafting library",
"dependencies": [
"boost-any",
"boost-icl",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "winpcap",
"platform": "windows"
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3958,7 +3958,7 @@
},
"libtins": {
"baseline": "4.3",
"port-version": 2
"port-version": 3
},
"libtomcrypt": {
"baseline": "1.18.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libtins.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "909dcc117f47579bc754369cd0a7a9d5a66b23bc",
"version-string": "4.3",
"port-version": 3
},
{
"git-tree": "b853d9ee6a83bba8f0d0b6e568b664b9729aadea",
"version-string": "4.3",
Expand Down

0 comments on commit c5a60d4

Please sign in to comment.