about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/zint/default.nix
blob: 15aecee196d043517df00a506c4e26e83ef9f2c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ lib
, stdenv
, fetchFromGitHub
, wrapQtAppsHook
, cmake
, qtbase
, qtsvg
, qttools
, testers
, zint
}:

stdenv.mkDerivation rec {
  pname = "zint";
  version = "2.12.0";

  src = fetchFromGitHub {
    owner = "zint";
    repo = "zint";
    rev = version;
    hash = "sha256-Ay6smir6zUpadmw1WpU+F7e9t7Gk3JNVtf2VVu92bDk=";
  };

  outputs = [ "out" "dev" ];

  nativeBuildInputs = [ cmake wrapQtAppsHook ];

  buildInputs = [ qtbase qtsvg qttools ];

  cmakeFlags = [ "-DZINT_QT6:BOOL=ON" ];

  postInstall = ''
    install -Dm644 -t $out/share/applications $src/zint-qt.desktop
    install -Dm644 -t $out/share/pixmaps $src/zint-qt.png
    install -Dm644 -t $out/share/icons/hicolor/scalable/apps $src/frontend_qt/images/scalable/zint-qt.svg
  '';

  passthru.tests.version = testers.testVersion {
    package = zint;
    command = "zint --version";
    inherit version;
  };

  meta = with lib; {
    description = "A barcode generating tool and library";
    longDescription = ''
      The Zint project aims to provide a complete cross-platform open source
      barcode generating solution. The package currently consists of a Qt based
      GUI, a CLI command line executable and a library with an API to allow
      developers access to the capabilities of Zint.
    '';
    homepage = "https://www.zint.org.uk";
    changelog = "https://github.com/zint/zint/blob/${version}/ChangeLog";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ azahi ];
  };
}