comparison mupdf-source/thirdparty/tesseract/.github/workflows/cmake-win64.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 # Based on https://github.com/zdenop/tesserocr/actions/runs/691257659/workflow
2 # Build Tesseract on Windows using cmake. No Training Tools.
3 name: cmake-win64
4 on:
5 #push:
6 schedule:
7 - cron: 0 23 * * *
8 workflow_dispatch:
9
10 env:
11 ILOC: d:/a/local
12 png_ver: 1643
13
14 jobs:
15 build:
16 name: cmake-win64
17 runs-on: windows-latest
18 steps:
19 - uses: ilammy/setup-nasm@v1
20 - uses: microsoft/setup-msbuild@v2
21 - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
22 uses: actions/checkout@v4
23 with:
24 submodules: recursive
25 - run: git fetch --prune --unshallow --tags
26
27 - name: Get the version
28 id: get_version
29 continue-on-error: true
30 run: |
31 $git_info=$(git describe --tags HEAD)
32 $stamp=$(date +'%Y-%m-%d_%H%M%S')
33 echo "version=${git_info}" >> $env:GITHUB_OUTPUT
34 echo "stamp=${stamp}" >> $env:GITHUB_OUTPUT
35
36 - name: Setup Installation Location
37 run: |
38 mkdir ${{env.ILOC}}
39
40 - name: Uninstall Perl
41 run: |
42 choco uninstall strawberryperl
43
44 - name: Build and Install zlib-ng
45 shell: cmd
46 run: |
47 git clone --depth 1 https://github.com/zlib-ng/zlib-ng.git
48 cd zlib-ng
49 cmake -Bbuild -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DBUILD_SHARED_LIBS=OFF -DZLIB_COMPAT=ON -DZLIB_ENABLE_TESTS=OFF -DINSTALL_UTILS=OFF
50 cmake --build build --target install
51 cd ..
52
53 - name: Build and Install libpng
54 shell: cmd
55 run: |
56 curl -sSL -o lpng${{env.png_ver}}.zip https://download.sourceforge.net/libpng/lpng${{env.png_ver}}.zip
57 unzip.exe -qq lpng${{env.png_ver}}.zip
58 cd lpng${{env.png_ver}}
59 cmake -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DPNG_TESTS=OFF -DPNG_SHARED=OFF
60 cmake --build build --target install
61 cd ..
62
63 - name: Build and Install libjpeg
64 shell: cmd
65 run: |
66 git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git
67 cd libjpeg-turbo
68 cmake -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DWITH_TURBOJPEG=OFF -DENABLE_SHARED=OFF
69 cmake --build build --target install
70 cd ..
71
72 - name: Build and Install jbigkit
73 shell: cmd
74 run: |
75 git clone --depth 1 https://github.com/zdenop/jbigkit.git
76 cd jbigkit
77 cmake -Bbuild -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DBUILD_PROGRAMS=OFF -DBUILD_TOOLS=OFF -DCMAKE_WARN_DEPRECATED=OFF
78 cmake --build build --target install
79 cd ..
80
81 - name: Build and Install libtiff
82 shell: cmd
83 run: |
84 git clone -c advice.detachedHead=false -b "v4.6.0" --depth 1 https://gitlab.com/libtiff/libtiff.git
85 cd libtiff
86 cmake -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -Dtiff-tools=OFF -Dtiff-tests=OFF -Dtiff-contrib=OFF -Dtiff-docs=OFF
87 cmake --build build --target install
88 cd ..
89
90 - name: Build and Install leptonica
91 shell: cmd
92 run: |
93 echo "Building leptonica..."
94 git clone --depth 1 https://github.com/DanBloomberg/leptonica.git
95 cd leptonica
96 cmake -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DSW_BUILD=OFF -DBUILD_PROG=OFF -DBUILD_SHARED_LIBS=ON
97 cmake --build build --target install
98
99 - name: Remove not needed tools Before building tesseract
100 shell: cmd
101 run: >
102 rm -Rf ${{env.ILOC}}/bin/*.exe
103
104 - name: Build and Install tesseract
105 shell: cmd
106 run: |
107 cmake -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DENABLE_LTO=ON -DBUILD_TRAINING_TOOLS=OFF -DFAST_FLOAT=ON -DGRAPHICS_DISABLED=ON -DOPENMP_BUILD=OFF
108 cmake --build build --target install
109
110 - name: Upload Build Results
111 uses: actions/upload-artifact@v4
112 with:
113 name: tesseract-${{ steps.get_version.outputs.version }}-${{steps.get_version.outputs.stamp}}-VS2019_win64
114 path: ${{env.ILOC}}
115 retention-days: 5
116
117 - name: Display Tesseract Version and Test Command Line Usage
118 shell: cmd
119 run: |
120 curl -sSL https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata --output ${{env.ILOC}}/share/tessdata/eng.traineddata
121 curl -sSL https://github.com/tesseract-ocr/tessdata/raw/main/osd.traineddata --output ${{env.ILOC}}/share/tessdata/osd.traineddata
122 echo "Setting TESSDATA_PREFIX..."
123 set TESSDATA_PREFIX=${{env.ILOC}}/share/tessdata
124 echo "Setting PATH..."
125 set PATH=${{env.ILOC}}/bin;%PATH%
126 echo "Checking installed tesseract version..."
127 tesseract -v
128 echo "Checking installed langs"
129 tesseract --list-langs
130 echo "Checking OCR process"
131 tesseract test/testing/phototest.tif -