Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/tesseract/.github/workflows/cmake.yml @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 name: cmake | |
| 2 # cmake build of tesseract and training tools on ubuntu and macOS homebrew using Ninja. | |
| 3 # test command line version of tesseract. run basicapitest. | |
| 4 on: | |
| 5 #push: | |
| 6 schedule: | |
| 7 - cron: 0 21 * * * | |
| 8 | |
| 9 jobs: | |
| 10 basictests: | |
| 11 name: ${{ matrix.config.name }} | |
| 12 runs-on: ${{ matrix.config.os }} | |
| 13 strategy: | |
| 14 fail-fast: false | |
| 15 matrix: | |
| 16 config: | |
| 17 - { name: macos-14-clang-15-cmake, os: macos-14, cxx: clang++ } # default | |
| 18 - { name: macos-14-gcc-14-cmake, os: macos-14, cxx: g++-14 } #installed | |
| 19 - { name: macos-15-clang-cmake, os: macos-15, cxx: clang++ } # default | |
| 20 | |
| 21 - { name: ubuntu-22.04-clang-15-cmake, os: ubuntu-22.04, cxx: clang++-15 } #installed | |
| 22 | |
| 23 - { name: ubuntu-22.04-gcc-12-cmake, os: ubuntu-22.04, cxx: g++-12 } #installed | |
| 24 - { name: ubuntu-22.04-gcc-11-cmake, os: ubuntu-22.04, cxx: g++-11 } #installed | |
| 25 - { name: ubuntu-20.04-gcc-10-cmake, os: ubuntu-20.04, cxx: g++-10 } #installed | |
| 26 - { name: ubuntu-20.04-gcc-9-cmake, os: ubuntu-20.04, cxx: g++-9 } #installed | |
| 27 | |
| 28 steps: | |
| 29 - name: Install compilers on Linux | |
| 30 run: | | |
| 31 sudo apt-get update | |
| 32 sudo apt-get install ${{ matrix.config.cxx }} -y | |
| 33 if: runner.os == 'Linux' | |
| 34 | |
| 35 - name: Install dependencies on Linux | |
| 36 run: | | |
| 37 sudo apt-get install autoconf libleptonica-dev -y | |
| 38 sudo apt-get install libarchive-dev libcurl4-openssl-dev -y | |
| 39 sudo apt-get install libpango1.0-dev -y | |
| 40 sudo apt-get install cabextract -y | |
| 41 sudo apt-get install ninja-build -y | |
| 42 cmake --version | |
| 43 if: runner.os == 'Linux' | |
| 44 | |
| 45 - name: Install dependencies on macOS | |
| 46 run: | | |
| 47 brew install autoconf automake | |
| 48 brew install leptonica | |
| 49 # brew install libarchive | |
| 50 brew install pango | |
| 51 brew install icu4c && brew link icu4c | |
| 52 brew install cabextract | |
| 53 brew install ninja | |
| 54 ninja --version | |
| 55 cmake --version | |
| 56 clang++ --version | |
| 57 g++ --version | |
| 58 if: runner.os == 'macOS' | |
| 59 | |
| 60 - name: Checkout Source | |
| 61 uses: actions/checkout@v4 | |
| 62 with: | |
| 63 submodules: recursive | |
| 64 | |
| 65 - name: Configure Tesseract (Linux) | |
| 66 run: | | |
| 67 mkdir build | |
| 68 mkdir inst | |
| 69 cmake \ | |
| 70 -S . \ | |
| 71 -B build \ | |
| 72 -G Ninja \ | |
| 73 -DCMAKE_BUILD_TYPE=Release \ | |
| 74 -DOPENMP_BUILD=OFF \ | |
| 75 -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ | |
| 76 -DCMAKE_INSTALL_PREFIX:PATH=inst | |
| 77 if: runner.os == 'Linux' | |
| 78 | |
| 79 - name: Configure Tesseract (macOS) | |
| 80 shell: bash | |
| 81 run: | | |
| 82 set -e | |
| 83 export PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig:$(brew --prefix)/opt/libarchive/lib/pkgconfig:/$(brew --prefix)/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH | |
| 84 export LDFLAGS="-L/usr/local/opt/icu4c/lib" | |
| 85 export CPPFLAGS="-I/usr/local/opt/icu4c/include" | |
| 86 mkdir build | |
| 87 mkdir inst | |
| 88 cmake \ | |
| 89 -S . \ | |
| 90 -B build \ | |
| 91 -G Ninja \ | |
| 92 -DCMAKE_BUILD_TYPE=Release \ | |
| 93 -DOPENMP_BUILD=OFF \ | |
| 94 -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ | |
| 95 -DCMAKE_INSTALL_PREFIX:PATH=inst | |
| 96 if: runner.os == 'macOS' | |
| 97 | |
| 98 - name: Build Tesseract | |
| 99 run: | | |
| 100 cmake --build build --config Release --target install | |
| 101 | |
| 102 - name: Display Tesseract Version | |
| 103 run: | | |
| 104 build/inst/bin/tesseract -v | |
| 105 | |
| 106 - name: Display Training Tools Version | |
| 107 run: | | |
| 108 build/inst/bin/lstmtraining -v | |
| 109 build/inst/bin/text2image -v | |
| 110 | |
| 111 - name: Download fonts, tessdata and langdata required for tests | |
| 112 run: | | |
| 113 git clone https://github.com/egorpugin/tessdata tessdata_unittest | |
| 114 cp tessdata_unittest/fonts/* test/testing/ | |
| 115 mv tessdata_unittest/* ../ | |
| 116 | |
| 117 - name: List languages in different tessdata-dir | |
| 118 run: | | |
| 119 build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata | |
| 120 build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata_best | |
| 121 build/inst/bin/tesseract --list-langs --tessdata-dir ../tessdata_fast | |
| 122 | |
| 123 - name: Run Tesseract on test images in different languages | |
| 124 run: | | |
| 125 build/inst/bin/tesseract test/testing/phototest.tif - --oem 1 --tessdata-dir ../tessdata | |
| 126 build/inst/bin/tesseract test/testing/raaj.tif - -l hin --oem 1 --tessdata-dir ../tessdata | |
| 127 build/inst/bin/tesseract test/testing/viet.tif - -l vie --oem 1 --tessdata-dir ../tessdata | |
| 128 build/inst/bin/tesseract test/testing/hebrew.png - -l heb --oem 1 --tessdata-dir ../tessdata | |
| 129 build/inst/bin/tesseract test/testing/eurotext.tif - -l fra --oem 1 --tessdata-dir ../tessdata_best | |
| 130 build/inst/bin/tesseract test/testing/arabic.tif - -l ara --oem 1 --psm 6 --tessdata-dir ../tessdata | |
| 131 | |
| 132 - name: Build and run basicapitest (Linux) | |
| 133 run: | | |
| 134 export "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build/inst/lib/pkgconfig/:$PKG_CONFIG_PATH" | |
| 135 cd test | |
| 136 ${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp "-I$GITHUB_WORKSPACE/build/inst/include" "-L$GITHUB_WORKSPACE/build/inst/lib" $(pkg-config --cflags --libs tesseract lept libarchive libcurl) -pthread -std=c++17 | |
| 137 ./basicapitest | |
| 138 if: runner.os == 'Linux' | |
| 139 | |
| 140 - name: Build and run basicapitest (macOS) | |
| 141 run: | | |
| 142 export "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build/inst/lib/pkgconfig/:$(brew --prefix)/opt/libarchive/lib/pkgconfig:$(brew --prefix)/Library/Homebrew/os/mac/pkgconfig/11:$PKG_CONFIG_PATH" | |
| 143 cd test | |
| 144 ${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp "-I$GITHUB_WORKSPACE/build/inst/include" "-L$GITHUB_WORKSPACE/build/inst/lib" $(pkg-config --cflags --libs tesseract lept libcurl) -pthread -std=c++17 | |
| 145 ./basicapitest | |
| 146 if: runner.os == 'macOS' | |
| 147 | |
| 148 - name: Display Compiler Version | |
| 149 run: | | |
| 150 ${{ matrix.config.cxx }} --version | |
| 151 pwd | |
| 152 ls -la | |
| 153 # git log -3 --pretty=format:'%h %ad %s | %an' | |
| 154 if: always() |
