1{ lib
2, stdenv
3, fetchFromGitHub
4, wrapQtAppsHook
5, cmake
6, qtbase
7, qtsvg
8, qttools
9, testers
10, zint
11}:
12
13stdenv.mkDerivation rec {
14 pname = "zint";
15 version = "2.13.0";
16
17 src = fetchFromGitHub {
18 owner = "zint";
19 repo = "zint";
20 rev = version;
21 hash = "sha256-/ILq/7A8Lffe2NuiABiV3KeYXapuL1SO55Qk3wXfC/8=";
22 };
23
24 outputs = [ "out" "dev" ];
25
26 nativeBuildInputs = [ cmake wrapQtAppsHook ];
27
28 buildInputs = [ qtbase qtsvg qttools ];
29
30 cmakeFlags = [ "-DZINT_QT6:BOOL=ON" ];
31
32 postInstall = ''
33 install -Dm644 -t $out/share/applications $src/zint-qt.desktop
34 install -Dm644 -t $out/share/pixmaps $src/zint-qt.png
35 install -Dm644 -t $out/share/icons/hicolor/scalable/apps $src/frontend_qt/images/scalable/zint-qt.svg
36 '';
37
38 passthru.tests.version = testers.testVersion {
39 package = zint;
40 command = "zint --version";
41 inherit version;
42 };
43
44 meta = with lib; {
45 description = "A barcode generating tool and library";
46 longDescription = ''
47 The Zint project aims to provide a complete cross-platform open source
48 barcode generating solution. The package currently consists of a Qt based
49 GUI, a CLI command line executable and a library with an API to allow
50 developers access to the capabilities of Zint.
51 '';
52 homepage = "https://www.zint.org.uk";
53 changelog = "https://github.com/zint/zint/blob/${version}/ChangeLog";
54 license = licenses.gpl3Plus;
55 maintainers = with maintainers; [ azahi ];
56 platforms = platforms.all;
57 };
58}