depot/pkgs/by-name/qr/qrcodegen/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

52 lines
1.1 KiB
Nix

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