Files
nixpkgs/pkgs/by-name/li/libcbor/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

70 lines
1.5 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,
mysql80,
openssh,
systemd,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libcbor";
version = "0.13.0";
src = fetchFromGitHub {
owner = "PJK";
repo = "libcbor";
rev = "v${finalAttrs.version}";
hash = "sha256-ePgVR7VHXWKqOShuAEQG3BJ08W2aZS/vfcPUCqTw7X4=";
};
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 mysql80;
openssh = (openssh.override { withFIDO = true; });
systemd = (
systemd.override {
withFido2 = true;
withCryptsetup = true;
}
);
};
meta = with lib; {
description = "CBOR protocol implementation for C and others";
homepage = "https://github.com/PJK/libcbor";
license = licenses.mit;
maintainers = [ ];
};
})