aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/bit7z
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/bit7z
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/bit7z')
-rw-r--r--vcpkg/ports/bit7z/fix_compile_options.patch13
-rw-r--r--vcpkg/ports/bit7z/fix_dependency.patch28
-rw-r--r--vcpkg/ports/bit7z/fix_install.patch43
-rw-r--r--vcpkg/ports/bit7z/portfile.cmake46
-rw-r--r--vcpkg/ports/bit7z/unofficial-bit7z-config.cmake.in10
-rw-r--r--vcpkg/ports/bit7z/vcpkg.json24
6 files changed, 164 insertions, 0 deletions
diff --git a/vcpkg/ports/bit7z/fix_compile_options.patch b/vcpkg/ports/bit7z/fix_compile_options.patch
new file mode 100644
index 0000000..19f611a
--- /dev/null
+++ b/vcpkg/ports/bit7z/fix_compile_options.patch
@@ -0,0 +1,13 @@
+diff --git a/cmake/CompilerOptions.cmake b/cmake/CompilerOptions.cmake
+index 1cdb84f..fd9346f 100644
+--- a/cmake/CompilerOptions.cmake
++++ b/cmake/CompilerOptions.cmake
+@@ -70,7 +70,7 @@ if( MSVC )
+ endforeach()
+ endif()
+ else()
+- target_compile_options( ${LIB_TARGET} PRIVATE -Wall -Wextra -Werror -Wconversion -Wsign-conversion )
++ target_compile_options( ${LIB_TARGET} PRIVATE -Wall -Wextra -Wconversion -Wsign-conversion )
+ endif()
+
+ # Extra warning flags for Clang
diff --git a/vcpkg/ports/bit7z/fix_dependency.patch b/vcpkg/ports/bit7z/fix_dependency.patch
new file mode 100644
index 0000000..93dc20c
--- /dev/null
+++ b/vcpkg/ports/bit7z/fix_dependency.patch
@@ -0,0 +1,28 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f8ff6f0..855b78d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -194,15 +194,22 @@ include( cmake/BuildOptions.cmake )
+ include( cmake/CompilerOptions.cmake )
+
+ # dependencies
+-include( cmake/Dependencies.cmake )
++# include( cmake/Dependencies.cmake )
++find_package(7zip CONFIG REQUIRED)
++add_library(7-zip ALIAS 7zip::7zip)
+
+ # 7-zip source code
+ target_link_libraries( ${LIB_TARGET} PRIVATE 7-zip )
+
+ # filesystem library (needed if std::filesystem is not available)
++if(0)
+ if( ghc_filesystem_ADDED )
+ target_link_libraries( ${LIB_TARGET} PRIVATE ghc_filesystem )
+ endif()
++else()
++ find_package(ghc_filesystem CONFIG REQUIRED)
++ target_link_libraries(${LIB_TARGET} PRIVATE ghcFilesystem::ghc_filesystem )
++endif()
+
+ # public includes
+ target_include_directories( ${LIB_TARGET} PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
diff --git a/vcpkg/ports/bit7z/fix_install.patch b/vcpkg/ports/bit7z/fix_install.patch
new file mode 100644
index 0000000..7009fb9
--- /dev/null
+++ b/vcpkg/ports/bit7z/fix_install.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2eb8634..f8ff6f0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -179,7 +179,7 @@ message( STATUS "Language Standard for bit7z: C++${CMAKE_CXX_STANDARD}" )
+ set( LIB_TARGET bit7z${ARCH_POSTFIX} )
+ add_library( ${LIB_TARGET} STATIC )
+ target_sources( ${LIB_TARGET}
+- PUBLIC ${PUBLIC_HEADERS}
++ # PUBLIC ${PUBLIC_HEADERS}
+ PRIVATE ${HEADERS} ${SOURCES} )
+
+ # additional target without the architecture suffix in the name
+@@ -246,3 +246,29 @@ endif()
+ if( BIT7Z_BUILD_DOCS )
+ add_subdirectory( docs )
+ endif()
++
++set_target_properties(${LIB_TARGET} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
++
++include(CMakePackageConfigHelpers)
++configure_package_config_file(
++ "${CMAKE_CURRENT_SOURCE_DIR}/unofficial-bit7z-config.cmake.in"
++ "${CMAKE_CURRENT_BINARY_DIR}/unofficial-bit7z-config.cmake"
++ INSTALL_DESTINATION "share/unofficial-bit7z"
++)
++install(
++ FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-bit7z-config.cmake"
++ DESTINATION "share/unofficial-bit7z"
++)
++
++include(GNUInstallDirs)
++install(
++ TARGETS ${LIB_TARGET}
++ EXPORT unofficial-bit7z-targets
++ COMPONENT bit7z
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/bit7z COMPONENT bit7z_development)
++
++install(EXPORT unofficial-bit7z-targets FILE unofficial-bit7z-targets.cmake NAMESPACE unofficial::bit7z:: DESTINATION share/unofficial-bit7z)
++
diff --git a/vcpkg/ports/bit7z/portfile.cmake b/vcpkg/ports/bit7z/portfile.cmake
new file mode 100644
index 0000000..ffa3607
--- /dev/null
+++ b/vcpkg/ports/bit7z/portfile.cmake
@@ -0,0 +1,46 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO rikyoz/bit7z
+ REF "v${VERSION}"
+ SHA512 18bd18bc7186c04d9c2e731c76f23ab97a796a0ec027dc7163626f30ca807ba98733dbcd96bbca9af0cd0497cede4561c84560bf4e28030f59e1e34c1d98204d
+ HEAD_REF master
+ PATCHES
+ fix_install.patch
+ fix_dependency.patch
+ fix_compile_options.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-bit7z-config.cmake.in" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ regex-matching BIT7Z_REGEX_MATCHING
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBIT7Z_AUTO_FORMAT=ON
+ -DBIT7Z_AUTO_PREFIX_LONG_PATHS=ON
+ -DBIT7Z_DISABLE_ZIP_ASCII_PWD_CHECK=OFF
+ -DBIT7Z_PATH_SANITIZATION=ON
+ -DBIT7Z_DISABLE_USE_STD_FILESYSTEM=OFF
+ -DBIT7Z_USE_STD_BYTE=OFF
+ -DBIT7Z_USE_NATIVE_STRING=OFF
+ -DBIT7Z_USE_SYSTEM_CODEPAGE=OFF
+ -DBIT7Z_BUILD_TESTS=OFF
+ -DBIT7Z_BUILD_DOCS=OFF
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-bit7z CONFIG_PATH share/unofficial-bit7z)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
diff --git a/vcpkg/ports/bit7z/unofficial-bit7z-config.cmake.in b/vcpkg/ports/bit7z/unofficial-bit7z-config.cmake.in
new file mode 100644
index 0000000..cd432b6
--- /dev/null
+++ b/vcpkg/ports/bit7z/unofficial-bit7z-config.cmake.in
@@ -0,0 +1,10 @@
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+
+find_dependency(7zip CONFIG)
+find_dependency(ghc_filesystem CONFIG)
+
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-bit7z-targets.cmake")
+
+check_required_components(bit7z)
diff --git a/vcpkg/ports/bit7z/vcpkg.json b/vcpkg/ports/bit7z/vcpkg.json
new file mode 100644
index 0000000..8b38a33
--- /dev/null
+++ b/vcpkg/ports/bit7z/vcpkg.json
@@ -0,0 +1,24 @@
+{
+ "name": "bit7z",
+ "version": "4.0.10",
+ "description": "A C++ static library offering a clean and simple interface to the 7-zip shared libraries.",
+ "homepage": "https://github.com/rikyoz/bit7z",
+ "license": "MPL-2.0",
+ "dependencies": [
+ "7zip",
+ "ghc-filesystem",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "regex-matching": {
+ "description": "Enables the support for extracting files matching regular expressions"
+ }
+ }
+}