aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)