Files

71 lines
1.6 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
lib,
stdenv,
fetchFromGitHub,
cmake,
cmocka,
# for passthru.tests
libfido2,
mysql84,
openssh,
systemd,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libcbor";
version = "0.14.0";
src = fetchFromGitHub {
owner = "PJK";
repo = "libcbor";
tag = "v${finalAttrs.version}";
hash = "sha256-zjajNtj4jKbt3pLjfLrgtYljyMDYJtnzAC5JPdt+Wys=";
};
outputs = [
"out"
"dev"
];
strictDeps = true;
nativeBuildInputs = [ cmake ];
buildInputs = [
cmocka # cmake expects cmocka module
];
# BUILD file already exists in the source; this causes issues on
# caseinsensitive Darwin systems.
cmakeBuildDir = "build.dir";
cmakeFlags =
lib.optional finalAttrs.finalPackage.doCheck "-DWITH_TESTS=ON"
++ lib.optional (!stdenv.hostPlatform.isStatic) "-DBUILD_SHARED_LIBS=ON";
# Tests are restricted while pkgsStatic.cmocka is broken. Tracked at:
# https://github.com/NixOS/nixpkgs/issues/213623
doCheck = !stdenv.hostPlatform.isStatic && stdenv.hostPlatform == stdenv.buildPlatform;
nativeCheckInputs = [ cmocka ];
passthru.tests = {
inherit libfido2 mysql84;
openssh = (openssh.override { withFIDO = true; });
systemd = (
systemd.override {
withFido2 = true;
withCryptsetup = true;
}
);
};
meta = {
changelog = "https://github.com/PJK/libcbor/blob/${finalAttrs.src.tag}/CHANGELOG.md";
description = "CBOR protocol implementation for C and others";
homepage = "https://github.com/PJK/libcbor";
license = lib.licenses.mit;
maintainers = [ ];
};
})