2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-01-05 17:05:55 +00:00
|
|
|
pname = "qrcodegen";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "1.8.0";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nayuki";
|
|
|
|
repo = "QR-Code-generator";
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-aci5SFBRNRrSub4XVJ2luHNZ2pAUegjgQ6pD9kpkaTY=";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${finalAttrs.src.name}/c";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = lib.optionals stdenv.cc.isClang [
|
|
|
|
stdenv.cc.cc.libllvm.out
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = lib.optionals stdenv.cc.isClang [ "AR=llvm-ar" ];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
./qrcodegen-test
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
installPhase = ''
|
2022-01-13 20:06:32 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
install -Dt $out/lib/ libqrcodegen.a
|
|
|
|
install -Dt $out/include/qrcodegen/ qrcodegen.h
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
meta = {
|
2022-01-13 20:06:32 +00:00
|
|
|
homepage = "https://www.nayuki.io/page/qr-code-generator-library";
|
|
|
|
description = "High-quality QR Code generator library in many languages";
|
2023-08-04 22:07:22 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.unix;
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
})
|
2022-01-13 20:06:32 +00:00
|
|
|
# TODO: build the other languages
|
|
|
|
# TODO: multiple outputs
|