-
Notifications
You must be signed in to change notification settings - Fork 192
Compiling gImageReader
If you would like to compile gImageReader from source, follow these steps:
Linux (various distributions)
-
Make sure you have
cmake
and a C++ compiler supportingC++11
installed. -
Install the development packages of the following required build dependencies ([Gtk], [Qt5] and [Qt6] indicate dependencies required for compiling the respective gImageReader interface):
- tesseract (>=3.03.00, recommended 3.04.00 or newer)
- sane
- podofo
- libjpeg
- djvulibre
- intltool
- libzip
- libuuid
- libxml-cpp
- [Gtk] gtkmm
- [Gtk] gtkspellmm (>=3.0.5)
- [Gtk] gtksourceviewmm
- [Gtk] cairomm
- [Gtk] poppler-glib
- [Gtk] json-glib
- [Gtk] libxml++
- [Qt5] qt5-qtbase
- [Qt5] qtspell-qt5
- [Qt5] poppler-qt5
- [Qt5] quazip-qt5
- [Qt6] qt6
- [Qt6] qtspell-qt6
- [Qt6] poppler-qt6
- [Qt6] quazip-qt6
For Debian based systems, the specific package names are those listed as
Build-Depends
in the package control file.For Fedora based systems, the specific package names are those listed as
BuildRequires
in the package spec file. -
Configure the build: from within the extracted source tarball or git clone folder, type
$ mkdir build $ cd build $ cmake -DINTERFACE_TYPE=<type> ..
where
<type>
is eithergtk
,qt5
,qt6
.Other standard cmake configuration options (such as
CMAKE_INSTALL_PREFIX
) can also be specified, typeccmake ..
inside thebuild
folder to start the cmake configuration editor which lists all available configuration options. -
Compilation: from within the created
build
directory, typemake
-
Installing: from within the created
build
directory, typemake install
-
Alternatively to installing the application with
make install
, it can also be run from within thebuild
directory.-
For the
Qt5
andQt6
variants, it is sufficient to type from within thebuild
directory./gimagereader-qt5 # or ./gimagereader-qt6
-
For the
Gtk
variant, one needs to ensure the path to the local glib schemas is added toXDG_DATA_DIRS
when running the application:XDG_DATA_DIRS=$PWD:$XDG_DATA_DIRS ./gimagereader-gtk
-
-
Note for musl-libc systems:
On systems with the musl C library you need to edit CMakeLists.txt and add one line to TARGET_LINK_LIBRARIES:
TARGET_LINK_LIBRARIES(gimagereader
${TESSERACT_LDFLAGS}
${gimagereader_LIBS}
${SANE_LDFLAGS}
${ddjvuapi_LDFLAGS}
${ENCHANT_LDFLAGS}
${PODOFO_LDFLAGS}
-ldl
-lintl
)The linker is expecting some gettext symbols which are present in glibc, but not in musl.
Windows
The easiest way to compile gImageReader for Windows is by using the provided Docker image, performing the following steps from the root directory of the gImageReader source tree:
-
Build the image (only required once resp. periodically to update it):
docker build -t gimagereader_buildenv packaging/win32
-
Compile gImageReader and build the installers:
-
32-bit build:
docker run -v $PWD:/workspace gimagereader_buildenv packaging/win32/makeinstaller.sh i686 qt5
-
64-bit build:
docker run -v $PWD:/workspace gimagereader_buildenv packaging/win32/makeinstaller.sh x86_64 qt5
-
Note: If the build fails with errors such as
RCC: Error in '/workspace/qt/data/gimagereader.qrc': Cannot find file '../../data/icons/angle.png'
try running
docker
with--security-opt seccomp:unconfined
, i.e.docker run --security-opt seccomp:unconfined -v $PWD:/workspace gimagereader_buildenv packaging/win32/makeinstaller.sh x86_64 qt5
-
-
The built installers can then be found inside the build trees:
- 32-bit build:
build/mingw32-qt5/gImageReader_$VERSION_qt5_i686.exe
- 64-bit build:
build/mingw64-qt5/gImageReader_$VERSION_qt5_x86_64.exe
- 32-bit build: