[vlc-commits] [Git][videolan/vlc][master] contrib: update libarchive to 3.7.0

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Jul 19 12:39:47 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
fa419f41 by Steve Lhomme at 2023-07-19T11:56:51+00:00
contrib: update libarchive to 3.7.0

It contains all the patches we had.

Changelog: https://github.com/libarchive/libarchive/releases/tag/v3.7.0

New features:

*  bsdunzip: new tool ported from FreeBSD)
* drop-in replacement for Info-ZIP unzip, not yet ported for Windows
* 7zip reader: support for Zstandard compression
* 7zip reader: support for ARM64 filter
* zstd filter: support for multi-frame zstd archives

Other notable bugfixes and improvements:

* pax: fix year 2038 problem on platforms with 64-bit time_t
* Windows: Universal Windows Platform (UWP) fixes and improvements
* Windows: bcrypt usage fixes and improvements
* Windows: time function usage fixes and improvements

- - - - -


15 changed files:

- − contrib/src/libarchive/0001-Fix-bcrypt-detection-on-UNIX-cross-compilation.patch
- − contrib/src/libarchive/0001-Fix-build-error-when-cross-compiling-for-Windows.patch
- − contrib/src/libarchive/0001-Fix-compile-on-Android.patch
- − contrib/src/libarchive/0001-Make-single-bit-bitfields-unsigned-to-avoid-clang-16.patch
- − contrib/src/libarchive/0001-Use-CreateHardLinkW-and-CreateSymbolicLinkW-directly.patch
- − contrib/src/libarchive/0001-Use-the-common-CMake-BUILD_SHARED_LIBS-to-build-shar.patch
- − contrib/src/libarchive/0002-Disable-CreateSymbolicLinkW-use-in-UWP-builds.patch
- − contrib/src/libarchive/0003-fix-the-CreateHardLinkW-signature-to-match-the-real-.patch
- − contrib/src/libarchive/0004-Don-t-call-GetOEMCP-in-Universal-Windows-Platform-bu.patch
- − contrib/src/libarchive/0005-tests-use-CreateFileA-for-char-filenames.patch
- − contrib/src/libarchive/0006-Use-CreateFile2-instead-of-CreateFileW-on-Win8-build.patch
- − contrib/src/libarchive/0007-Disable-CreateFileA-calls-in-UWP-builds.patch
- − contrib/src/libarchive/0008-Disable-program-call-with-stdin-stdout-usage-on-UWP-.patch
- contrib/src/libarchive/SHA512SUMS
- contrib/src/libarchive/rules.mak


Changes:

