Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c4740e0
add NSIS script for Windows installer
zdenop Dec 27, 2012
1a697cc
Update NSIS configuration
stweil Dec 3, 2015
bb20712
Add Makefile and rules for NSIS
stweil Dec 4, 2015
730df1f
Add plugin needed by installer for Windows
stweil Dec 7, 2015
3e64c3d
Add NSIS include file needed by installer for Windows
stweil Dec 7, 2015
6533041
Add trained language files needed by installer for Windows
stweil Dec 7, 2015
1ac4264
Update installer for Windows
reretter Mar 17, 2018
3d79d68
Partially revert commit be1393b1e8f6a545e942f747960ab212065122ab
stweil Sep 12, 2018
d42471a
Add manual pages in HTML format and helper for Tesseract command line
stweil Mar 16, 2019
0c21802
Update NSIS script
stweil Jun 23, 2019
81ec447
Don't remove the installation directory recursively
stweil Oct 10, 2019
0a0970a
Fix installation for Lao.traineddata
stweil Oct 30, 2019
1a9e964
Add GitHub action for Tesseract installer for Windows
stweil Jan 15, 2020
d4d2141
Improve GitHub actions
stweil Feb 3, 2020
ead7b4e
Use parallel jobs to build 32 and 64 bit installer with GitHub actions
stweil Feb 3, 2020
c29c246
Update rule for getting repository key
stweil Jan 5, 2021
f519590
Don't run CI from sw.yml for windows branch
stweil Jan 5, 2021
edc3efd
Update build script for Ubuntu focal
stweil Jan 6, 2021
6dbb998
Use Ubuntu 20.04 for GitHub actions
stweil Jan 6, 2021
3a143e5
Add docbook-xml to required packages (needed for doc)
stweil Jan 13, 2021
27e24c8
Add script for building installers
stweil Jun 23, 2019
b4bcf8f
Update download URL for traineddata files
stweil Oct 31, 2021
f67fa78
Use unicode for NSIS installer
stweil Dec 6, 2021
f5c85c5
Update INetC.dll for unicode
stweil Jan 18, 2022
f38a967
Update CI build script for installer
stweil Jul 8, 2022
47dbb9d
Fix build for ScrollView.jar
stweil Dec 9, 2022
3845fcb
Sign executables
stweil Dec 13, 2022
99fed13
nsis: Add more file properties to installer
stweil Dec 22, 2022
5ef0aa8
Update installer build script
stweil Mar 24, 2023
add987d
nsis: Update configuration for use with pacman
stweil Mar 25, 2023
25ca488
Update Ubuntu runner for GitHub action
stweil Mar 25, 2023
c8847c9
Test new installer cross build with pacman and msys
stweil Mar 25, 2023
5c83800
Use gnu_printf for Windows build
stweil Mar 31, 2023
43dc8c2
Update used GitHub actions
stweil May 3, 2024
1635e97
Update installer for Windows (replace frk by deu_latf)
stweil May 19, 2024
9b91ca8
Update CI workflow for installer (now uses latest Ubuntu)
stweil May 19, 2024
3546cb9
sorted Additional languages
kumarram27 Sep 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

# GitHub actions - Create Tesseract installer for Windows

# Author: Stefan Weil (2010-2024)

set -e
set -x

LANG=C.UTF-8

ARCH=$1

if test "$ARCH" != "i686"; then
ARCH=x86_64
MINGW=/mingw64
fi

ROOTDIR=$PWD
DISTDIR=$ROOTDIR/dist
HOST=$ARCH-w64-mingw32
BUILDDIR=bin/ndebug/$HOST-$TAG
PKG_ARCH=mingw64-${ARCH/_/-}

# Install packages.
sudo apt-get update --quiet
sudo apt-get install --assume-yes --no-install-recommends --quiet \
asciidoc xsltproc docbook-xml docbook-xsl \
automake dpkg-dev libtool pkg-config default-jdk-headless \
mingw-w64-tools nsis g++-mingw-w64-${ARCH/_/-} \
makepkg pacman-package-manager

# Install pacman-package-manager and its dependencies (from Ubuntu 22.10).
# sudo curl -Os http://de.archive.ubuntu.com/ubuntu/pool/universe/p/pacman-package-manager/pacman-package-manager_6.0.1-4_amd64.deb
# sudo curl -Os http://de.archive.ubuntu.com/ubuntu/pool/universe/p/pacman-package-manager/libalpm13_6.0.1-4_amd64.deb
# sudo curl -Os http://de.archive.ubuntu.com/ubuntu/pool/universe/p/pacman-package-manager/makepkg_6.0.1-4_amd64.deb
# sudo dpkg -i *.deb || true
# sudo apt-get install --fix-broken --assume-yes --no-install-recommends --quiet

