Skip to content

Commit

Permalink
build(deps): sync bit7z and 7zip from vcpkg (#29)
Browse files Browse the repository at this point in the history
Signed-off-by: l.feng <43399351+msclock@users.noreply.github.com>
  • Loading branch information
msclock authored Jan 4, 2025
1 parent e98be63 commit b72dbac
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 180 deletions.
13 changes: 13 additions & 0 deletions cmake/vcpkg/ports/7zip/fix_timespec_get_broken_on_android.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CPP/Windows/TimeUtils.cpp b/CPP/Windows/TimeUtils.cpp
index bbd79ba..8df3ea3 100644
--- a/CPP/Windows/TimeUtils.cpp
+++ b/CPP/Windows/TimeUtils.cpp
@@ -259,7 +259,7 @@ bool GetSecondsSince1601(unsigned year, unsigned month, unsigned day,
Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3,
Cygwin 2.9, mingw, MSVC 14, Android 9.0.
*/
-#if defined(TIME_UTC)
+#if defined(TIME_UTC) && (!defined(__ANDROID__) || __ANDROID_API__ >= 29)
#define ZIP7_USE_timespec_get
// #pragma message("ZIP7_USE_timespec_get")
#elif defined(CLOCK_REALTIME)
13 changes: 2 additions & 11 deletions cmake/vcpkg/ports/7zip/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,13 @@ vcpkg_from_github(
REF "${VERSION}"
SHA512 dc0241ed96907965445550912d1171fe32230a52997b089558a4cc73a662fc6a17940db8dcb0794b805268964899d9e5a48ddb444e92b56fd243bbaa17c20a1c
HEAD_REF main
PATCHES
fix_timespec_get_broken_on_android.patch
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/7zip-config.cmake.in" DESTINATION "${SOURCE_PATH}")

vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")

if(VCPKG_TARGET_IS_ANDROID)
message(STATUS "Disable TIME_UTC on android")
vcpkg_replace_string("${SOURCE_PATH}/CPP/Windows/TimeUtils.cpp"
[[if defined(TIME_UTC)]]
[[if defined(TIME_UTC) && !defined(__ANDROID__)]]
)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
Expand Down
4 changes: 0 additions & 4 deletions cmake/vcpkg/ports/7zip/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "vcpkg-cmake-get-vars",
"host": true
}
]
}
13 changes: 0 additions & 13 deletions cmake/vcpkg/ports/bit7z/fix_compile_options.patch

This file was deleted.

28 changes: 0 additions & 28 deletions cmake/vcpkg/ports/bit7z/fix_dependency.patch

This file was deleted.

43 changes: 0 additions & 43 deletions cmake/vcpkg/ports/bit7z/fix_install.patch

This file was deleted.

46 changes: 0 additions & 46 deletions cmake/vcpkg/ports/bit7z/portfile.cmake

This file was deleted.

10 changes: 0 additions & 10 deletions cmake/vcpkg/ports/bit7z/unofficial-bit7z-config.cmake.in

This file was deleted.

25 changes: 0 additions & 25 deletions cmake/vcpkg/ports/bit7z/vcpkg.json

This file was deleted.

0 comments on commit b72dbac

Please sign in to comment.