1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-05-01 11:45:29 +00:00
Files
zint/README.linux
gitlost df64a0f237 debian: updated using https://salsa.debian.org/debian/zint as
template, props Dmitry Smirnov (ticket #147, props John Crisp);
  TODO: enable building with the GS1 Syntax Engine;
  this involved auditing copyrights which prompted the next item
  re "tif.c" and will prompt the next next item "pdf417.c"
tif.c: replaced LZW compression with tree-based one due to
  "tif_lzw.h"'s original BSD-TAHOE license which has the equivalent
  of the "advertising clause", new implementation (which is much
  faster anyway) props Harald Kuhr and Bob Montgomery
pdf417.c: TODO: Replace all code adapted from "pdf417.frm" as it
  was released under GPL v2.0 or later
pdf417.h: replace unnecessary "pdf417.frm" references with ISO/IEC
  standard as 1st step re above, some expanded comments
general: Codablock-F -> Codablock F (i.e. lose hyphen)
cmake: frontend/frontend_qt: go back to only setting RPATH on macOS
  as not Debian compatible and it seems it's not a good idea on
  Linux anyway; TODO: check BSD + other Unixes
CLI/GUI: make "--verbose" option official and document
tools/gen_eci_sb_h.php/gen_eci_mb_h.php: add SPDX Unicode-3.0;
  update haible.de/bruno tarball info - "GB18030.TXT" no longer in
  "jdk-1.4.2/" so mention "libiconv-1.11/" version instead (same)
general: add various SPDXs and normalize some Copyrights
reedsol.c: malloced `logt`/`alog` tables int -> short (slight
  performance improvement)
aztec.c: add copyrights, some code fiddling
BWIPP: update to latest
2026-03-18 15:08:32 +00:00

164 lines
4.5 KiB
Plaintext

% README.linux 2026-01-01
% Tested on Ubuntu 20.04.4 LTS, Ubuntu 22.04 LTS, Ubuntu 24.04 LTS and
% Fedora Linux 43 (Workstation Edition)
% vim: set ts=4 sw=4 et :
1. Prerequisites for building zint
==================================
Prerequisites are git, cmake, make, cc and c++, e.g. Ubuntu/Debian
sudo apt install git cmake build-essential
or Fedora (git, make and gcc should already be installed)
sudo dnf install cmake gcc-c++
libpng is optional but necessary for PNG support, e.g. Ubuntu/Debian
sudo apt install libpng-dev
or Fedora
sudo dnf install libpng-devel
gs1encoders is optional but necessary for GS1 Syntax Engine support. To install clone the repo:
git clone https://github.com/gs1/gs1-syntax-engine
and navigate to "src/c-lib" and make:
cd gs1-syntax-engine/src/c-lib
make lib && sudo make install
cd ../../..
Now either download the zint source code tarball
wget -O zint-2.16.0-src.tar.gz \
https://sourceforge.net/projects/zint/files/zint/2.16.0/zint-2.16.0-src.tar.gz/download
tar xf zint-2.16.0-src.tar.gz
cd zint-2.16.0-src
or clone the latest source
git clone https://git.code.sf.net/p/zint/code zint
cd zint
2. Prerequisites for building zint-qt
=====================================
zint-qt can be built with either Qt5 (preferred) or Qt6. First, install mesa (for OpenGL), e.g.
Ubuntu/Debian
sudo apt install mesa-common-dev libglu1-mesa-dev
or Fedora
sudo dnf install mesa-libGL mesa-libGL-devel
zint-qt has issues running on Wayland so sets X11 as the Qt platform (via the environment variable
"QT_QPA_PLATFORM=xcb") on startup unless already set.
2.1. Using Qt packages
----------------------
If packages for Qt exist for your distro, it might be easiest to use them, although knowing
what their ever-changing names and contents are isn't. A complication is that zint-qt uses 2 Qt
components beyond the basic setup: Qt UI Tools (for dynamically loading the symbology-specific
tabs), and Qt SVG (for rendering icons).
E.g. on Ubuntu 22.04 or 24.04
sudo apt install qtbase5-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev
or Ubuntu 20.04
sudo apt install qt5-default qt5-uitools
or Fedora
sudo dnf install qt5-qtbase-devel qt5-qttools-devel qt5-qttools-static qt5-qtsvg-devel
You may need to tell CMake where to find the ".cmake" modules:
export CMAKE_MODULE_PATH=<cmake-module-path>/Qt5
e.g. CMAKE_MODULE_PATH=/usr/lib/x86_64-linux-gnu/cmake/Qt5
2.2. Using the Qt Maintenance Tool
----------------------------------
Alternatively, for a more consistent experience, sign up and download the Qt Maintenance Tool
from
https://www.qt.io/download-qt-installer
On Ubuntu/Debian you may need to install xinerama to run the tool:
sudo apt install libxcb-xinerama0
Launch the tool and install the "Desktop gcc 64-bit" component for either Qt 5.15.2 (preferred)
or Qt 6 (>= 6.1).
Once Qt is installed you may need to tell CMake where it is:
export CMAKE_PREFIX_PATH=<qt-version-dir>/gcc_64
e.g. export CMAKE_PREFIX_PATH=/opt/Qt/5.15.2/gcc_64
3. Build
========
The rest is standard CMake
cd zint
mkdir build
cd build
cmake ..
make
sudo make install
Note if using Qt6, need to specify
cmake -DZINT_QT6=ON ..
4. Run
======
On Fedora you may have to set LD_LIBRARY_PATH for zint ("libzint.so") and zint-qt (Qt libraries):
export LD_LIBRARY_PATH=/usr/local/lib64:<qt-version-dir>/gcc_64/lib
5. CMake options
================
A number of options are available:
ZINT_DEBUG:BOOL=OFF # Set debug compile flags
ZINT_NOOPT:BOOL=OFF # Set no optimize compile flags
ZINT_SANITIZE:BOOL=OFF # Set sanitize address/undefined
ZINT_SANITIZEM:BOOL=OFF # Set sanitize memory (ignored if ZINT_SANITIZE)
ZINT_TEST:BOOL=OFF # Set test compile flag
ZINT_COVERAGE:BOOL=OFF # Set code coverage flags
ZINT_SHARED:BOOL=ON # Build shared library
ZINT_STATIC:BOOL=OFF # Build static library
ZINT_FRONTEND:BOOL=ON # Build frontend
ZINT_USE_GS1SE:BOOL=ON # Build with GS1 Syntax Engine
ZINT_USE_PNG:BOOL=ON # Build with PNG support
ZINT_USE_QT:BOOL=ON # Build with Qt support
ZINT_QT6:BOOL=OFF # If ZINT_USE_QT, use Qt6
ZINT_UNINSTALL:BOOL=ON # Add uninstall target
which can be set by doing e.g.
cmake -DZINT_SANITIZE=ON ..
Note that ZINT_SANITIZEM (Clang only) is incompatible with ZINT_SANITIZE, and also with
ZINT_USE_PNG, unless libpng has also been instrumented with -fsanitize=memory.
For details on ZINT_TEST and building the zint test suite, see "backend/tests/README".