summary refs log tree commit diff
path: root/pkgs/development/libraries/qrencode/default.nix
blob: 83d2db6a26b94b0214a8b67c68495fa7555eade0 (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
{ stdenv, fetchurl, pkgconfig, SDL2, libpng, libiconv }:

stdenv.mkDerivation rec {
  pname = "qrencode";
  version = "4.0.2";

  outputs = [ "bin" "out" "man" "dev" ];

  src = fetchurl {
    url = "https://fukuchi.org/works/qrencode/qrencode-${version}.tar.gz";
    sha256 = "079v3a15ydpr67zdi3xbgvic8n2kxvi0m32dyz8jaik10yffgayv";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ SDL2 libpng ] ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];

  configureFlags = [
    "--with-tests"
  ];

  doCheck = true;

  checkPhase = ''
    runHook preCheck

    pushd tests
    ./test_basic.sh
    popd

    runHook postCheck
  '';

  meta = with stdenv.lib; {
    homepage = "https://fukuchi.org/works/qrencode/";
    description = "C library for encoding data in a QR Code symbol";

    longDescription = ''
      Libqrencode is a C library for encoding data in a QR Code symbol,
      a kind of 2D symbology that can be scanned by handy terminals
      such as a mobile phone with CCD.
    '';

    license = licenses.lgpl21Plus;
    maintainers = with maintainers; [ adolfogc yegortimoshenko ];
    platforms = platforms.all;
  };
}