diff options
| author | NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> | 2021-09-08 22:45:37 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-08 07:45:37 -0700 |
| commit | 5b2ac1fed8943460726163946ed13154ab81c9ea (patch) | |
| tree | 74f1d106b76b152ac6dd7bc9f4b29b198e4f93e1 /ports/libpcap | |
| parent | 615547c1d5b363d3586d2012c4cd7d075a0516b8 (diff) | |
| download | vcpkg-5b2ac1fed8943460726163946ed13154ab81c9ea.tar.gz vcpkg-5b2ac1fed8943460726163946ed13154ab81c9ea.zip | |
[libhsplasma/libpcap/lv2/libcrafter] Update to the latest version (#19965)
* [libhsplasma/libpcap/lv2] Update to the latest version
* [libpcap] Remove unused comments
* Update version files
* [lv2] Fix usage
[libpcap] Update ci.baseline.txt
* [libhsplasma] Remove x64-windows-static=fail from ci.baseline.txt
* [libcrafter] Update to 1.0
* [libcrafter] Add vcpkg.json
* Update version files
* Add CRT check for libpcap and update version as versin-semver for libpcap
* Update version files
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Diffstat (limited to 'ports/libpcap')
| -rw-r--r-- | ports/libpcap/0001-fix-package-name.patch | 12 | ||||
| -rw-r--r-- | ports/libpcap/CONTROL | 5 | ||||
| -rw-r--r-- | ports/libpcap/add-disable-packet-option.patch | 48 | ||||
| -rw-r--r-- | ports/libpcap/install-pc-on-msvc.patch | 104 | ||||
| -rw-r--r-- | ports/libpcap/portfile.cmake | 77 | ||||
| -rw-r--r-- | ports/libpcap/vcpkg.json | 13 |
6 files changed, 84 insertions, 175 deletions
diff --git a/ports/libpcap/0001-fix-package-name.patch b/ports/libpcap/0001-fix-package-name.patch deleted file mode 100644 index cd1deeed2..000000000 --- a/ports/libpcap/0001-fix-package-name.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 55b93f1..f4f9d51 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2358,7 +2358,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION include) - # On UN*X, and on Windows when not using MSVC, generate libpcap.pc and - # pcap-config and process man pages and arrange that they be installed. - if(NOT MSVC) -- set(PACKAGE_NAME ${LIBRARY_NAME}) - set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix "\${prefix}") - set(includedir "\${prefix}/include") diff --git a/ports/libpcap/CONTROL b/ports/libpcap/CONTROL deleted file mode 100644 index d96e55895..000000000 --- a/ports/libpcap/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: libpcap -Version: 1.9.1-2 -Description: A portable C/C++ library for network traffic capture -Homepage: https://www.tcpdump.org/ -Supports: !(arm64|uwp|osx) diff --git a/ports/libpcap/add-disable-packet-option.patch b/ports/libpcap/add-disable-packet-option.patch index 842176a55..9d89a5505 100644 --- a/ports/libpcap/add-disable-packet-option.patch +++ b/ports/libpcap/add-disable-packet-option.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 3fe9979..23783d3 100644
+index 2f675d1..e9d6d96 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -161,6 +161,7 @@ set(SEPTEL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../septel" CACHE PATH "Path to dire
+@@ -244,6 +244,7 @@ set(SEPTEL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../septel" CACHE PATH "Path to dire
option(DISABLE_SNF "Disable Myricom SNF support" OFF)
option(DISABLE_TC "Disable Riverbed TurboCap support" OFF)
@@ -10,38 +10,22 @@ index 3fe9979..23783d3 100644 #
# Debugging options.
-@@ -220,19 +221,21 @@ if(WIN32)
+@@ -302,7 +303,7 @@ if(WIN32)
+ if(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common)
include_directories(${CMAKE_HOME_DIRECTORY}/../../Common)
endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common)
-
-- find_package(Packet)
-- if(PACKET_FOUND)
-- set(HAVE_PACKET32 TRUE)
-- include_directories(${PACKET_INCLUDE_DIRS})
-- #
-- # Check whether we have the NPcap PacketIsLoopbackAdapter()
-- # function.
-- #
-- cmake_push_check_state()
-- set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES})
-- check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER)
-- cmake_pop_check_state()
-- endif(PACKET_FOUND)
+-
+ if(NOT DISABLE_PACKET)
-+ find_package(Packet)
-+ if(PACKET_FOUND)
-+ set(HAVE_PACKET32 TRUE)
-+ include_directories(${PACKET_INCLUDE_DIRS})
-+ #
-+ # Check whether we have the NPcap PacketIsLoopbackAdapter()
-+ # function.
-+ #
-+ cmake_push_check_state()
-+ set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES})
-+ check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER)
-+ cmake_pop_check_state()
-+ endif(PACKET_FOUND)
+ find_package(Packet)
+ if(PACKET_FOUND)
+ set(HAVE_PACKET32 TRUE)
+@@ -317,7 +318,8 @@ if(WIN32)
+ check_function_exists(PacketGetTimestampModes HAVE_PACKET_GET_TIMESTAMP_MODES)
+ cmake_pop_check_state()
+ endif(PACKET_FOUND)
+-
+ endif()
-
++
message(STATUS "checking for Npcap's version.h")
- check_symbol_exists(WINPCAP_PRODUCT_NAME "../../version.h" HAVE_VERSION_H)
+ check_symbol_exists(WINPCAP_PRODUCT_NAME "${CMAKE_SOURCE_DIR}/../../version.h" HAVE_VERSION_H)
+ if(HAVE_VERSION_H)
diff --git a/ports/libpcap/install-pc-on-msvc.patch b/ports/libpcap/install-pc-on-msvc.patch index f2cd64b44..6dd18f202 100644 --- a/ports/libpcap/install-pc-on-msvc.patch +++ b/ports/libpcap/install-pc-on-msvc.patch @@ -1,97 +1,37 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 55b93f1..3fe9979 100644
+index b83fbbd..2f675d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -2355,48 +2355,54 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include)
+@@ -2678,9 +2678,12 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-bpf.h DESTINATION include)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION include)
-# On UN*X, and on Windows when not using MSVC, generate libpcap.pc and
+-# pcap-config and process man pages and arrange that they be installed.
+-if(NOT MSVC)
+# Generate libpcap.pc
+if(BUILD_SHARED_LIBS)
+ set(PACKAGE_NAME ${LIBRARY_NAME})
+else()
+ set(PACKAGE_NAME pcap)
+endif()
-+set(prefix ${CMAKE_INSTALL_PREFIX})
-+set(exec_prefix "\${prefix}")
-+set(includedir "\${prefix}/include")
-+set(libdir "\${exec_prefix}/lib")
-+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
-+ CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
-+ CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
-+ CMAKE_SYSTEM_NAME STREQUAL "DragonFly BSD" OR
-+ CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
-+ CMAKE_SYSTEM_NAME STREQUAL "OSF1")
-+ #
-+ # Platforms where the linker is the GNU linker
-+ # or accepts command-line arguments like
-+ # those the GNU linker accepts.
-+ #
-+ set(V_RPATH_OPT "-Wl,-rpath,")
-+elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*")
-+ #
-+ # SunOS 5.x.
-+ #
-+ # XXX - this assumes GCC is using the Sun linker,
-+ # rather than the GNU linker.
-+ #
-+ set(V_RPATH_OPT "-Wl,-R,")
-+else()
-+ #
-+ # No option needed to set the RPATH.
-+ #
-+ set(V_RPATH_OPT "")
-+endif()
-+set(LIBS "")
-+foreach(LIB ${PCAP_LINK_LIBRARIES})
-+ set(LIBS "${LIBS} -l${LIB}")
-+endforeach(LIB)
-+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY)
-+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig)
-+
-+# On UN*X, and on Windows when not using MSVC, generate
- # pcap-config and process man pages and arrange that they be installed.
- if(NOT MSVC)
-- set(prefix ${CMAKE_INSTALL_PREFIX})
-- set(exec_prefix "\${prefix}")
-- set(includedir "\${prefix}/include")
-- set(libdir "\${exec_prefix}/lib")
-- if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
-- CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
-- CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
-- CMAKE_SYSTEM_NAME STREQUAL "DragonFly BSD" OR
-- CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
-- CMAKE_SYSTEM_NAME STREQUAL "OSF1")
-- #
-- # Platforms where the linker is the GNU linker
-- # or accepts command-line arguments like
-- # those the GNU linker accepts.
-- #
-- set(V_RPATH_OPT "-Wl,-rpath,")
-- elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*")
-- #
-- # SunOS 5.x.
-- #
-- # XXX - this assumes GCC is using the Sun linker,
-- # rather than the GNU linker.
-- #
-- set(V_RPATH_OPT "-Wl,-R,")
-- else()
-- #
-- # No option needed to set the RPATH.
-- #
-- set(V_RPATH_OPT "")
-- endif()
-- set(LIBS "")
-- foreach(LIB ${PCAP_LINK_LIBRARIES})
-- set(LIBS "${LIBS} -l${LIB}")
-- endforeach(LIB)
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY)
-- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY)
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin)
-- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig)
--
+ set(prefix ${CMAKE_INSTALL_PREFIX})
+ set(exec_prefix "\${prefix}")
+ set(includedir "\${prefix}/include")
+@@ -2715,10 +2718,14 @@ if(NOT MSVC)
+ foreach(LIB ${PCAP_LINK_LIBRARIES})
+ set(LIBS "${LIBS} -l${LIB}")
+ endforeach(LIB)
+- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY)
+- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig)
++
++# On UN*X, and on Windows when not using MSVC, generate libpcap.pc and
++# pcap-config and process man pages and arrange that they be installed.
++if(NOT MSVC)
++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY)
++ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin)
+
#
# Man pages.
- #
diff --git a/ports/libpcap/portfile.cmake b/ports/libpcap/portfile.cmake index ab2540482..9fef5379d 100644 --- a/ports/libpcap/portfile.cmake +++ b/ports/libpcap/portfile.cmake @@ -1,10 +1,10 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports x64-windows, x86-windows and Linux" ON_TARGET "UWP" "OSX" ON_ARCH "arm64") +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() -if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") +if(VCPKG_TARGET_IS_LINUX) message( "libpcap currently requires the following libraries from the system package manager: flex @@ -13,30 +13,19 @@ These can be installed on Ubuntu systems via sudo apt install flex libbison-dev" ) endif() -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") -vcpkg_download_distfile( - SOURCE_ARCHIVE_PATH - URLS http://www.tcpdump.org/release/libpcap-1.9.1.tar.gz - FILENAME libpcap-1.9.1.tar.gz - SHA512 ae0d6b0ad8253e7e059336c0f4ed3850d20d7d2f4dc1d942c2951f99a5443a690f0cc42c6f8fdc4a0ccb19e9e985192ba6f399c4bde2c7076e420f547fddfb08 -) - -vcpkg_extract_source_archive_ex( +vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${SOURCE_ARCHIVE_PATH} - REF 1.9.1 + REPO the-tcpdump-group/libpcap + REF c7642e2cc0c5bd65754685b160d25dc23c76c6bd #1.10.1 + SHA512 ed46095863aaee79ca2833d26438f6c837cc3e64acb73efd5a388a11ff7d0d1245d23e5404070a9f2c2c77840c93c09328746761e4481e9a530593a5cbf2ad6f + HEAD_REF master PATCHES - 0001-fix-package-name.patch install-pc-on-msvc.patch add-disable-packet-option.patch ) -# Only dynamic builds are currently supported on Windows -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) -endif() - vcpkg_find_acquire_program(BISON) get_filename_component(BISON_PATH ${BISON} DIRECTORY) vcpkg_add_to_path(${BISON_PATH}) @@ -44,11 +33,11 @@ vcpkg_find_acquire_program(FLEX) get_filename_component(FLEX_PATH ${FLEX} DIRECTORY) vcpkg_add_to_path(${FLEX_PATH}) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" USE_STATIC_RT) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS - -DDISABLE_USB=ON -DDISABLE_NETMAP=ON -DDISABLE_BLUETOOTH=ON -DDISABLE_DBUS=ON @@ -59,37 +48,37 @@ vcpkg_configure_cmake( -DDISABLE_TC=ON -DDISABLE_PACKET=ON -DENABLE_REMOTE=OFF + -DUSE_STATIC_RT=${USE_STATIC_RT} ) -vcpkg_install_cmake() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_cmake_install() +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -# On Windows 64-bit, libpcap 1.9.1 installs the libraries in a amd64 subdirectory of the usual directories +# On Windows 64-bit, libpcap 1.10.1 installs the libraries in a x64 subdirectory of the usual directories if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(libsubdir "amd64") - file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/lib/${libsubdir}/*) - file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/debug/lib/${libsubdir}/*) - file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/bin/${libsubdir}/*) - file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(GLOB_RECURSE FILES_TO_MOVE ${CURRENT_PACKAGES_DIR}/debug/bin/${libsubdir}/*) - file(COPY ${FILES_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/${libsubdir} - ${CURRENT_PACKAGES_DIR}/debug/lib/${libsubdir} - ${CURRENT_PACKAGES_DIR}/bin/${libsubdir} - ${CURRENT_PACKAGES_DIR}/debug/bin/${libsubdir}) + set(libsubdir "x64") + file(GLOB_RECURSE FILES_TO_MOVE "${CURRENT_PACKAGES_DIR}/lib/${libsubdir}/*") + file(COPY ${FILES_TO_MOVE} DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + file(GLOB_RECURSE FILES_TO_MOVE "${CURRENT_PACKAGES_DIR}/debug/lib/${libsubdir}/*") + file(COPY ${FILES_TO_MOVE} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") + file(GLOB_RECURSE FILES_TO_MOVE "${CURRENT_PACKAGES_DIR}/bin/${libsubdir}/*") + file(COPY ${FILES_TO_MOVE} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + file(GLOB_RECURSE FILES_TO_MOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${libsubdir}/*") + file(COPY ${FILES_TO_MOVE} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/${libsubdir}" + "${CURRENT_PACKAGES_DIR}/debug/lib/${libsubdir}" + "${CURRENT_PACKAGES_DIR}/bin/${libsubdir}" + "${CURRENT_PACKAGES_DIR}/debug/bin/${libsubdir}") 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) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/pcap_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/pcap_static.lib) + file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pcap_static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/pcap_static.lib") endif() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES ws2_32) +vcpkg_fixup_pkgconfig() if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + 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) - +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/man")
\ No newline at end of file diff --git a/ports/libpcap/vcpkg.json b/ports/libpcap/vcpkg.json new file mode 100644 index 000000000..56e2a86ae --- /dev/null +++ b/ports/libpcap/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "libpcap", + "version-semver": "1.10.1", + "description": "A portable C/C++ library for network traffic capture", + "homepage": "https://www.tcpdump.org/", + "supports": "!(uwp | osx)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |
