diff --git a/ports/bigint/CONTROL b/ports/bigint/CONTROL index b47401c79c..d6291ac68d 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 0000000000..f387d7b297 --- /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::Index Index; +- NumberlikeArray::N; ++ using NumberlikeArray::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::getCapacity; +- NumberlikeArray::getLength; ++ using NumberlikeArray::getCapacity; ++ using NumberlikeArray::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::getCapacity; +- NumberlikeArray::getLength; ++ using NumberlikeArray::getCapacity; ++ using NumberlikeArray::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 2a0a22adbe..07c43836fb 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 0000000000..cf9dc64746 --- /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 0000000000..92972c09fa --- /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 0000000000..1601d3e399 --- /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 89a07a2227..4f661dd19a 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 3e96663907..f6fd43351e 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