diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-08-27 20:24:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-27 20:24:39 -0700 |
| commit | 9211f80ed71432223e15a4f80283f6138dd63174 (patch) | |
| tree | 1916469b899ad67e25f03ee92a75fe4dd9a6ff06 | |
| parent | 69f57ef4e0c7fdbfbe3f18c5d834afae3f0ac108 (diff) | |
| download | vcpkg-9211f80ed71432223e15a4f80283f6138dd63174.tar.gz vcpkg-9211f80ed71432223e15a4f80283f6138dd63174.zip | |
[bigint/zxing-cpp] Adapter xcode 5.1.1 and set it as a dependency of zxing-cpp (#13129)
* [bigint] Adapter xcode 5.1.1
* [bigint] Add vcpkg-cmake-wrapper
* [zxing-cpp] use vcpkg bigint instead
| -rw-r--r-- | ports/bigint/CONTROL | 3 | ||||
| -rw-r--r-- | ports/bigint/fix-osx-usage.patch | 39 | ||||
| -rw-r--r-- | ports/bigint/portfile.cmake | 5 | ||||
| -rw-r--r-- | ports/bigint/usage | 5 | ||||
| -rw-r--r-- | ports/bigint/vcpkg-cmake-wrapper.cmake | 10 | ||||
| -rw-r--r-- | ports/zxing-cpp/0003-fix-dependency-bigint.patch | 50 | ||||
| -rw-r--r-- | ports/zxing-cpp/CONTROL | 4 | ||||
| -rw-r--r-- | ports/zxing-cpp/portfile.cmake | 3 |
8 files changed, 115 insertions, 4 deletions
diff --git a/ports/bigint/CONTROL b/ports/bigint/CONTROL index b47401c79..d6291ac68 100644 --- a/ports/bigint/CONTROL +++ b/ports/bigint/CONTROL @@ -1,4 +1,5 @@ Source: bigint
-Version: 2010.04.30-4
+Version: 2010.04.30
+Port-Version: 5
Homepage: https://mattmccutchen.net/bigint
Description: C++ Big Integer Library
diff --git a/ports/bigint/fix-osx-usage.patch b/ports/bigint/fix-osx-usage.patch new file mode 100644 index 000000000..f387d7b29 --- /dev/null +++ b/ports/bigint/fix-osx-usage.patch @@ -0,0 +1,39 @@ +diff --git a/BigUnsigned.hh b/BigUnsigned.hh +index adf1c00..9228753 100644 +--- a/BigUnsigned.hh ++++ b/BigUnsigned.hh +@@ -20,7 +20,7 @@ public: + typedef unsigned long Blk; + + typedef NumberlikeArray<Blk>::Index Index; +- NumberlikeArray<Blk>::N; ++ using NumberlikeArray<Blk>::N; + + protected: + // Creates a BigUnsigned with a capacity; for internal use. +@@ -84,8 +84,8 @@ public: + // BIT/BLOCK ACCESSORS + + // Expose these from NumberlikeArray directly. +- NumberlikeArray<Blk>::getCapacity; +- NumberlikeArray<Blk>::getLength; ++ using NumberlikeArray<Blk>::getCapacity; ++ using NumberlikeArray<Blk>::getLength; + + /* Returns the requested block, or 0 if it is beyond the length (as if + * the number had 0s infinitely to the left). */ +diff --git a/BigUnsignedInABase.hh b/BigUnsignedInABase.hh +index 8f9bdce..0ea89c6 100644 +--- a/BigUnsignedInABase.hh ++++ b/BigUnsignedInABase.hh +@@ -100,8 +100,8 @@ public: + Base getBase() const { return base; } + + // Expose these from NumberlikeArray directly. +- NumberlikeArray<Digit>::getCapacity; +- NumberlikeArray<Digit>::getLength; ++ using NumberlikeArray<Digit>::getCapacity; ++ using NumberlikeArray<Digit>::getLength; + + /* Returns the requested digit, or 0 if it is beyond the length (as if + * the number had 0s infinitely to the left). */ diff --git a/ports/bigint/portfile.cmake b/ports/bigint/portfile.cmake index 2a0a22adb..07c43836f 100644 --- a/ports/bigint/portfile.cmake +++ b/ports/bigint/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_download_distfile(ARCHIVE @@ -11,6 +9,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} + PATCHES fix-osx-usage.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -23,4 +22,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +configure_file(${CURRENT_PORT_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) +file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/bigint RENAME copyright) diff --git a/ports/bigint/usage b/ports/bigint/usage new file mode 100644 index 000000000..cf9dc6474 --- /dev/null +++ b/ports/bigint/usage @@ -0,0 +1,5 @@ +The package @PORT@:@TARGET_TRIPLET@ provides CMake targets:
+
+ find_package(@PORT@ CONFIG REQUIRED)
+ target_include_directories(main PRIVATE ${BIGINT_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE ${BIGINT_LIBRARIES})
diff --git a/ports/bigint/vcpkg-cmake-wrapper.cmake b/ports/bigint/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000..92972c09f --- /dev/null +++ b/ports/bigint/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,10 @@ +include(SelectLibraryConfigurations)
+
+find_path(BIGINT_INCLUDE_DIR BigInteger.hh PATH_SUFFIXES bigint)
+find_library(BIGINT_LIBRARY_DEBUG NAMES bigint NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED)
+find_library(BIGINT_LIBRARY_RELEASE NAMES bigint NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED)
+
+select_library_configurations(BIGINT)
+
+set(BIGINT_INCLUDE_DIRS ${BIGINT_INCLUDE_DIR})
+set(BIGINT_LIBRARIES ${BIGINT_LIBRARY})
diff --git a/ports/zxing-cpp/0003-fix-dependency-bigint.patch b/ports/zxing-cpp/0003-fix-dependency-bigint.patch new file mode 100644 index 000000000..1601d3e39 --- /dev/null +++ b/ports/zxing-cpp/0003-fix-dependency-bigint.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54071bd..0edd0e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -44,6 +44,12 @@ if(WIN32) + set(CMAKE_DEBUG_POSTFIX -debug) + endif() + ++# Bigint ++find_package(bigint CONFIG REQUIRED) ++ ++include_directories(${BIGINT_INCLUDE_DIRS}) ++link_libraries(${BIGINT_LIBRARIES}) ++ + # OpenCV classes + if(WITH_OPENCV) + find_package(OpenCV REQUIRED) +diff --git a/source_files.cmake b/source_files.cmake +index db3d8d4..39abe82 100644 +--- a/source_files.cmake ++++ b/source_files.cmake +@@ -1,28 +1,4 @@ + set(LIBZXING_FILES +- core/src/bigint/BigInteger.cc +- core/src/bigint/BigInteger.cc +- core/src/bigint/BigInteger.hh +- core/src/bigint/BigInteger.hh +- core/src/bigint/BigIntegerAlgorithms.cc +- core/src/bigint/BigIntegerAlgorithms.cc +- core/src/bigint/BigIntegerAlgorithms.hh +- core/src/bigint/BigIntegerAlgorithms.hh +- core/src/bigint/BigIntegerLibrary.hh +- core/src/bigint/BigIntegerLibrary.hh +- core/src/bigint/BigIntegerUtils.cc +- core/src/bigint/BigIntegerUtils.cc +- core/src/bigint/BigIntegerUtils.hh +- core/src/bigint/BigIntegerUtils.hh +- core/src/bigint/BigUnsigned.cc +- core/src/bigint/BigUnsigned.cc +- core/src/bigint/BigUnsigned.hh +- core/src/bigint/BigUnsigned.hh +- core/src/bigint/BigUnsignedInABase.cc +- core/src/bigint/BigUnsignedInABase.cc +- core/src/bigint/BigUnsignedInABase.hh +- core/src/bigint/BigUnsignedInABase.hh +- core/src/bigint/NumberlikeArray.hh +- core/src/bigint/NumberlikeArray.hh + core/src/zxing/aztec/AztecDetectorResult.cpp + core/src/zxing/aztec/AztecDetectorResult.h + core/src/zxing/aztec/AztecReader.cpp diff --git a/ports/zxing-cpp/CONTROL b/ports/zxing-cpp/CONTROL index 89a07a222..4f661dd19 100644 --- a/ports/zxing-cpp/CONTROL +++ b/ports/zxing-cpp/CONTROL @@ -1,7 +1,9 @@ Source: zxing-cpp -Version: 3.3.3-7 +Version: 3.3.3 +Port-Version: 8 Homepage: https://github.com/glassechidna/zxing-cpp Description: Barcode detection and decoding library. +Build-Depends: bigint Default-Features: opencv, iconv Feature: opencv diff --git a/ports/zxing-cpp/portfile.cmake b/ports/zxing-cpp/portfile.cmake index 3e9666390..f6fd43351 100644 --- a/ports/zxing-cpp/portfile.cmake +++ b/ports/zxing-cpp/portfile.cmake @@ -9,9 +9,12 @@ vcpkg_from_github( PATCHES 0001-opencv4-compat.patch 0002-improve-features.patch + 0003-fix-dependency-bigint.patch ) file(REMOVE ${SOURCE_PATH}/cmake/FindModules/FindIconv.cmake) +# Depends on port bigint +file(REMOVE_RECURSE ${SOURCE_PATH}/core/src/bigint) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES |
