nixpkgs/pkgs/development/libraries/libcbor/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.2 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, cmake
, cmocka
# for passthru.tests
, libfido2
, mysql80
, openssh
, systemd
}:
2019-03-29 14:58:12 +00:00
2022-12-31 19:59:00 +00:00
stdenv.mkDerivation (finalAttrs: {
2019-03-29 14:58:12 +00:00
pname = "libcbor";
2022-12-30 20:54:58 +00:00
version = "0.10.0";
2019-03-29 14:58:12 +00:00
src = fetchFromGitHub {
owner = "PJK";
2022-12-31 19:59:00 +00:00
repo = finalAttrs.pname;
rev = "v${finalAttrs.version}";
2022-12-30 20:54:58 +00:00
sha256 = "sha256-YJSIZ7o191/0QJf1fH6LUYykS2pvP17knSeRO2WcDeM=";
2019-03-29 14:58:12 +00:00
};
nativeBuildInputs = [ cmake ];
2022-12-31 19:59:00 +00:00
cmakeFlags = [
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DBUILD_SHARED_LIBS=on"
] ++ lib.optional finalAttrs.doCheck "-DWITH_TESTS=ON";
2019-03-29 14:58:12 +00:00
# 2 tests are not 32-bit clean: overflow size_t:
# https://github.com/PJK/libcbor/issues/263
doCheck =
!stdenv.hostPlatform.is32bit
&& (!stdenv.hostPlatform.isStatic)
&& stdenv.hostPlatform == stdenv.buildPlatform;
nativeCheckInputs = [ cmocka ];
2019-03-29 14:58:12 +00:00
passthru.tests = {
inherit libfido2 mysql80;
openssh = (openssh.override { withFIDO = true; });
systemd = (systemd.override {
withFido2 = true;
withCryptsetup = true;
});
};
meta = with lib; {
2019-03-29 14:58:12 +00:00
description = "CBOR protocol implementation for C and others";
homepage = "https://github.com/PJK/libcbor";
2019-03-29 14:58:12 +00:00
license = licenses.mit;
maintainers = with maintainers; [ dtzWill ];
};
2022-12-31 19:59:00 +00:00
})