From c40e055e7b847f6ec4db7b32bdc63751228f1fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Nadeau?= Date: Fri, 10 Jan 2025 20:44:26 -0500 Subject: [PATCH 1/2] Fix zxing include path Official pkgConfig for ZXing add ZXing/ to include path. https://github.com/zxing-cpp/zxing-cpp/blob/master/core/zxing.pc.in --- recipes/zxing-cpp/all/conanfile.py | 1 + recipes/zxing-cpp/all/test_package/test_package.cpp | 10 +++++----- .../zxing-cpp/all/test_package/test_package_1.1.cpp | 12 ++++++------ .../zxing-cpp/all/test_package/test_package_2.0.cpp | 10 +++++----- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/recipes/zxing-cpp/all/conanfile.py b/recipes/zxing-cpp/all/conanfile.py index d264585049432..f176d28f05c3c 100644 --- a/recipes/zxing-cpp/all/conanfile.py +++ b/recipes/zxing-cpp/all/conanfile.py @@ -123,6 +123,7 @@ def package_info(self): self.cpp_info.set_property("cmake_file_name", "ZXing") self.cpp_info.set_property("cmake_target_name", "ZXing::ZXing") self.cpp_info.set_property("pkg_config_name", "zxing") + self.cpp_info.includedirs.append(os.path.join("include", "ZXing")) self.cpp_info.libs = ["ZXingCore" if Version(self.version) < "1.1" else "ZXing"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["pthread", "m"] diff --git a/recipes/zxing-cpp/all/test_package/test_package.cpp b/recipes/zxing-cpp/all/test_package/test_package.cpp index 52aea5ecac07b..ecd2732027961 100644 --- a/recipes/zxing-cpp/all/test_package/test_package.cpp +++ b/recipes/zxing-cpp/all/test_package/test_package.cpp @@ -1,8 +1,8 @@ -#include "ZXing/BarcodeFormat.h" -#include "ZXing/MultiFormatWriter.h" -#include "ZXing/BitMatrix.h" -#include "ZXing/ByteMatrix.h" -#include "ZXing/TextUtfEncoding.h" +#include "BarcodeFormat.h" +#include "MultiFormatWriter.h" +#include "BitMatrix.h" +#include "ByteMatrix.h" +#include "TextUtfEncoding.h" #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" diff --git a/recipes/zxing-cpp/all/test_package/test_package_1.1.cpp b/recipes/zxing-cpp/all/test_package/test_package_1.1.cpp index 43ef58f9108d2..3634b2945ca33 100644 --- a/recipes/zxing-cpp/all/test_package/test_package_1.1.cpp +++ b/recipes/zxing-cpp/all/test_package/test_package_1.1.cpp @@ -1,9 +1,9 @@ -#include "ZXing/BarcodeFormat.h" -#include "ZXing/BitMatrix.h" -#include "ZXing/BitMatrixIO.h" -#include "ZXing/CharacterSet.h" -#include "ZXing/MultiFormatWriter.h" -#include "ZXing/TextUtfEncoding.h" +#include "BarcodeFormat.h" +#include "BitMatrix.h" +#include "BitMatrixIO.h" +#include "CharacterSet.h" +#include "MultiFormatWriter.h" +#include "TextUtfEncoding.h" #include #include diff --git a/recipes/zxing-cpp/all/test_package/test_package_2.0.cpp b/recipes/zxing-cpp/all/test_package/test_package_2.0.cpp index 7f93ccdbfcc59..87daf500485d1 100644 --- a/recipes/zxing-cpp/all/test_package/test_package_2.0.cpp +++ b/recipes/zxing-cpp/all/test_package/test_package_2.0.cpp @@ -1,8 +1,8 @@ -#include "ZXing/BarcodeFormat.h" -#include "ZXing/BitMatrix.h" -#include "ZXing/BitMatrixIO.h" -#include "ZXing/CharacterSet.h" -#include "ZXing/MultiFormatWriter.h" +#include "BarcodeFormat.h" +#include "BitMatrix.h" +#include "BitMatrixIO.h" +#include "CharacterSet.h" +#include "MultiFormatWriter.h" #include #include From e559dfef45a8974da86c95c7192a8dab2cfd0280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Nadeau?= Date: Sat, 11 Jan 2025 14:19:20 -0500 Subject: [PATCH 2/2] Fix build with gcc >= 13 See https://github.com/zxing-cpp/zxing-cpp/commit/53da58625dcd519b7c10e2349a83c9bd10105cf7 Fixed in zxing-cpp >= 1.4.0 --- recipes/zxing-cpp/all/conandata.yml | 7 +++++ .../patches/1.0.8-0005-include-cstdint.patch | 31 +++++++++++++++++++ .../patches/1.3.0-0001-include-cstdint.patch | 11 +++++++ 3 files changed, 49 insertions(+) create mode 100644 recipes/zxing-cpp/all/patches/1.0.8-0005-include-cstdint.patch create mode 100644 recipes/zxing-cpp/all/patches/1.3.0-0001-include-cstdint.patch diff --git a/recipes/zxing-cpp/all/conandata.yml b/recipes/zxing-cpp/all/conandata.yml index 2d71c52b48c34..56d94a90d72a5 100644 --- a/recipes/zxing-cpp/all/conandata.yml +++ b/recipes/zxing-cpp/all/conandata.yml @@ -27,6 +27,10 @@ patches: - patch_file: "patches/1.4.0-0001-fix-string-view.patch" patch_description: "fix compilation error for string_view on several compilers" patch_type: "portability" + "1.3.0": + - patch_file: "patches/1.3.0-0001-include-cstdint.patch" + patch_description: "include cstdint" + patch_type: "portability" "1.0.8": - patch_file: "patches/1.0.8-0001-Fix-C2327-for-MSVC-2015.patch" patch_description: "fix compilation error C2327 on MSVC 2015" @@ -40,3 +44,6 @@ patches: - patch_file: "patches/1.0.8-0004-include-cstddef.patch" patch_description: "include cstddef" patch_type: "portability" + - patch_file: "patches/1.0.8-0005-include-cstdint.patch" + patch_description: "include cstdint" + patch_type: "portability" diff --git a/recipes/zxing-cpp/all/patches/1.0.8-0005-include-cstdint.patch b/recipes/zxing-cpp/all/patches/1.0.8-0005-include-cstdint.patch new file mode 100644 index 0000000000000..c7b201e4d0295 --- /dev/null +++ b/recipes/zxing-cpp/all/patches/1.0.8-0005-include-cstdint.patch @@ -0,0 +1,31 @@ +--- core/src/DecodeHints.h ++++ core/src/DecodeHints.h +@@ -16,6 +16,7 @@ + * limitations under the License. + */ + ++#include + #include + #include + #include +--- core/src/pdf417/PDFCodewordDecoder.cpp ++++ core/src/pdf417/PDFCodewordDecoder.cpp +@@ -17,6 +17,7 @@ + + #include "PDFCodewordDecoder.h" + ++#include + #include + #include + #include +--- core/src/textcodec/JPTextEncoder.cpp ++++ core/src/textcodec/JPTextEncoder.cpp +@@ -37,6 +37,8 @@ + + #include "JPTextEncoder.h" + ++#include ++ + /* + * This data is derived from Unicode 1.1, + * JIS X 0208 (1990) to Unicode mapping table version 0.9 . diff --git a/recipes/zxing-cpp/all/patches/1.3.0-0001-include-cstdint.patch b/recipes/zxing-cpp/all/patches/1.3.0-0001-include-cstdint.patch new file mode 100644 index 0000000000000..6b0697c0068d4 --- /dev/null +++ b/recipes/zxing-cpp/all/patches/1.3.0-0001-include-cstdint.patch @@ -0,0 +1,11 @@ +--- core/src/textcodec/JPTextEncoder.cpp ++++ core/src/textcodec/JPTextEncoder.cpp +@@ -37,6 +37,8 @@ + + #include "JPTextEncoder.h" + ++#include ++ + /* + * This data is derived from Unicode 1.1, + * JIS X 0208 (1990) to Unicode mapping table version 0.9 .