diff --git a/ports/libpcap/portfile.cmake b/ports/libpcap/portfile.cmake index 9fef5379d0..4d1823bcb5 100644 --- a/ports/libpcap/portfile.cmake +++ b/ports/libpcap/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_fail_port_install(ON_TARGET "UWP" "OSX") - if(EXISTS "${CURRENT_INSTALLED_DIR}/share/winpcap") message(FATAL_ERROR "FATAL ERROR: winpcap and libpcap are incompatible.") endif() @@ -13,8 +11,6 @@ These can be installed on Ubuntu systems via sudo apt install flex libbison-dev" ) endif() -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO the-tcpdump-group/libpcap @@ -72,13 +68,13 @@ if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") endif() # Even if compiled with BUILD_SHARED_LIBS=ON, pcap also install a pcap_static library -if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pcap_static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/pcap_static.lib") endif() vcpkg_fixup_pkgconfig() -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/man") \ No newline at end of file +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/man") diff --git a/ports/libpcap/vcpkg.json b/ports/libpcap/vcpkg.json index 56e2a86ae0..166a8ce90f 100644 --- a/ports/libpcap/vcpkg.json +++ b/ports/libpcap/vcpkg.json @@ -1,9 +1,10 @@ { "name": "libpcap", "version-semver": "1.10.1", + "port-version": 1, "description": "A portable C/C++ library for network traffic capture", "homepage": "https://www.tcpdump.org/", - "supports": "!(uwp | osx)", + "supports": "!uwp", "dependencies": [ { "name": "vcpkg-cmake", diff --git a/ports/libtins/find-pcap_static.patch b/ports/libtins/find-pcap_static.patch new file mode 100644 index 0000000000..7134b0c2b4 --- /dev/null +++ b/ports/libtins/find-pcap_static.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake +index 388b30b..f5264c3 100644 +--- a/cmake/Modules/FindPCAP.cmake ++++ b/cmake/Modules/FindPCAP.cmake +@@ -38,7 +38,7 @@ if (${CMAKE_SIZEOF_VOID_P} EQUAL 8 AND WIN32) + endif () + + find_library(PCAP_LIBRARY +- NAMES pcap wpcap ++ NAMES pcap wpcap pcap_static NAMES_PER_DIR + HINTS ${HINT_DIR} + ) + diff --git a/ports/libtins/fix-source-writes.patch b/ports/libtins/fix-source-writes.patch new file mode 100644 index 0000000000..251b4f2f77 --- /dev/null +++ b/ports/libtins/fix-source-writes.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1e13def..eda8d68 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -228,8 +228,9 @@ ENDIF(DOXYGEN_FOUND) + # Configuration file + CONFIGURE_FILE( + "${PROJECT_SOURCE_DIR}/include/tins/config.h.in" +- "${PROJECT_SOURCE_DIR}/include/tins/config.h" ++ "${PROJECT_BINARY_DIR}/include/tins/config.h" + ) ++INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/include") + + IF (NOT CMAKE_INSTALL_LIBDIR) + SET(CMAKE_INSTALL_LIBDIR lib) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e07772e..94bc8bf 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -82,7 +82,7 @@ set(HEADERS + ${LIBTINS_INCLUDE_DIR}/tins/handshake_capturer.h + ${LIBTINS_INCLUDE_DIR}/tins/stp.h + ${LIBTINS_INCLUDE_DIR}/tins/pppoe.h +- ${LIBTINS_INCLUDE_DIR}/tins/config.h ++ ${PROJECT_BINARY_DIR}/include/tins/config.h + ${LIBTINS_INCLUDE_DIR}/tins/constants.h + ${LIBTINS_INCLUDE_DIR}/tins/crypto.h + ${LIBTINS_INCLUDE_DIR}/tins/cxxstd.h +@@ -229,6 +229,7 @@ MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST) + FOREACH(HEADER ${HEADERS}) + # Extract directory name and remove leading '../' + get_filename_component(DIR ${HEADER} PATH) ++ string(REPLACE "${PROJECT_BINARY_DIR}/" "" DIR ${DIR}) + STRING(REGEX REPLACE "^\\.\\.\\/" "" DIR ${DIR}) + INSTALL(FILES ${HEADER} DESTINATION ${DIR}) + ENDFOREACH(HEADER) diff --git a/ports/libtins/portfile.cmake b/ports/libtins/portfile.cmake index 37bd4d915e..5c1d6781b5 100644 --- a/ports/libtins/portfile.cmake +++ b/ports/libtins/portfile.cmake @@ -4,28 +4,27 @@ vcpkg_from_github( REF v4.3 SHA512 29d606004fe9a440c9a53eede42fd5c6dbd049677d2cca2c5cfd26311ee2ca4c64ca3e665fbc81efd5bfab5577a5181ed0754c617e139317d9ae0cabba05aff7 HEAD_REF master + PATCHES + fix-source-writes.patch + find-pcap_static.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIBTINS_BUILD_SHARED) -set(ENABLE_PCAP FALSE) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(ENABLE_PCAP TRUE) -endif() - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DLIBTINS_BUILD_SHARED=${LIBTINS_BUILD_SHARED} - -DLIBTINS_ENABLE_PCAP=${ENABLE_PCAP} -DLIBTINS_ENABLE_CXX11=1 + -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=1 ) vcpkg_cmake_install() +vcpkg_fixup_pkgconfig() -if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") #Windows +if(VCPKG_TARGET_IS_WINDOWS) vcpkg_cmake_config_fixup(CONFIG_PATH CMake) -else() #Linux/Unix/Darwin +else() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libtins) endif() @@ -39,5 +38,3 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") # Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libtins" RENAME copyright) - -vcpkg_fixup_pkgconfig() diff --git a/ports/libtins/vcpkg.json b/ports/libtins/vcpkg.json index 94000ec097..d7871cb21e 100644 --- a/ports/libtins/vcpkg.json +++ b/ports/libtins/vcpkg.json @@ -1,11 +1,14 @@ { "name": "libtins", - "version-string": "4.3", - "port-version": 3, + "version": "4.3", + "port-version": 4, "description": "High-level, multiplatform C++ network packet sniffing and crafting library", + "supports": "!uwp", "dependencies": [ "boost-any", "boost-icl", + "libpcap", + "openssl", { "name": "vcpkg-cmake", "host": true @@ -13,10 +16,6 @@ { "name": "vcpkg-cmake-config", "host": true - }, - { - "name": "winpcap", - "platform": "windows" } ] } diff --git a/versions/baseline.json b/versions/baseline.json index 17fa3f8d41..877a6be0f4 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3766,7 +3766,7 @@ }, "libpcap": { "baseline": "1.10.1", - "port-version": 0 + "port-version": 1 }, "libpff": { "baseline": "2018-07-14", @@ -3962,7 +3962,7 @@ }, "libtins": { "baseline": "4.3", - "port-version": 3 + "port-version": 4 }, "libtomcrypt": { "baseline": "1.18.2", diff --git a/versions/l-/libpcap.json b/versions/l-/libpcap.json index 4d97a37413..5322e122c2 100644 --- a/versions/l-/libpcap.json +++ b/versions/l-/libpcap.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4a0a395c4b517e9a54e1b96327b1ac90e317c225", + "version-semver": "1.10.1", + "port-version": 1 + }, { "git-tree": "5fb18d1935c9d7db3a7ff158e2aba95d5a9c6cd2", "version-semver": "1.10.1", diff --git a/versions/l-/libtins.json b/versions/l-/libtins.json index 12dfce5951..176027fc69 100644 --- a/versions/l-/libtins.json +++ b/versions/l-/libtins.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "de1a1dc51c90ca57412fe5f8d57eeef42a41ec74", + "version": "4.3", + "port-version": 4 + }, { "git-tree": "909dcc117f47579bc754369cd0a7a9d5a66b23bc", "version-string": "4.3",