From 22ffdea9e65056a4e1c5307963962e05b5b6f0dc Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Fri, 14 Mar 2025 22:03:12 +0100 Subject: [PATCH] package/tesseract-ocr: needs gcc >= 8 Since Buildroot commit [1] tesseract-ocr fails to build with gcc 7, with error: src/api/baseapi.cpp:67:10: fatal error: filesystem: No such file or directory #include // for std::filesystem ^~~~~~~~~~~~ In Buildroot, tesseract-ocr has a C++17 requirement captured as gcc >= 7. Gcc 7 has only a partial and experimental C++17 support, which was sufficient, prior [1]. The tesseract-ocr upstream commit [2] introduced a usage of std::filesystem. This commit is included in version 5.5.0, bumped in [1]. The C++17 with std::filesystem support was introduced in gcc 8.1. See [3]. This commit fixes the issue by raising the gcc version requirement to 8.x. Fixes: f32da8b9844ae5f1b9dc6b7a89d7d9bd9d194f55 [1] https://gitlab.com/buildroot.org/buildroot/-/commit/f32da8b9844ae5f1b9dc6b7a89d7d9bd9d194f55 [2] https://github.com/tesseract-ocr/tesseract/commit/4e42f9de541f21acb010886925afe42094a15dfe [3] https://gcc.gnu.org/gcc-8/changes.html#libstdcxx Signed-off-by: Julien Olivain Signed-off-by: Arnout Vandecappelle --- package/tesseract-ocr/Config.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/tesseract-ocr/Config.in b/package/tesseract-ocr/Config.in index 4d9b78733e..79a27780b2 100644 --- a/package/tesseract-ocr/Config.in +++ b/package/tesseract-ocr/Config.in @@ -1,13 +1,13 @@ -comment "tesseract-ocr needs a toolchain w/ threads, C++, gcc >= 7, dynamic library, wchar" +comment "tesseract-ocr needs a toolchain w/ threads, C++, gcc >= 8, dynamic library, wchar" depends on BR2_USE_MMU depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || BR2_STATIC_LIBS || !BR2_USE_WCHAR + !BR2_TOOLCHAIN_GCC_AT_LEAST_8 || BR2_STATIC_LIBS || !BR2_USE_WCHAR menuconfig BR2_PACKAGE_TESSERACT_OCR bool "tesseract-ocr" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # C++17 filesystem depends on BR2_USE_MMU # fork() depends on !BR2_STATIC_LIBS depends on BR2_USE_WCHAR