2020-07-18 16:06:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, subproject ? "library" # one of "library", "reader" or "writer"
|
2021-12-06 16:07:01 +00:00
|
|
|
, zlib
|
|
|
|
, libpng
|
|
|
|
, libtiff
|
2021-02-05 17:12:51 +00:00
|
|
|
, jabcode
|
2020-07-18 16:06:22 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
subdir = lib.getAttr subproject {
|
|
|
|
"library" = "jabcode";
|
|
|
|
"reader" = "jabcodeReader";
|
|
|
|
"writer" = "jabcodeWriter";
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "jabcode-${subproject}";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "unstable-2022-06-17";
|
2020-07-18 16:06:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "jabcode";
|
|
|
|
owner = "jabcode";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "ee0e4c88b9f3c1da46d6f679ee8b69c547907c20";
|
|
|
|
hash = "sha256-GjRkDWefQFdT4i9hRcQhYsY4beMUIXxy38I5lsQytyA=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
|
|
|
[ zlib libpng libtiff ]
|
|
|
|
++ lib.optionals (subproject != "library") [ jabcode ];
|
|
|
|
|
|
|
|
preConfigure = "cd src/${subdir}";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
installPhase =
|
|
|
|
if subproject == "library" then ''
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp build/* $out/lib
|
|
|
|
'' else ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -RT bin $out/bin
|
|
|
|
'';
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "High-capacity 2D color bar code (${subproject})";
|
2020-07-18 16:06:22 +00:00
|
|
|
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.";
|
|
|
|
homepage = "https://jabcode.org/";
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = [ maintainers.xaverdh ];
|
|
|
|
platforms = platforms.unix;
|
2022-01-22 01:22:15 +00:00
|
|
|
broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/jabcode.x86_64-darwin
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
}
|