mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 00:19:06 +08:00
[libpcap] Fix pkgconfig libs and include path (#9426)
* [libpcap] Fix pkgconfig libs and include path * [libpcap] use vcpkg_fixup_pkgconfig instead of homegrown * Update ports/libpcap/portfile.cmake * Update ports/libpcap/CONTROL * Update ports/libpcap/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
This commit is contained in:
parent
8bd2b60f4e
commit
9574e60a26
12
ports/libpcap/0001-fix-package-name.patch
Normal file
12
ports/libpcap/0001-fix-package-name.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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")
|
@ -1,4 +1,5 @@
|
|||||||
Source: libpcap
|
Source: libpcap
|
||||||
Version: 1.9.1
|
Version: 1.9.1-1
|
||||||
Description: A portable C/C++ library for network traffic capture
|
Description: A portable C/C++ library for network traffic capture
|
||||||
Homepage: https://www.tcpdump.org/
|
Homepage: https://www.tcpdump.org/
|
||||||
|
Supports: linux
|
||||||
|
@ -7,6 +7,8 @@ message(
|
|||||||
These can be installed on Ubuntu systems via sudo apt install flex libbison-dev"
|
These can be installed on Ubuntu systems via sudo apt install flex libbison-dev"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
vcpkg_download_distfile(
|
vcpkg_download_distfile(
|
||||||
SOURCE_ARCHIVE_PATH
|
SOURCE_ARCHIVE_PATH
|
||||||
URLS http://www.tcpdump.org/release/libpcap-1.9.1.tar.gz
|
URLS http://www.tcpdump.org/release/libpcap-1.9.1.tar.gz
|
||||||
@ -18,6 +20,8 @@ vcpkg_extract_source_archive_ex(
|
|||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
ARCHIVE ${SOURCE_ARCHIVE_PATH}
|
ARCHIVE ${SOURCE_ARCHIVE_PATH}
|
||||||
REF 1.9.1
|
REF 1.9.1
|
||||||
|
PATCHES
|
||||||
|
0001-fix-package-name.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_configure_cmake(
|
vcpkg_configure_cmake(
|
||||||
@ -32,18 +36,12 @@ vcpkg_configure_cmake(
|
|||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_install_cmake()
|
vcpkg_install_cmake()
|
||||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpcap RENAME copyright)
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||||
|
|
||||||
|
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)
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||||
endif()
|
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)
|
||||||
|
|
||||||
file(READ ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcap.pc LIBPCAP_PC)
|
|
||||||
string(REGEX REPLACE \($|\n\)prefix=[^\n]+ \\1prefix=\"${CURRENT_INSTALLED_DIR}\" LIBPCAP_PC_FIXED "${LIBPCAP_PC}")
|
|
||||||
file(WRITE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcap.pc "${LIBPCAP_PC_FIXED}")
|
|
||||||
|
|
||||||
file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcap.pc DEBUG_LIBPCAP_PC)
|
|
||||||
string(REGEX REPLACE \($|\n\)prefix=[^\n]+ \\1prefix=\"${CURRENT_INSTALLED_DIR}/debug\" DEBUG_LIBPCAP_PC_FIXED "${DEBUG_LIBPCAP_PC}")
|
|
||||||
file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcap.pc "${DEBUG_LIBPCAP_PC_FIXED}")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user