# Configure pacman.

# Enable mirrorlist.
sudo sed -Ei 's/^#.*(Include.*mirrorlist)/\1/' /etc/pacman.conf
(
# Add msys key for pacman.
cd /usr/share/keyrings
sudo curl -Os https://raw.githubusercontent.com/msys2/MSYS2-keyring/master/msys2.gpg
sudo curl -Os https://raw.githubusercontent.com/msys2/MSYS2-keyring/master/msys2-revoked
sudo curl -Os https://raw.githubusercontent.com/msys2/MSYS2-keyring/master/msys2-trusted
)
(
# Add active environments for pacman.
# See https://www.msys2.org/docs/repos-mirrors/.
sudo mkdir -p /etc/pacman.d
cd /etc/pacman.d
cat <<eod | sudo tee mirrorlist >/dev/null
[mingw64]
Include = /etc/pacman.d/mirrorlist.mingw
eod
sudo curl -O https://raw.githubusercontent.com/msys2/MSYS2-packages/master/pacman-mirrors/mirrorlist.mingw
# sudo curl -O https://raw.githubusercontent.com/msys2/MSYS2-packages/master/pacman-mirrors/mirrorlist.msys
)

sudo pacman-key --init
sudo pacman-key --populate msys2
sudo pacman -Syu --noconfirm

# Install required pacman packages.
sudo pacman -S --noconfirm \
mingw-w64-x86_64-curl-winssl \
mingw-w64-x86_64-giflib \
mingw-w64-x86_64-icu \
mingw-w64-x86_64-leptonica \
mingw-w64-x86_64-libarchive \
mingw-w64-x86_64-libidn2 \
mingw-w64-x86_64-openjpeg2 \
mingw-w64-x86_64-openssl \
mingw-w64-x86_64-pango \
mingw-w64-x86_64-libpng \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-libwebp

sudo ln -sf $PWD/.github/workflows/pkg-config-crosswrapper /usr/bin/$HOST-pkg-config

TAG=$(cat VERSION).$(date +%Y%m%d)

git config --global user.email "[email protected]"
git config --global user.name "Stefan Weil"
git tag -a v$TAG -m "Tesseract $TAG"

# Run autogen.
./autogen.sh

# Build Tesseract installer.
mkdir -p $BUILDDIR && cd $BUILDDIR

# Run configure.
PKG_CONFIG_PATH=$MINGW/lib/pkgconfig
export PKG_CONFIG_PATH
../../../configure --disable-openmp --host=$HOST --prefix=/usr/$HOST \
CXX=$HOST-g++-posix \
CXXFLAGS="-fno-math-errno -Wall -Wextra -Wpedantic -g -O2 -isystem $MINGW/include" \
LDFLAGS="-L$MINGW/lib"

make install-jars install training-install html winsetup prefix=$PWD/usr/$HOST

# Copy result for upload.
mkdir -p $DISTDIR && cp nsis/tesseract-ocr-w*-setup-*.exe $DISTDIR
46 changes: 46 additions & 0 deletions .github/workflows/installer-for-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# GitHub actions - Create Tesseract installer for Windows

name: Cross build for Windows

on:
push:
branches:
- 'windows'

# Trigger workflow in GitHub web frontend or from API.
workflow_dispatch:
inputs:
targets:
description: 'Target operating system'
required: true
default: 'Windows (64 bit)'
type: choice
options:
- 'Windows (32 bit)'
- 'Windows (64 bit)'

jobs:
build32:
# Disable 32 bit builds.
if: github.repository == '_UB-Mannheim/tesseract'
runs-on: [ubuntu-24.04]
steps:
- uses: actions/checkout@v4
- name: Build Tesseract installer (32 bit)
run: .github/workflows/build.sh i686
- uses: actions/upload-artifact@v4
with:
name: Tesseract Installer for Windows (32 bit)
path: dist

build64:
if: github.repository == 'UB-Mannheim/tesseract'
runs-on: [ubuntu-24.04]
steps:
- uses: actions/checkout@v4
- name: Build Tesseract installer (64 bit)
run: .github/workflows/build.sh x86_64
- uses: actions/upload-artifact@v4
with:
name: Tesseract Installer for Windows (64 bit)
path: dist
54 changes: 54 additions & 0 deletions .github/workflows/pkg-config-crosswrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#! /bin/sh
# pkg-config wrapper for cross-building
# Sets pkg-config search path to search multiarch and historical cross-compiling paths.

