Repository: conan-io/conan-center-index

Issue:
[package] Tesseract/5.0.0: GCC Requirement too restrictive
I am working to compile the tesseract library into binaries for deployment on various Linux distros (with Ubuntu 18.04+ as my primary target right now).

The tesseract package (versions >=5.0.0) uses too restrictive of a GCC version (9+) to support C++17, when GCC 7 supports the C++17 standard (see references below). I have tried many different combinations of docker images/compilers and cannot produce a binary that "just works" on Ubuntu 18.04 due to GLIBC/CXX issues.

For reference: 
 * [GCC C++17 standard support](https://gcc.gnu.org/projects/cxx-status.html)
 * [Clang C++ Standard support](https://clang.llvm.org/cxx_status.html) - seems full support is around clang ~7
 * [Visual Studio C++ Standard Support](https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170)

I've tried a combination of different solutions to target Ubuntu 18.04 (with glibc 2.27):
* Conanio/gcc9 - glibc (2.30)
* Conanio/gcc8 - glibc (2.27) - fails to meet tesseract conanfile min gcc >=9 criteria, likely would work to meet needs
* Conanio/gcc7 - glibc (2.26) - fails to meet tesseract conanfile  min gcc >= 9 criteria, likely would work to meed needs
* Conanio/clang7 - glibc (2.28), glibc too new and won't be compatible with target glibc
* Using various centos images with upgrading the gcc to version 9.0 (GLIBC compatibility issues gone, but GLIBCXX compatibility issues)


### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **tesseract/5.0.0**
  * Operating System+version: **Linux Ubuntu 18.04**
  * Compiler+version: **GCC 9**
  * Docker image: **conanio/gcc9**
  * Conan version: **conan 1.18.0**
  * Python version: **Python 3.7.4**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)

Not using a custom profile


### Steps to reproduce (Include if Applicable)

1. Use docker to build lightweight project that uses tesseract in `conanio/gcc9`, builds against GLIBC 2.30
2. `docker cp` the binaries to an `ubuntu:18.04` image, uses GLIBC 
3. Run `ldd /path/to/binary` to confirm GLIBC/GLIBCXX compatiblity issues


### Logs (Include/Attach if Applicable)
<details><summary>ldd result on Ubuntu 18.04 for binary built with conanio/gcc9</summary>

```
# ldd libocr.so
./libocr.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./libocr.so)
./libocr.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./libocr.so)
	linux-vdso.so.1 (0x00007fffb9d83000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8c536f6000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8c5336d000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8c5314e000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8c52db0000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8c529bf000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f8c54de5000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8c527a7000)
```

</details>


Discussion:

Resolving patch:
diff --git a/recipes/tesseract/all/conanfile.py b/recipes/tesseract/all/conanfile.py
--- a/recipes/tesseract/all/conanfile.py
+++ b/recipes/tesseract/all/conanfile.py
@@ -82,7 +82,7 @@ def validate(self):
             # 5.0.0 requires C++-17 compiler
             minimal_version = {
                 "Visual Studio": "16",
-                "gcc": "9",
+                "gcc": "7",
                 "clang": "7",
                 "apple-clang": "11"
             }


Test patch: