mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 18:13:01 +08:00
[libzip] bump to 1.4.0
Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>
This commit is contained in:
parent
91f447631d
commit
f04a4aee91
@ -1,4 +1,4 @@
|
||||
Source: libzip
|
||||
Version: 1.3.2
|
||||
Version: 1.4.0
|
||||
Build-Depends: zlib
|
||||
Description: A library for reading, creating, and modifying zip archives.
|
||||
|
19
ports/libzip/cmake_dont_build_more_than_needed.patch
Normal file
19
ports/libzip/cmake_dont_build_more_than_needed.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 69cdb8b..4c985fb 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -149,10 +149,10 @@ ENABLE_TESTING()
|
||||
|
||||
# Targets
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
-ADD_SUBDIRECTORY(man)
|
||||
-ADD_SUBDIRECTORY(src)
|
||||
-ADD_SUBDIRECTORY(regress)
|
||||
-ADD_SUBDIRECTORY(examples)
|
||||
+#ADD_SUBDIRECTORY(man)
|
||||
+#ADD_SUBDIRECTORY(src)
|
||||
+#ADD_SUBDIRECTORY(regress)
|
||||
+#ADD_SUBDIRECTORY(examples)
|
||||
|
||||
# pkgconfig file
|
||||
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
@ -1,77 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index deceb65..1283013 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -113,6 +113,15 @@ ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
|
||||
ADD_DEFINITIONS("-D_CRT_NONSTDC_NO_DEPRECATE")
|
||||
ENDIF(MSVC)
|
||||
|
||||
+OPTION(ENABLE_STATIC "Enable static builds" OFF)
|
||||
+IF(ENABLE_STATIC)
|
||||
+ set(BUILD_SHARED_LIBS OFF)
|
||||
+ set(ZIP_EXTERN_OVERRIDE ON)
|
||||
+ set(ZIP_EXTERN ON)
|
||||
+ELSE(ENABLE_STATIC)
|
||||
+ set(BUILD_SHARED_LIBS ON)
|
||||
+ENDIF(ENABLE_STATIC)
|
||||
+
|
||||
ADD_DEFINITIONS("-DHAVE_CONFIG_H")
|
||||
|
||||
# rpath handling: use rpath in installed binaries
|
||||
@@ -121,10 +130,10 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
# Targets
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
-ADD_SUBDIRECTORY(man)
|
||||
-ADD_SUBDIRECTORY(src)
|
||||
-ADD_SUBDIRECTORY(regress)
|
||||
-ADD_SUBDIRECTORY(examples)
|
||||
+# ADD_SUBDIRECTORY(man)
|
||||
+# ADD_SUBDIRECTORY(src)
|
||||
+# ADD_SUBDIRECTORY(regress)
|
||||
+# ADD_SUBDIRECTORY(examples)
|
||||
|
||||
# pkgconfig file
|
||||
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
diff --git a/cmake-config.h.in b/cmake-config.h.in
|
||||
index 0d1839c..dd450ff 100644
|
||||
--- a/cmake-config.h.in
|
||||
+++ b/cmake-config.h.in
|
||||
@@ -60,7 +60,7 @@
|
||||
#cmakedefine WORDS_BIGENDIAN
|
||||
/* END DEFINES */
|
||||
#define PACKAGE "@PACKAGE@"
|
||||
-#define VERSION "@VERSION@"
|
||||
+#define LIBZIP_VERSION "@VERSION@"
|
||||
|
||||
#ifndef HAVE_SSIZE_T_LIBZIP
|
||||
# if SIZE_T_LIBZIP == INT_LIBZIP
|
||||
diff --git a/cmake-zipconf.h.in b/cmake-zipconf.h.in
|
||||
index 6a276f6..410c898 100644
|
||||
--- a/cmake-zipconf.h.in
|
||||
+++ b/cmake-zipconf.h.in
|
||||
@@ -118,4 +118,10 @@ typedef unsigned long long zip_uint64_t;
|
||||
#define ZIP_INT64_MAX 0x7fffffffffffffffLL
|
||||
#define ZIP_UINT64_MAX 0xffffffffffffffffULL
|
||||
|
||||
+#cmakedefine ZIP_EXTERN_OVERRIDE
|
||||
+#ifdef ZIP_EXTERN_OVERRIDE
|
||||
+#undef ZIP_EXTERN
|
||||
+#cmakedefine ZIP_EXTERN
|
||||
+#endif
|
||||
+
|
||||
#endif /* zipconf.h */
|
||||
diff --git a/lib/compat.h b/lib/compat.h
|
||||
index 625c84e..8943587 100644
|
||||
--- a/lib/compat.h
|
||||
+++ b/lib/compat.h
|
||||
@@ -42,7 +42,9 @@
|
||||
#define __STDC_LIMIT_MACROS
|
||||
|
||||
#ifdef _WIN32
|
||||
+#ifndef ZIP_EXTERN_OVERRIDE
|
||||
#define ZIP_EXTERN __declspec(dllexport)
|
||||
+#endif
|
||||
/* for dup(), close(), etc. */
|
||||
#include <io.h>
|
||||
#endif
|
12
ports/libzip/fix-attribute.patch
Normal file
12
ports/libzip/fix-attribute.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/lib/zip_algorithm_bzip2.c b/lib/zip_algorithm_bzip2.c
|
||||
index 1748fd4..fd74503 100644
|
||||
--- a/lib/zip_algorithm_bzip2.c
|
||||
+++ b/lib/zip_algorithm_bzip2.c
|
||||
@@ -270,6 +270,6 @@ zip_compression_algorithm_t zip_algorithm_bzip2_decompress = {
|
||||
|
||||
#else
|
||||
|
||||
-static int dummy __attribute__((used));
|
||||
+static int dummy;
|
||||
|
||||
#endif /* HAVE_LIBBZ2 */
|
@ -1,34 +1,27 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzip-1.3.2)
|
||||
vcpkg_download_distfile(ARCHIVE_FILE
|
||||
URLS "https://nih.at/libzip/libzip-1.3.2.tar.gz"
|
||||
FILENAME "libzip-1.3.2.tar.gz"
|
||||
SHA512 75b7e6f541be30e721275723f264c20f9a3be5335d954b5909acdddb0f6dd9b2420166904c9b88206692a57a4aa54e4fe8ed4d62c1f4b900aebf6ad40f767376
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO nih-at/libzip
|
||||
REF rel-1-4-0
|
||||
SHA512 3d8c5e64c567d2b91670ea041228d74cc8415116dfeb5c9bcf587ab817618eace668c5171122eeccf2a5f25242c2439c5f60b361f99a06274ab58aea720fe0bb
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
||||
|
||||
# Patch cmake and configuration to allow static builds
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/enable-static.patch"
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/cmake_dont_build_more_than_needed.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/fix-attribute.patch"
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS -DENABLE_STATIC=OFF
|
||||
)
|
||||
else()
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS -DENABLE_STATIC=ON
|
||||
)
|
||||
endif()
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
# Move zipconf.h to include and remove include directories from lib
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libzip/include/zipconf.h ${CURRENT_PACKAGES_DIR}/include/zipconf.h)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/libzip ${CURRENT_PACKAGES_DIR}/debug/lib/libzip)
|
||||
|
||||
# Remove debug include
|
||||
|
Loading…
Reference in New Issue
Block a user