4 , subproject ? "library" # one of "library", "reader" or "writer"
5 , zlib, libpng, libtiff
9 subdir = lib.getAttr subproject {
10 "library" = "jabcode";
11 "reader" = "jabcodeReader";
12 "writer" = "jabcodeWriter";
14 in stdenv.mkDerivation rec {
15 pname = "jabcode-${subproject}";
16 version = "git-2020-05-13";
17 src = fetchFromGitHub {
20 rev = "a7c25d4f248078f257b014e31c791bfcfcd083e1";
21 sha256 = "1c4cv9b0d7r4bxzkwzdv9h651ziq822iya6fbyizm57n1nzdkk4s";
25 [ zlib libpng libtiff ]
26 ++ lib.optionals (subproject != "library") [ jabcode ];
28 preConfigure = "cd src/${subdir}";
30 installPhase = if subproject == "library" then ''
39 description = "A high-capacity 2D color bar code (${subproject})";
40 longDescription = "JAB Code (Just Another Bar Code) is a high-capacity 2D color bar code, which can encode more data than traditional black/white (QR) codes. This is the ${subproject} part.";
41 homepage = "https://jabcode.org/";
42 license = licenses.lgpl21;
43 maintainers = [ maintainers.xaverdh ];
44 platforms = platforms.unix;