nixpkgs/pkgs/by-name/qr/qrcodegen/package.nix
Anderson Torres f0e64ce16f treewide: migrate packages maintained by AndersonTorres to by-name
Manual migration for the sake of by-name migration is no longer discouraged
since #340235.
2024-09-16 14:26:47 -03:00

53 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