=====================================
contrib/src/libarchive/0001-Fix-bcrypt-detection-on-UNIX-cross-compilation.patch deleted
=====================================
@@ -1,58 +0,0 @@
-From d11155deb2a8ae33f2d0d293721980ae8fa95e6e Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 25 May 2023 11:47:13 +0200
-Subject: [PATCH] Fix bcrypt detection on UNIX cross-compilation
-
-The Windows SDK uses an uppercase on the B, but mingw-w64 doesn't.
-The autoconf detection already uses a lowercase bcrypt.
----
- CMakeLists.txt                        | 4 ++--
- build/cmake/config.h.in               | 2 +-
- contrib/android/config/windows_host.h | 2 +-
- 3 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index dbb95e34..a174fc2c 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -734,9 +734,9 @@ LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H)
- LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H)
- LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
- IF(ENABLE_CNG)
--  LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H)
-+  LA_CHECK_INCLUDE_FILE("bcrypt.h" HAVE_BCRYPT_H)
-   IF(HAVE_BCRYPT_H)
--    LIST(APPEND ADDITIONAL_LIBS "Bcrypt")
-+    LIST(APPEND ADDITIONAL_LIBS "bcrypt")
-   ENDIF(HAVE_BCRYPT_H)
- ELSE(ENABLE_CNG)
-   UNSET(HAVE_BCRYPT_H CACHE)
-diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in
-index ff74f33f..e4ff6969 100644
---- a/build/cmake/config.h.in
-+++ b/build/cmake/config.h.in
-@@ -366,7 +366,7 @@ typedef uint64_t uintmax_t;
- /* Define to 1 if you have the <attr/xattr.h> header file. */
- #cmakedefine HAVE_ATTR_XATTR_H 1
- 
--/* Define to 1 if you have the <Bcrypt.h> header file. */
-+/* Define to 1 if you have the <bcrypt.h> header file. */
- #cmakedefine HAVE_BCRYPT_H 1
- 
- /* Define to 1 if you have the <bsdxml.h> header file. */
-diff --git a/contrib/android/config/windows_host.h b/contrib/android/config/windows_host.h
-index 712b7491..6550e5e8 100644
---- a/contrib/android/config/windows_host.h
-+++ b/contrib/android/config/windows_host.h
-@@ -160,7 +160,7 @@
- /* Define to 1 if you have the <attr/xattr.h> header file. */
- /* #undef HAVE_ATTR_XATTR_H */
- 
--/* Define to 1 if you have the <Bcrypt.h> header file. */
-+/* Define to 1 if you have the <bcrypt.h> header file. */
- #define HAVE_BCRYPT_H
- 
- /* Define to 1 if you have the <bzlib.h> header file. */
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0001-Fix-build-error-when-cross-compiling-for-Windows.patch deleted
=====================================
@@ -1,33 +0,0 @@
-From eaa608e13ea8c3953fc479af65eab863b94b4cd3 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 25 May 2023 11:33:23 +0200
-Subject: [PATCH] Fix build error when cross-compiling for Windows
-
-CHECK_C_SOURCE_RUNS generates a build error when cross-compiling.
-
-ZLIB_WINAPI is the only one tested. When the run test fails, it's tested again
-with just a compilation.
----
- CMakeLists.txt | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index dbb95e34..f0bbfd02 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -370,7 +370,11 @@ MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LIBRARIES
-       IF("${TRY_TYPE}" MATCHES "COMPILES")
-         CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR})
-       ELSEIF("${TRY_TYPE}" MATCHES "RUNS")
--        CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR})
-+        IF(CMAKE_CROSSCOMPILING)
-+          MESSAGE(WARNING "Cannot test run \"${VAR}\" when cross-compiling")
-+        ELSE(CMAKE_CROSSCOMPILING)
-+          CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR})
-+        ENDIF(CMAKE_CROSSCOMPILING)
-       ELSE("${TRY_TYPE}" MATCHES "COMPILES")
-         MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE")
-       ENDIF("${TRY_TYPE}" MATCHES "COMPILES")
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0001-Fix-compile-on-Android.patch deleted
=====================================
@@ -1,28 +0,0 @@
-From 0267cddc89ccd5c8483d2731b50652578ca42d81 Mon Sep 17 00:00:00 2001
-From: BogDan Vatra <bogdan at kde.org>
-Date: Tue, 3 May 2022 13:16:07 +0300
-Subject: [PATCH] Fix compile on Android
-
-Fixes: #890
----
- libarchive/CMakeLists.txt | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt
-index e1d76a51..44895ce3 100644
---- a/libarchive/CMakeLists.txt
-+++ b/libarchive/CMakeLists.txt
-@@ -5,6 +5,10 @@
- #
- ############################################
- 
-+if (ANDROID)
-+  include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include)
-+endif()
-+
- # Public headers
- SET(include_HEADERS
-   archive.h
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0001-Make-single-bit-bitfields-unsigned-to-avoid-clang-16.patch deleted
=====================================
@@ -1,101 +0,0 @@
-From f180dcab3321149ef348e9899737db29eeaaecf0 Mon Sep 17 00:00:00 2001
-From: Dimitry Andric <dimitry at andric.com>
-Date: Tue, 18 Apr 2023 02:59:32 +0200
-Subject: [PATCH] Make single bit bitfields unsigned to avoid clang 16 warning
- (#1860)
-
-Clang 16 introduced a warning about single bit bitfields in structs,
-which is triggered by a few libarchive formats:
-
-libarchive/archive_write_set_format_7zip.c:1541:13: error: implicit
-truncation from 'int' to a one-bit wide bit-field changes value from 1
-to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
-                    file->dir = 1;
-                              ^ ~
-
-This is because single bit bitfields only support values -1 and 0, if
-they are signed.
-
-For bitfields with two or more bits this can be intentional, but single
-bit bitfields are typically used as booleans, so it is better to make
-them unsigned.
----
- libarchive/archive_write_set_format_7zip.c    |  2 +-
- libarchive/archive_write_set_format_iso9660.c | 14 +++++++-------
- libarchive/archive_write_set_format_xar.c     |  4 ++--
- 3 files changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/libarchive/archive_write_set_format_7zip.c b/libarchive/archive_write_set_format_7zip.c
-index d5ca9a66..95fd7164 100644
---- a/libarchive/archive_write_set_format_7zip.c
-+++ b/libarchive/archive_write_set_format_7zip.c
-@@ -165,7 +165,7 @@ struct file {
- 	mode_t			 mode;
- 	uint32_t		 crc32;
- 
--	signed int		 dir:1;
-+	unsigned		 dir:1;
- };
- 
- struct _7zip {
-diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c
-index 197b0ee6..2a3ae07f 100644
---- a/libarchive/archive_write_set_format_iso9660.c
-+++ b/libarchive/archive_write_set_format_iso9660.c
-@@ -289,12 +289,12 @@ struct isoent {
- 		struct extr_rec	*current;
- 	}			 extr_rec_list;
- 
--	signed int		 virtual:1;
-+	unsigned int		 virtual:1;
- 	/* If set to one, this file type is a directory.
- 	 * A convenience flag to be used as
- 	 * "archive_entry_filetype(isoent->file->entry) == AE_IFDIR".
- 	 */
--	signed int		 dir:1;
-+	unsigned int		 dir:1;
- };
- 
- struct hardlink {
-@@ -755,9 +755,9 @@ struct iso9660 {
- 
- 	/* Used for making zisofs. */
- 	struct {
--		signed int	 detect_magic:1;
--		signed int	 making:1;
--		signed int	 allzero:1;
-+		unsigned int	 detect_magic:1;
-+		unsigned int	 making:1;
-+		unsigned int	 allzero:1;
- 		unsigned char	 magic_buffer[64];
- 		int		 magic_cnt;
- 
-@@ -7798,8 +7798,8 @@ struct zisofs_extract {
- 	uint64_t	 pz_uncompressed_size;
- 	size_t		 uncompressed_buffer_size;
- 
--	signed int	 initialized:1;
--	signed int	 header_passed:1;
-+	unsigned int	 initialized:1;
-+	unsigned int	 header_passed:1;
- 
- 	uint32_t	 pz_offset;
- 	unsigned char	*block_pointers;
-diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c
-index 7849062c..7307757d 100644
---- a/libarchive/archive_write_set_format_xar.c
-+++ b/libarchive/archive_write_set_format_xar.c
-@@ -212,8 +212,8 @@ struct file {
- 	struct heap_data	 data;
-         struct archive_string    script;
- 
--	signed int		 virtual:1;
--	signed int		 dir:1;
-+	unsigned int		 virtual:1;
-+	unsigned int		 dir:1;
- };
- 
- struct hardlink {
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0001-Use-CreateHardLinkW-and-CreateSymbolicLinkW-directly.patch deleted
=====================================
@@ -1,81 +0,0 @@
-From 5e0a673c7b4a48238f9afea754872447f1d55830 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 25 May 2023 09:53:49 +0200
-Subject: [PATCH 1/9] Use CreateHardLinkW and CreateSymbolicLinkW directly on
- Vista+ builds
-
-No need to load the kernel library manually. It's always available. It's not
-possible to load it in Universal Windows Platform (UWP) builds anyway.
-
-No need to load the kernel library manually. It's always available. It's not
-possible to load it in Universal Windows Platform (UWP) builds anyway.
----
- libarchive/archive_write_disk_windows.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c
-index 7bed5bd2..8a8c6d00 100644
---- a/libarchive/archive_write_disk_windows.c
-+++ b/libarchive/archive_write_disk_windows.c
-@@ -559,6 +559,7 @@ la_mktemp(struct archive_write_disk *a)
- 	return (fd);
- }
- 
-+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
- static void *
- la_GetFunctionKernel32(const char *name)
- {
-@@ -574,18 +575,24 @@ la_GetFunctionKernel32(const char *name)
- 	}
- 	return (void *)GetProcAddress(lib, name);
- }
-+#endif
- 
- static int
- la_CreateHardLinkW(wchar_t *linkname, wchar_t *target)
- {
- 	static BOOLEAN (WINAPI *f)(LPWSTR, LPWSTR, LPSECURITY_ATTRIBUTES);
--	static int set;
- 	BOOL ret;
- 
-+#if _WIN32_WINNT < _WIN32_WINNT_XP
-+	static int set;
-+/* CreateHardLinkW is available since XP and always loaded */
- 	if (!set) {
- 		set = 1;
- 		f = la_GetFunctionKernel32("CreateHardLinkW");
- 	}
-+#else
-+	f = CreateHardLinkW;
-+#endif
- 	if (!f) {
- 		errno = ENOTSUP;
- 		return (0);
-@@ -624,7 +631,6 @@ static int
- la_CreateSymbolicLinkW(const wchar_t *linkname, const wchar_t *target,
-     int linktype) {
- 	static BOOLEAN (WINAPI *f)(LPCWSTR, LPCWSTR, DWORD);
--	static int set;
- 	wchar_t *ttarget, *p;
- 	size_t len;
- 	DWORD attrs = 0;
-@@ -632,10 +638,16 @@ la_CreateSymbolicLinkW(const wchar_t *linkname, const wchar_t *target,
- 	DWORD newflags = 0;
- 	BOOL ret = 0;
- 
-+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
-+/* CreateSymbolicLinkW is available since Vista and always loaded */
-+	static int set;
- 	if (!set) {
- 		set = 1;
- 		f = la_GetFunctionKernel32("CreateSymbolicLinkW");
- 	}
-+#else
-+	f = CreateSymbolicLinkW;
-+#endif
- 	if (!f)
- 		return (0);
- 
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0001-Use-the-common-CMake-BUILD_SHARED_LIBS-to-build-shar.patch deleted
=====================================
@@ -1,78 +0,0 @@
-From 2c3c9d5fa18a80c948f7b0dba85ee47be7a5f88b Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 25 May 2023 13:56:00 +0200
-Subject: [PATCH] Use the common CMake BUILD_SHARED_LIBS to build shared
- library or not
-
-https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html
-
-Usually it's built-in but make sure we have it on by default.
-
-We don't need to rename the windows static library when it's the only one built.
-This will also allow proper usage of the pkg-config file in this case. Otherwise
-there is no way to select the static library that way.
----
- CMakeLists.txt            |  2 ++
- libarchive/CMakeLists.txt | 22 +++++++++++++++-------
- 2 files changed, 17 insertions(+), 7 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index dbb95e34..9d1b1404 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -199,6 +199,8 @@ ENDIF (MSVC)
- # Enable CTest/CDash support
- include(CTest)
- 
-+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
-+
- OPTION(ENABLE_MBEDTLS "Enable use of mbed TLS" OFF)
- OPTION(ENABLE_NETTLE "Enable use of Nettle" OFF)
- OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
-diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt
-index ff7ade00..f7fdfb68 100644
---- a/libarchive/CMakeLists.txt
-+++ b/libarchive/CMakeLists.txt
-@@ -243,10 +243,12 @@ ELSEIF(ARCHIVE_ACL_SUNOS)
- ENDIF()
- 
- # Libarchive is a shared library
--ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
--TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .)
--TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
--SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
-+IF(BUILD_SHARED_LIBS)
-+  ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
-+  TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .)
-+  TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
-+  SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
-+ENDIF(BUILD_SHARED_LIBS)
- 
- # archive_static is a static library
- ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS})
-@@ -254,13 +256,19 @@ TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS})
- SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS
-   LIBARCHIVE_STATIC)
- # On Posix systems, libarchive.so and libarchive.a can co-exist.
--IF(NOT WIN32 OR CYGWIN)
-+IF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS)
-   SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive)
--ENDIF(NOT WIN32 OR CYGWIN)
-+ENDIF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS)
- 
- IF(ENABLE_INSTALL)
-   # How to install the libraries
--  INSTALL(TARGETS archive archive_static
-+  IF(BUILD_SHARED_LIBS)
-+    INSTALL(TARGETS archive
-+            RUNTIME DESTINATION bin
-+            LIBRARY DESTINATION lib
-+            ARCHIVE DESTINATION lib)
-+  ENDIF(BUILD_SHARED_LIBS)
-+  INSTALL(TARGETS archive_static
-           RUNTIME DESTINATION bin
-           LIBRARY DESTINATION lib
-           ARCHIVE DESTINATION lib)
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0002-Disable-CreateSymbolicLinkW-use-in-UWP-builds.patch deleted
=====================================
@@ -1,30 +0,0 @@
-From 8f390c3eb57ddbf4b1aa9aecd1da35151a0d8636 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 25 May 2023 09:38:30 +0200
-Subject: [PATCH 2/9] Disable CreateSymbolicLinkW use in UWP builds
-
-The call is forbidden:
-https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw#requirements
----
- libarchive/archive_write_disk_windows.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c
-index 8a8c6d00..b42010d4 100644
---- a/libarchive/archive_write_disk_windows.c
-+++ b/libarchive/archive_write_disk_windows.c
-@@ -646,7 +646,11 @@ la_CreateSymbolicLinkW(const wchar_t *linkname, const wchar_t *target,
- 		f = la_GetFunctionKernel32("CreateSymbolicLinkW");
- 	}
- #else
-+# if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
- 	f = CreateSymbolicLinkW;
-+# else
-+	f = NULL;
-+# endif
- #endif
- 	if (!f)
- 		return (0);
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0003-fix-the-CreateHardLinkW-signature-to-match-the-real-.patch deleted
=====================================
@@ -1,27 +0,0 @@
-From 57abf55bba172dfb4301674a75c1f663a70741d0 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Thu, 25 May 2023 10:16:08 +0200
-Subject: [PATCH 3/9] fix the CreateHardLinkW signature to match the real
- function
-
-The `ret` variable was already using BOOL instead of BOOLEAN.
----
- libarchive/archive_write_disk_windows.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c
-index b42010d4..839bc295 100644
---- a/libarchive/archive_write_disk_windows.c
-+++ b/libarchive/archive_write_disk_windows.c
-@@ -580,7 +580,7 @@ la_GetFunctionKernel32(const char *name)
- static int
- la_CreateHardLinkW(wchar_t *linkname, wchar_t *target)
- {
--	static BOOLEAN (WINAPI *f)(LPWSTR, LPWSTR, LPSECURITY_ATTRIBUTES);
-+	static BOOL (WINAPI *f)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
- 	BOOL ret;
- 
- #if _WIN32_WINNT < _WIN32_WINNT_XP
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0004-Don-t-call-GetOEMCP-in-Universal-Windows-Platform-bu.patch deleted
=====================================
@@ -1,36 +0,0 @@
-From 4d018f8cd3104fb34e0f4c6c5bebbdd47351643d Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Wed, 24 May 2023 15:23:14 +0200
-Subject: [PATCH 4/9] Don't call GetOEMCP() in Universal Windows Platform
- builds
-
-It's not available [1] [2]. However we can use the intermediate CP_OEMCP
-value. It can be used to compare charsets in create_sconv_object().
-It won't work with comparing charsets in archive_string_default_conversion_for_read()
-and archive_string_default_conversion_for_write(). current_codepage being
-an actual CodePage value.
-
-[1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-localization-l1-2-0dll
-[2] https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getoemcp#requirements
----
- libarchive/archive_string.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c
-index 69458e1a..accf5263 100644
---- a/libarchive/archive_string.c
-+++ b/libarchive/archive_string.c
-@@ -1324,6 +1324,10 @@ free_sconv_object(struct archive_string_conv *sc)
- }
- 
- #if defined(_WIN32) && !defined(__CYGWIN__)
-+# if defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+#  define GetOEMCP() CP_OEMCP
-+# endif
-+
- static unsigned
- my_atoi(const char *p)
- {
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0005-tests-use-CreateFileA-for-char-filenames.patch deleted
=====================================
@@ -1,35 +0,0 @@
-From 442c857f5d34a2230058f12c46e92e53940b1444 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Wed, 24 May 2023 15:00:04 +0200
-Subject: [PATCH 5/9] tests: use CreateFileA for char* filenames
-
-In case the code is compiled with the UNICODE define.
----
- test_utils/test_main.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/test_utils/test_main.c b/test_utils/test_main.c
-index 3250423a..e4b884ee 100644
---- a/test_utils/test_main.c
-+++ b/test_utils/test_main.c
-@@ -327,7 +327,7 @@ my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
- 	int r;
- 
- 	memset(bhfi, 0, sizeof(*bhfi));
--	h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
-+	h = CreateFileA(path, FILE_READ_ATTRIBUTES, 0, NULL,
- 		OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
- 	if (h == INVALID_HANDLE_VALUE)
- 		return (0);
-@@ -1432,7 +1432,7 @@ assertion_file_time(const char *file, int line,
- 	/* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open
- 	 * a directory file. If not, CreateFile() will fail when
- 	 * the pathname is a directory. */
--	h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
-+	h = CreateFileA(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
- 	    OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
- 	if (h == INVALID_HANDLE_VALUE) {
- 		failure_start(file, line, "Can't access %s\n", pathname);
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0006-Use-CreateFile2-instead-of-CreateFileW-on-Win8-build.patch deleted
=====================================
@@ -1,413 +0,0 @@
-From 819a3a0ccd62de4ba34fb90a25dcf4fdfa915750 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Fri, 26 May 2023 09:57:40 +0200
-Subject: [PATCH 6/8] Use CreateFile2 instead of CreateFileW on Win8+ builds
-
-CreateFileW is not allowed in Universal Windows Platform (UWP) builds but
-CreateFile2 is available. We could just enable this code for UWP but
-it's probably to use it going forward so the code is properly tested on
-both sides.
----
- cpio/cpio_windows.c                     | 15 ++++++
- libarchive/archive_read_disk_windows.c  | 72 ++++++++++++++++++++++++-
- libarchive/archive_util.c               | 15 ++++++
- libarchive/archive_windows.c            | 15 ++++++
- libarchive/archive_write_disk_windows.c | 51 ++++++++++++++++++
- 5 files changed, 166 insertions(+), 2 deletions(-)
-
-diff --git a/cpio/cpio_windows.c b/cpio/cpio_windows.c
-index 63f6df03..15cccaf9 100644
---- a/cpio/cpio_windows.c
-+++ b/cpio/cpio_windows.c
-@@ -156,6 +156,9 @@ cpio_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- {
- 	wchar_t *wpath;
- 	HANDLE handle;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 
- 	handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
- 	    lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
-@@ -167,9 +170,21 @@ cpio_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- 	wpath = permissive_name(path);
- 	if (wpath == NULL)
- 		return (handle);
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	ZeroMemory(&createExParams, sizeof(createExParams));
-+	createExParams.dwSize = sizeof(createExParams);
-+	createExParams.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF;
-+	createExParams.dwFileFlags = dwFlagsAndAttributes & 0xFFF00000;
-+	createExParams.dwSecurityQosFlags = dwFlagsAndAttributes & 0x000F0000;
-+	createExParams.lpSecurityAttributes = lpSecurityAttributes;
-+	createExParams.hTemplateFile = hTemplateFile;
-+	handle = CreateFile2(wpath, dwDesiredAccess, dwShareMode,
-+	    dwCreationDisposition, &createExParams);
-+#else
- 	handle = CreateFileW(wpath, dwDesiredAccess, dwShareMode,
- 	    lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
- 	    hTemplateFile);
-+#endif
- 	free(wpath);
- 	return (handle);
- }
-diff --git a/libarchive/archive_read_disk_windows.c b/libarchive/archive_read_disk_windows.c
-index f9d13955..f92a78a2 100644
---- a/libarchive/archive_read_disk_windows.c
-+++ b/libarchive/archive_read_disk_windows.c
-@@ -418,9 +418,19 @@ la_linkname_from_pathw(const wchar_t *path, wchar_t **outbuf, int *linktype)
- 	    FILE_FLAG_OPEN_REPARSE_POINT;
- 	int ret;
- 
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+	ZeroMemory(&createExParams, sizeof(createExParams));
-+	createExParams.dwSize = sizeof(createExParams);
-+	createExParams.dwFileFlags = flag;
-+	h = CreateFile2(path, 0,
-+	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-+	    OPEN_EXISTING, &createExParams);
-+#else
- 	h = CreateFileW(path, 0,
- 	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
- 	    OPEN_EXISTING, flag, NULL);
-+#endif
- 	if (h == INVALID_HANDLE_VALUE) {
- 		la_dosmaperr(GetLastError());
- 		return (-1);
-@@ -1067,16 +1077,29 @@ next_entry(struct archive_read_disk *a, struct tree *t,
- 	if (archive_entry_filetype(entry) == AE_IFREG &&
- 	    archive_entry_size(entry) > 0) {
- 		DWORD flags = FILE_FLAG_BACKUP_SEMANTICS;
-+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 		if (t->async_io)
- 			flags |= FILE_FLAG_OVERLAPPED;
- 		if (t->direct_io)
- 			flags |= FILE_FLAG_NO_BUFFERING;
- 		else
- 			flags |= FILE_FLAG_SEQUENTIAL_SCAN;
-+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		ZeroMemory(&createExParams, sizeof(createExParams));
-+		createExParams.dwSize = sizeof(createExParams);
-+		createExParams.dwFileFlags = flags;
-+		t->entry_fh = CreateFile2(tree_current_access_path(t),
-+		    GENERIC_READ,
-+		    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-+		    OPEN_EXISTING, &createExParams);
-+#else
- 		t->entry_fh = CreateFileW(tree_current_access_path(t),
- 		    GENERIC_READ,
- 		    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- 		    NULL, OPEN_EXISTING, flags, NULL);
-+#endif
- 		if (t->entry_fh == INVALID_HANDLE_VALUE) {
- 			la_dosmaperr(GetLastError());
- 			archive_set_error(&a->archive, errno,
-@@ -1547,6 +1570,9 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
- {
- 	HANDLE handle;
- 	int r = 0;
-+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 
- 	if (h == INVALID_HANDLE_VALUE && AE_IFLNK == rt->filetype)
- 		return (0);
-@@ -1560,8 +1586,16 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
- 	if ((t->flags & needsRestoreTimes) == 0)
- 		return (r);
- 
-+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	ZeroMemory(&createExParams, sizeof(createExParams));
-+	createExParams.dwSize = sizeof(createExParams);
-+	createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
-+	handle = CreateFile2(rt->full_path, FILE_WRITE_ATTRIBUTES,
-+		    0, OPEN_EXISTING, &createExParams);
-+#else
- 	handle = CreateFileW(rt->full_path, FILE_WRITE_ATTRIBUTES,
- 		    0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-+#endif
- 	if (handle == INVALID_HANDLE_VALUE) {
- 		errno = EINVAL;
- 		return (-1);
-@@ -2046,12 +2080,24 @@ tree_current_file_information(struct tree *t, BY_HANDLE_FILE_INFORMATION *st,
- 	HANDLE h;
- 	int r;
- 	DWORD flag = FILE_FLAG_BACKUP_SEMANTICS;
--	
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
-+
- 	if (sim_lstat && tree_current_is_physical_link(t))
- 		flag |= FILE_FLAG_OPEN_REPARSE_POINT;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	ZeroMemory(&createExParams, sizeof(createExParams));
-+	createExParams.dwSize = sizeof(createExParams);
-+	createExParams.dwFileFlags = flag;
-+	h = CreateFile2(tree_current_access_path(t), 0,
-+	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-+	    OPEN_EXISTING, &createExParams);
-+#else
- 	h = CreateFileW(tree_current_access_path(t), 0,
- 	    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
- 	    OPEN_EXISTING, flag, NULL);
-+#endif
- 	if (h == INVALID_HANDLE_VALUE) {
- 		la_dosmaperr(GetLastError());
- 		t->tree_errno = errno;
-@@ -2257,7 +2303,10 @@ archive_read_disk_entry_from_file(struct archive *_a,
- 		} else {
- 			WIN32_FIND_DATAW findData;
- 			DWORD flag, desiredAccess;
--	
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+			CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
-+
- 			h = FindFirstFileW(path, &findData);
- 			if (h == INVALID_HANDLE_VALUE) {
- 				la_dosmaperr(GetLastError());
-@@ -2279,9 +2328,18 @@ archive_read_disk_entry_from_file(struct archive *_a,
- 			} else
- 				desiredAccess = GENERIC_READ;
- 
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+			ZeroMemory(&createExParams, sizeof(createExParams));
-+			createExParams.dwSize = sizeof(createExParams);
-+			createExParams.dwFileFlags = flag;
-+			h = CreateFile2(path, desiredAccess,
-+			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-+			    OPEN_EXISTING, &createExParams);
-+#else
- 			h = CreateFileW(path, desiredAccess,
- 			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
- 			    OPEN_EXISTING, flag, NULL);
-+#endif
- 			if (h == INVALID_HANDLE_VALUE) {
- 				la_dosmaperr(GetLastError());
- 				archive_set_error(&a->archive, errno,
-@@ -2342,9 +2400,19 @@ archive_read_disk_entry_from_file(struct archive *_a,
- 		if (fd >= 0) {
- 			h = (HANDLE)_get_osfhandle(fd);
- 		} else {
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+			CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+			ZeroMemory(&createExParams, sizeof(createExParams));
-+			createExParams.dwSize = sizeof(createExParams);
-+			createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
-+			h = CreateFile2(path, GENERIC_READ,
-+			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
-+			    OPEN_EXISTING, &createExParams);
-+#else
- 			h = CreateFileW(path, GENERIC_READ,
- 			    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
- 			    OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-+#endif
- 			if (h == INVALID_HANDLE_VALUE) {
- 				la_dosmaperr(GetLastError());
- 				archive_set_error(&a->archive, errno,
-diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
-index b1582edb..17123b94 100644
---- a/libarchive/archive_util.c
-+++ b/libarchive/archive_util.c
-@@ -323,6 +323,9 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
- 	for (;;) {
- 		wchar_t *p;
- 		HANDLE h;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 
- 		/* Generate a random file name through CryptGenRandom(). */
- 		p = xp;
-@@ -347,6 +350,17 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
- 			/* mkstemp */
- 			attr = FILE_ATTRIBUTE_NORMAL;
- 		}
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		ZeroMemory(&createExParams, sizeof(createExParams));
-+		createExParams.dwSize = sizeof(createExParams);
-+		createExParams.dwFileAttributes = attr & 0xFFFF;
-+		createExParams.dwFileFlags = attr & 0xFFF00000;
-+		h = CreateFile2(ws,
-+		    GENERIC_READ | GENERIC_WRITE | DELETE,
-+		    0,/* Not share */
-+			CREATE_NEW,
-+			&createExParams);
-+#else
- 		h = CreateFileW(ws,
- 		    GENERIC_READ | GENERIC_WRITE | DELETE,
- 		    0,/* Not share */
-@@ -354,6 +368,7 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
- 		    CREATE_NEW,/* Create a new file only */
- 		    attr,
- 		    NULL);
-+#endif
- 		if (h == INVALID_HANDLE_VALUE) {
- 			/* The same file already exists. retry with
- 			 * a new filename. */
-diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c
-index 624e2700..53d4b558 100644
---- a/libarchive/archive_windows.c
-+++ b/libarchive/archive_windows.c
-@@ -234,6 +234,9 @@ la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- {
- 	wchar_t *wpath;
- 	HANDLE handle;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 
- 	handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
- 	    lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
-@@ -245,9 +248,21 @@ la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- 	wpath = __la_win_permissive_name(path);
- 	if (wpath == NULL)
- 		return (handle);
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	ZeroMemory(&createExParams, sizeof(createExParams));
-+	createExParams.dwSize = sizeof(createExParams);
-+	createExParams.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF;
-+	createExParams.dwFileFlags = dwFlagsAndAttributes & 0xFFF00000;
-+	createExParams.dwSecurityQosFlags = dwFlagsAndAttributes & 0x000F00000;
-+	createExParams.lpSecurityAttributes = lpSecurityAttributes;
-+	createExParams.hTemplateFile = hTemplateFile;
-+	handle = CreateFile2(wpath, dwDesiredAccess, dwShareMode,
-+	    dwCreationDisposition, &createExParams);
-+#else /* !WINAPI_PARTITION_DESKTOP */
- 	handle = CreateFileW(wpath, dwDesiredAccess, dwShareMode,
- 	    lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
- 	    hTemplateFile);
-+#endif /* !WINAPI_PARTITION_DESKTOP */
- 	free(wpath);
- 	return (handle);
- }
-diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c
-index 7280d99b..b4a73e71 100644
---- a/libarchive/archive_write_disk_windows.c
-+++ b/libarchive/archive_write_disk_windows.c
-@@ -266,6 +266,9 @@ file_information(struct archive_write_disk *a, wchar_t *path,
- 	int r;
- 	DWORD flag = FILE_FLAG_BACKUP_SEMANTICS;
- 	WIN32_FIND_DATAW	findData;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 
- 	if (sim_lstat || mode != NULL) {
- 		h = FindFirstFileW(path, &findData);
-@@ -290,14 +293,27 @@ file_information(struct archive_write_disk *a, wchar_t *path,
- 		(findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK)))
- 		flag |= FILE_FLAG_OPEN_REPARSE_POINT;
- 
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+	ZeroMemory(&createExParams, sizeof(createExParams));
-+	createExParams.dwSize = sizeof(createExParams);
-+	createExParams.dwFileFlags = flag;
-+	h = CreateFile2(a->name, 0, 0,
-+		OPEN_EXISTING, &createExParams);
-+#else
- 	h = CreateFileW(a->name, 0, 0, NULL,
- 	    OPEN_EXISTING, flag, NULL);
-+#endif
- 	if (h == INVALID_HANDLE_VALUE &&
- 	    GetLastError() == ERROR_INVALID_NAME) {
- 		wchar_t *full;
- 		full = __la_win_permissive_name_w(path);
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		h = CreateFile2(full, 0, 0,
-+			OPEN_EXISTING, &createExParams);
-+#else
- 		h = CreateFileW(full, 0, 0, NULL,
- 		    OPEN_EXISTING, flag, NULL);
-+#endif
- 		free(full);
- 	}
- 	if (h == INVALID_HANDLE_VALUE) {
-@@ -1672,6 +1688,9 @@ create_filesystem_object(struct archive_write_disk *a)
- 	mode_t final_mode, mode;
- 	int r;
- 	DWORD attrs = 0;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 
- 	/* We identify hard/symlinks according to the link names. */
- 	/* Since link(2) and symlink(2) don't handle modes, we're done here. */
-@@ -1735,8 +1754,16 @@ create_filesystem_object(struct archive_write_disk *a)
- 			a->todo = 0;
- 			a->deferred = 0;
- 		} else if (r == 0 && a->filesize > 0) {
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+			ZeroMemory(&createExParams, sizeof(createExParams));
-+			createExParams.dwSize = sizeof(createExParams);
-+			createExParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
-+			a->fh = CreateFile2(namefull, GENERIC_WRITE, 0,
-+			    TRUNCATE_EXISTING, &createExParams);
-+#else
- 			a->fh = CreateFileW(namefull, GENERIC_WRITE, 0, NULL,
- 			    TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-+#endif
- 			if (a->fh == INVALID_HANDLE_VALUE) {
- 				la_dosmaperr(GetLastError());
- 				r = errno;
-@@ -1799,14 +1826,27 @@ create_filesystem_object(struct archive_write_disk *a)
- 		a->tmpname = NULL;
- 		fullname = a->name;
- 		/* O_WRONLY | O_CREAT | O_EXCL */
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		ZeroMemory(&createExParams, sizeof(createExParams));
-+		createExParams.dwSize = sizeof(createExParams);
-+		createExParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
-+		a->fh = CreateFile2(fullname, GENERIC_WRITE, 0,
-+		    CREATE_NEW, &createExParams);
-+#else
- 		a->fh = CreateFileW(fullname, GENERIC_WRITE, 0, NULL,
- 		    CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
-+#endif
- 		if (a->fh == INVALID_HANDLE_VALUE &&
- 		    GetLastError() == ERROR_INVALID_NAME &&
- 		    fullname == a->name) {
- 			fullname = __la_win_permissive_name_w(a->name);
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+			a->fh = CreateFile2(fullname, GENERIC_WRITE, 0,
-+			    CREATE_NEW, &createExParams);
-+#else
- 			a->fh = CreateFileW(fullname, GENERIC_WRITE, 0, NULL,
- 			    CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
-+#endif
- 		}
- 		if (a->fh == INVALID_HANDLE_VALUE) {
- 			if (GetLastError() == ERROR_ACCESS_DENIED) {
-@@ -2567,14 +2607,25 @@ set_times(struct archive_write_disk *a,
- 		hw = NULL;
- 	} else {
- 		wchar_t *ws;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+#endif
- 
- 		if (S_ISLNK(mode))
- 			return (ARCHIVE_OK);
- 		ws = __la_win_permissive_name_w(name);
- 		if (ws == NULL)
- 			goto settimes_failed;
-+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
-+		ZeroMemory(&createExParams, sizeof(createExParams));
-+		createExParams.dwSize = sizeof(createExParams);
-+		createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
-+		hw = CreateFile2(ws, FILE_WRITE_ATTRIBUTES, 0,
-+		    OPEN_EXISTING, &createExParams);
-+#else
- 		hw = CreateFileW(ws, FILE_WRITE_ATTRIBUTES,
- 		    0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-+#endif
- 		free(ws);
- 		if (hw == INVALID_HANDLE_VALUE)
- 			goto settimes_failed;
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0007-Disable-CreateFileA-calls-in-UWP-builds.patch deleted
=====================================
@@ -1,99 +0,0 @@
-From 282cf8ce619eaf62addf65ee7825c8f2d8ebf4e3 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Fri, 26 May 2023 09:58:48 +0200
-Subject: [PATCH 7/9] Disable CreateFileA calls in UWP builds
-
-Only CreateFile2 and CreateFileFromAppW are allowed.
----
- cpio/cpio_windows.c          |  4 +++-
- libarchive/archive_windows.c | 20 +++++++++++++++++---
- 2 files changed, 20 insertions(+), 4 deletions(-)
-
-diff --git a/cpio/cpio_windows.c b/cpio/cpio_windows.c
-index 15cccaf9..2809ca82 100644
---- a/cpio/cpio_windows.c
-+++ b/cpio/cpio_windows.c
-@@ -160,6 +160,7 @@ cpio_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- 	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
- #endif
- 
-+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
- 	handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
- 	    lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
- 	    hTemplateFile);
-@@ -167,9 +168,10 @@ cpio_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- 		return (handle);
- 	if (GetLastError() != ERROR_PATH_NOT_FOUND)
- 		return (handle);
-+#endif
- 	wpath = permissive_name(path);
- 	if (wpath == NULL)
--		return (handle);
-+		return INVALID_HANDLE_VALUE;
- # if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
- 	ZeroMemory(&createExParams, sizeof(createExParams));
- 	createExParams.dwSize = sizeof(createExParams);
-diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c
-index 53d4b558..ebc5eefb 100644
---- a/libarchive/archive_windows.c
-+++ b/libarchive/archive_windows.c
-@@ -238,6 +238,7 @@ la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- 	CREATEFILE2_EXTENDED_PARAMETERS createExParams;
- #endif
- 
-+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
- 	handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
- 	    lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
- 	    hTemplateFile);
-@@ -245,9 +246,10 @@ la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
- 		return (handle);
- 	if (GetLastError() != ERROR_PATH_NOT_FOUND)
- 		return (handle);
-+#endif
- 	wpath = __la_win_permissive_name(path);
- 	if (wpath == NULL)
--		return (handle);
-+		return INVALID_HANDLE_VALUE;
- # if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
- 	ZeroMemory(&createExParams, sizeof(createExParams));
- 	createExParams.dwSize = sizeof(createExParams);
-@@ -320,7 +322,10 @@ __la_open(const char *path, int flags, ...)
- 		 * "Permission denied" error.
- 		 */
- 		attr = GetFileAttributesA(path);
--		if (attr == (DWORD)-1 && GetLastError() == ERROR_PATH_NOT_FOUND) {
-+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
-+		if (attr == (DWORD)-1 && GetLastError() == ERROR_PATH_NOT_FOUND)
-+#endif
-+		{
- 			ws = __la_win_permissive_name(path);
- 			if (ws == NULL) {
- 				errno = EINVAL;
-@@ -335,7 +340,7 @@ __la_open(const char *path, int flags, ...)
- 		}
- 		if (attr & FILE_ATTRIBUTE_DIRECTORY) {
- 			HANDLE handle;
--
-+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
- 			if (ws != NULL)
- 				handle = CreateFileW(ws, 0, 0, NULL,
- 				    OPEN_EXISTING,
-@@ -348,6 +353,15 @@ __la_open(const char *path, int flags, ...)
- 				    FILE_FLAG_BACKUP_SEMANTICS |
- 				    FILE_ATTRIBUTE_READONLY,
- 					NULL);
-+#else /* !WINAPI_PARTITION_DESKTOP */
-+			CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+			ZeroMemory(&createExParams, sizeof(createExParams));
-+			createExParams.dwSize = sizeof(createExParams);
-+			createExParams.dwFileAttributes = FILE_ATTRIBUTE_READONLY;
-+			createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
-+			handle = CreateFile2(ws, 0, 0,
-+				OPEN_EXISTING, &createExParams);
-+#endif /* !WINAPI_PARTITION_DESKTOP */
- 			free(ws);
- 			if (handle == INVALID_HANDLE_VALUE) {
- 				la_dosmaperr(GetLastError());
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/0008-Disable-program-call-with-stdin-stdout-usage-on-UWP-.patch deleted
=====================================
@@ -1,45 +0,0 @@
-From 243b00a950c396850859822ceaf0056e4b8cf0bc Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Wed, 24 May 2023 15:14:33 +0200
-Subject: [PATCH 8/9] Disable program call with stdin/stdout usage on UWP
- builds
-
-Some calls are not allowed:
-* WaitForInputIdle [1]
-* STARTF_XXX flags for CreateProcess are not allowed
-
-[1] https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-waitforinputidle#requirements
----
- libarchive/filter_fork_windows.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/libarchive/filter_fork_windows.c b/libarchive/filter_fork_windows.c
-index 6b0ed7df..e977c396 100644
---- a/libarchive/filter_fork_windows.c
-+++ b/libarchive/filter_fork_windows.c
-@@ -31,6 +31,7 @@
- 
- #include "filter_fork.h"
- 
-+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
- /* There are some editions of Windows ("nano server," for example) that
-  * do not host user32.dll. If we want to keep running on those editions,
-  * we need to delay-load WaitForInputIdle. */
-@@ -224,6 +225,14 @@ fail:
- 	__archive_cmdline_free(acmd);
- 	return ARCHIVE_FAILED;
- }
-+#else /* !WINAPI_PARTITION_DESKTOP */
-+int
-+__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout, HANDLE *out_child)
-+{
-+	(void)cmd; (void)child_stdin; (void) child_stdout; (void) out_child;
-+	return ARCHIVE_FAILED;
-+}
-+#endif /* !WINAPI_PARTITION_DESKTOP */
- 
- void
- __archive_check_child(int in, int out)
--- 
-2.37.3.windows.1
-


=====================================
contrib/src/libarchive/SHA512SUMS
=====================================
@@ -1 +1 @@
-24e476465054a29a2d48adf3c197a171b5361fa5038729a1f14d578c6701424de4e5dd6a2b20a6b697969ab43bdd8afc1585f8de0465c266f455d7eaa19e5048  libarchive-3.6.2.tar.gz
+ed65e35e37d74791a480c0ed6f67ecbaa9f40ffaae38ae8388e0c6e4ff1e9f8d833345bfa3b4de7c5a2142c54adb53523a4f3fe2bcbc1079e71cc3545358cb9e  libarchive-3.7.0.tar.gz


=====================================
contrib/src/libarchive/rules.mak
=====================================
@@ -1,5 +1,5 @@
 # LIBARCHIVE
-LIBARCHIVE_VERSION := 3.6.2
+LIBARCHIVE_VERSION := 3.7.0
 LIBARCHIVE_URL := $(GITHUB)/libarchive/libarchive/releases/download/v$(LIBARCHIVE_VERSION)/libarchive-$(LIBARCHIVE_VERSION).tar.gz
 
 PKGS += libarchive
@@ -22,6 +22,9 @@ LIBARCHIVE_CONF := \
 # CNG enables bcrypt on Windows and useless otherwise, it's OK we build for Win7+
 LIBARCHIVE_CONF +=-DENABLE_CNG=ON
 
+# bsdunzip doesn't build on macos, android and emscripten and it's disabled on Windows
+LIBARCHIVE_CONF +=-DENABLE_UNZIP=OFF
+
 ifdef HAVE_WIN32
 LIBARCHIVE_CONF += -DENABLE_OPENSSL=OFF
 endif
@@ -33,19 +36,6 @@ $(TARBALLS)/libarchive-$(LIBARCHIVE_VERSION).tar.gz:
 
 libarchive: libarchive-$(LIBARCHIVE_VERSION).tar.gz .sum-libarchive
 	$(UNPACK)
-	$(APPLY) $(SRC)/libarchive/0001-Fix-compile-on-Android.patch
-	$(APPLY) $(SRC)/libarchive/0001-Fix-build-error-when-cross-compiling-for-Windows.patch
-	$(APPLY) $(SRC)/libarchive/0001-Fix-bcrypt-detection-on-UNIX-cross-compilation.patch
-	$(APPLY) $(SRC)/libarchive/0001-Use-the-common-CMake-BUILD_SHARED_LIBS-to-build-shar.patch
-	$(APPLY) $(SRC)/libarchive/0001-Use-CreateHardLinkW-and-CreateSymbolicLinkW-directly.patch
-	$(APPLY) $(SRC)/libarchive/0002-Disable-CreateSymbolicLinkW-use-in-UWP-builds.patch
-	$(APPLY) $(SRC)/libarchive/0003-fix-the-CreateHardLinkW-signature-to-match-the-real-.patch
-	$(APPLY) $(SRC)/libarchive/0004-Don-t-call-GetOEMCP-in-Universal-Windows-Platform-bu.patch
-	$(APPLY) $(SRC)/libarchive/0005-tests-use-CreateFileA-for-char-filenames.patch
-	$(APPLY) $(SRC)/libarchive/0006-Use-CreateFile2-instead-of-CreateFileW-on-Win8-build.patch
-	$(APPLY) $(SRC)/libarchive/0007-Disable-CreateFileA-calls-in-UWP-builds.patch
-	$(APPLY) $(SRC)/libarchive/0008-Disable-program-call-with-stdin-stdout-usage-on-UWP-.patch
-	$(APPLY) $(SRC)/libarchive/0001-Make-single-bit-bitfields-unsigned-to-avoid-clang-16.patch
 	$(call pkg_static,"build/pkgconfig/libarchive.pc.in")
 	$(MOVE)
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fa419f41709adb04bb4ef92b1dfc249dcc7bb897

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fa419f41709adb04bb4ef92b1dfc249dcc7bb897
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list