# If the user has already set PKG_CONFIG_LIBDIR, believe it (even if empty):
# it's documented to be an override
if [ x"${PKG_CONFIG_LIBDIR+set}" = x ]; then
# GNU triplet for the compiler, e.g. i486-linux-gnu for Debian i386,
# i686-linux-gnu for Ubuntu i386
basename="$(basename "$0")"
triplet="${basename%-pkg-config}"
# Normalized multiarch path if any, e.g. i386-linux-gnu for i386
dpkg-architecture >/dev/null 2>&1
if [ "$?" != 0 ]; then
# dpkg-architecture is missing.
echo "Please install dpkg-dev to use pkg-config when cross-building" >&2
exit 1
fi
multiarch="$(dpkg-architecture -t"${triplet}" -qDEB_HOST_MULTIARCH 2>/dev/null)"
# Native multiarch path
native_multiarch="$(cat /usr/lib/pkg-config.multiarch)"

# This can be used for native builds as well, in that case, just exec pkg-config "$@" directly.
if [ "$native_multiarch" = "$multiarch" ]; then
exec pkg-config "$@"
fi

PKG_CONFIG_LIBDIR="/usr/local/${triplet}/lib/pkgconfig"
# For a native build we would also want to append /usr/local/lib/pkgconfig
# at this point; but this is a cross-building script, so don't
PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/local/share/pkgconfig"

if [ -n "$multiarch" ]; then
PKG_CONFIG_LIBDIR="/usr/local/lib/${multiarch}/pkgconfig:$PKG_CONFIG_LIBDIR"
PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/lib/${multiarch}/pkgconfig"
fi

PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/${triplet}/lib/pkgconfig"
# For a native build we would also want to append /usr/lib/pkgconfig
# at this point; but this is a cross-building script, so don't
# If you want to allow use of un-multiarched -dev packages for crossing
# (at the risk of finding build-arch stuff you didn't want, if not in a clean chroot)
# Uncomment the next line:
# PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/lib/pkgconfig"
# ... but on Ubuntu we rely cross-building with non-multiarch libraries:
if dpkg-vendor --derives-from Ubuntu; then
PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/lib/pkgconfig"
fi
PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/share/pkgconfig"

export PKG_CONFIG_LIBDIR
fi

exec pkg-config "$@"
102 changes: 0 additions & 102 deletions .github/workflows/sw.yml

This file was deleted.

8 changes: 8 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ACLOCAL_AMFLAGS = -I m4
CLEANFILES =

SUBDIRS = . tessdata
if MINGW
SUBDIRS += nsis
endif

EXTRA_DIST = README.md LICENSE
EXTRA_DIST += aclocal.m4 config configure.ac autogen.sh
Expand Down Expand Up @@ -50,6 +53,11 @@ doc-pack: doc
doc-clean:
rm -rf $(top_builddir)/doc/html/*

if MINGW
winsetup: training ScrollView.jar
@cd "$(top_builddir)/nsis" && $(MAKE) winsetup
endif

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tesseract.pc

Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ AC_CONFIG_HEADERS([include/config_auto.h:config/config.h.in])

# default conditional
AM_CONDITIONAL([T_WIN], false)
AM_CONDITIONAL([MINGW], false)
AM_CONDITIONAL([GRAPHICS_DISABLED], false)
AC_SUBST([AM_CPPFLAGS])

Expand All @@ -87,7 +88,9 @@ AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
case "${host_os}" in
mingw*)
AC_DEFINE_UNQUOTED([MINGW], 1, [This is a MinGW system])
AM_CONDITIONAL([T_WIN], true)
AM_CONDITIONAL([MINGW], true)
AM_CONDITIONAL([ADD_RT], false)
AC_SUBST([AM_LDFLAGS], ['-no-undefined'])
;;
Expand Down Expand Up @@ -559,6 +562,7 @@ AC_CONFIG_FILES([java/com/google/Makefile])
AC_CONFIG_FILES([java/com/google/scrollview/Makefile])
AC_CONFIG_FILES([java/com/google/scrollview/events/Makefile])
AC_CONFIG_FILES([java/com/google/scrollview/ui/Makefile])
AC_CONFIG_FILES([nsis/Makefile])
AC_OUTPUT

# Final message
Expand Down
6 changes: 3 additions & 3 deletions java/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ $(SCROLLVIEW_CLASSES) : $(SCROLLVIEW_FILES) $(SCROLLVIEW_LIBS)

.PHONY: fetch-jars
fetch-jars $(SCROLLVIEW_LIBS):
curl -s -S -L -O https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar
curl -s -S -L -O https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar
curl -s -S -L -O https://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar
curl -s -S -L -o piccolo2d-core-3.0.1.jar https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar
curl -s -S -L -o piccolo2d-extras-3.0.1.jar https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar
curl -s -S -L -o jaxb-api-2.3.1.jar https://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar

.PHONY: install-jars
install-jars : ScrollView.jar
Expand Down
Loading