Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ports/bigint/CONTROL
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions ports/bigint/fix-osx-usage.patch
Original file line number Diff line number Diff line change
@@ -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). */
5 changes: 3 additions & 2 deletions ports/bigint/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_download_distfile(ARCHIVE
Expand All @@ -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})
Expand All @@ -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)
5 changes: 5 additions & 0 deletions ports/bigint/usage
Original file line number Diff line number Diff line change
@@ -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})
10 changes: 10 additions & 0 deletions ports/bigint/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -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})
50 changes: 50 additions & 0 deletions ports/zxing-cpp/0003-fix-dependency-bigint.patch
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion ports/zxing-cpp/CONTROL
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions ports/zxing-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down