aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatioupi <Matioupi@users.noreply.github.com>2020-11-16 18:49:38 +0100
committerGitHub <noreply@github.com>2020-11-16 09:49:38 -0800
commit838574a4e6dfb26c956a043f50ed27b04d7e4e31 (patch)
treeaea27c57f563ed2fb5daa2639b0ed3ab098cda9c
parent5dc53211caedebf4387d590155ed53ee44161f10 (diff)
downloadvcpkg-838574a4e6dfb26c956a043f50ed27b04d7e4e31.tar.gz
vcpkg-838574a4e6dfb26c956a043f50ed27b04d7e4e31.zip
[baseline][libarchive] : regression fix (#14579)
* Fix regression cf. https://github.com/microsoft/vcpkg/issues/14567 introduced with commit https://github.com/microsoft/vcpkg/commit/5dc53211caedebf4387d590155ed53ee44161f10 * Changes as suggested in https://github.com/microsoft/vcpkg/pull/14579#discussion_r523812601 and following * Change as suggested in https://github.com/microsoft/vcpkg/pull/14579#discussion_r523809876 * [cmake] Fix dependency zstd * [cmake] Revert d14f917bd2c099575d2b5e57bfe8005ffa3d3506 * [libarchive] Fix cmake wrapper, add usage * Manual merge of https://github.com/microsoft/vcpkg/pull/14579/commits/fa887c48f10da9db4a3a3f9e7a0b186866711ea9 Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
-rw-r--r--ports/libarchive/CONTROL2
-rw-r--r--ports/libarchive/fix-dependencies.patch15
-rw-r--r--ports/libarchive/portfile.cmake1
-rw-r--r--ports/libarchive/usage5
-rw-r--r--ports/libarchive/vcpkg-cmake-wrapper.cmake14
5 files changed, 24 insertions, 13 deletions
diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL
index db28e8dd3..e15f1da44 100644
--- a/ports/libarchive/CONTROL
+++ b/ports/libarchive/CONTROL
@@ -1,6 +1,6 @@
Source: libarchive
Version: 3.4.3
-Port-Version: 1
+Port-Version: 2
Homepage: https://github.com/libarchive/libarchive
Description: Library for reading and writing streaming archives
Build-Depends: zlib
diff --git a/ports/libarchive/fix-dependencies.patch b/ports/libarchive/fix-dependencies.patch
index a04f10fbf..0d3213c67 100644
--- a/ports/libarchive/fix-dependencies.patch
+++ b/ports/libarchive/fix-dependencies.patch
@@ -42,7 +42,7 @@ index 39b5333..8164d8f 100644
ELSE(LIBLZMA_FOUND)
# LZMA not found and will not be used.
ENDIF(LIBLZMA_FOUND)
-@@ -555,22 +543,14 @@ IF(ENABLE_LZ4)
+@@ -555,22 +543,15 @@ IF(ENABLE_LZ4)
SET(LZ4_FIND_QUIETLY TRUE)
ENDIF (LZ4_INCLUDE_DIR)
@@ -56,6 +56,7 @@ index 39b5333..8164d8f 100644
ENDIF(ENABLE_LZ4)
-IF(LZ4_FOUND)
+IF(lz4_FOUND)
++ SET(HAVE_LZ4HC_H 1)
SET(HAVE_LIBLZ4 1)
SET(HAVE_LZ4_H 1)
- CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
@@ -68,7 +69,7 @@ index 39b5333..8164d8f 100644
#
# TODO: test for static library.
#
-@@ -586,25 +566,14 @@ IF(ENABLE_ZSTD)
+@@ -586,25 +566,20 @@ IF(ENABLE_ZSTD)
SET(ZSTD_FIND_QUIETLY TRUE)
ENDIF (ZSTD_INCLUDE_DIR)
@@ -93,8 +94,14 @@ index 39b5333..8164d8f 100644
- # TODO: test for static library.
- #
- CMAKE_POP_CHECK_STATE()
-+ LIST(APPEND ADDITIONAL_LIBS libzstd)
-+ SET(CMAKE_REQUIRED_LIBRARIES libzstd)
++ SET(HAVE_LIBZSTD 1)
++ IF(TARGET zstd::libzstd_shared)
++ LIST(APPEND ADDITIONAL_LIBS zstd::libzstd_shared)
++ SET(CMAKE_REQUIRED_LIBRARIES zstd::libzstd_shared)
++ ELSE(TARGET zstd::libzstd_shared)
++ LIST(APPEND ADDITIONAL_LIBS zstd::libzstd_static)
++ SET(CMAKE_REQUIRED_LIBRARIES zstd::libzstd_static)
++ ENDIF(TARGET zstd::libzstd_shared)
ENDIF(ZSTD_FOUND)
MARK_AS_ADVANCED(CLEAR ZSTD_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR ZSTD_LIBRARY)
diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake
index d275081cc..df7b6ce77 100644
--- a/ports/libarchive/portfile.cmake
+++ b/ports/libarchive/portfile.cmake
@@ -83,4 +83,5 @@ foreach(HEADER ${CURRENT_PACKAGES_DIR}/include/archive.h ${CURRENT_PACKAGES_DIR}
file(WRITE ${HEADER} "${CONTENTS}")
endforeach()
+file(INSTALL ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/libarchive/usage b/ports/libarchive/usage
new file mode 100644
index 000000000..57f9f2ba2
--- /dev/null
+++ b/ports/libarchive/usage
@@ -0,0 +1,5 @@
+The package libarchive is compatible with built-in CMake targets:
+
+ find_package(libarchive REQUIRED)
+ target_include_directories(main PRIVATE ${LibArchive_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE ${LibArchive_LIBRARIES})
diff --git a/ports/libarchive/vcpkg-cmake-wrapper.cmake b/ports/libarchive/vcpkg-cmake-wrapper.cmake
index 5e7838137..006dde98d 100644
--- a/ports/libarchive/vcpkg-cmake-wrapper.cmake
+++ b/ports/libarchive/vcpkg-cmake-wrapper.cmake
@@ -32,14 +32,12 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
endif()
endif()
if(@ENABLE_ZSTD@)
- find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd zstd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH)
- find_library(ZSTD_LIBRARY_RELEASE NAMES zstd NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
- if(ZSTD_LIBRARY_RELEASE)
- list(APPEND LibArchive_LIBRARIES optimized ${ZSTD_LIBRARY_RELEASE})
- endif()
- if(ZSTD_LIBRARY_DEBUG)
- list(APPEND LibArchive_LIBRARIES debug ${ZSTD_LIBRARY_DEBUG})
- endif()
+ find_package(zstd CONFIG REQUIRED)
+ if(TARGET zstd::libzstd_shared)
+ list(APPEND LibArchive_LIBRARIES zstd::libzstd_shared)
+ else(TARGET zstd::libzstd_shared)
+ list(APPEND LibArchive_LIBRARIES zstd::libzstd_static)
+ endif(TARGET zstd::libzstd_shared)
endif()
if(@ENABLE_OPENSSL@)
find_package(OpenSSL REQUIRED)