summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/zx/zxing-cpp/package.nix
blob: 8a6b3e6b0a3e9fd141697873870074dbf4b7c36d (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  lib,
  cmake,
  fetchFromGitHub,
  gitUpdater,
  python3,
  stdenv,
  libzint,
  pkg-config,
  stb,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "zxing-cpp";
  version = "3.1.1";

  src = fetchFromGitHub {
    owner = "zxing-cpp";
    repo = "zxing-cpp";
    tag = "v${finalAttrs.version}";
    hash = "sha256-dCqn2qYQGHY/nmwwkgd4uGoKp0YeQxWiHpS0Hhsm+UE=";
  };

  strictDeps = true;

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    libzint
    stb
  ];

  cmakeFlags = [
    "-DZXING_BLACKBOX_TESTS=OFF"
    "-DZXING_DEPENDENCIES=LOCAL"
    "-DZXING_EXAMPLES=OFF"
    "-DZXING_USE_BUNDLED_ZINT=OFF"
    (lib.cmakeFeature "ZXING_WRITERS" "BOTH")
  ];

  passthru = {
    tests = {
      inherit (python3.pkgs) zxing-cpp;
    };
    updateScript = gitUpdater {
      rev-prefix = "v";
    };
  };

  meta = {
    homepage = "https://github.com/zxing-cpp/zxing-cpp";
    changelog = "https://github.com/zxing-cpp/zxing-cpp/releases/tag/${finalAttrs.src.rev}";
    description = "C++ port of zxing (a Java barcode image processing library)";
    longDescription = ''
      ZXing-C++ ("zebra crossing") is an open-source, multi-format 1D/2D barcode
      image processing library implemented in C++.

      It was originally ported from the Java ZXing Library but has been
      developed further and now includes many improvements in terms of quality
      and performance. It can both read and write barcodes in a number of
      formats.
    '';
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [
      lukegb
      qweered
    ];
    platforms = lib.platforms.unix;
  };
})