Files
nixpkgs/pkgs/by-name/sp/spdlog/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

85 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
fmt,
catch2_3,
staticBuild ? stdenv.hostPlatform.isStatic,
# passthru
bear,
tiledb,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "spdlog";
version = "1.15.3";
src = fetchFromGitHub {
owner = "gabime";
repo = "spdlog";
tag = "v${finalAttrs.version}";
hash = "sha256-0rOR9G2Y4Z4OBZtUHxID0s1aXN9ejodHrurlVCA0pIo=";
};
patches = [
# https://github.com/gabime/spdlog/pull/3451
(fetchpatch {
name = "catch2-3.9.0-compat.patch";
url = "https://github.com/gabime/spdlog/commit/3edc8036dbf3c7cdf0e460a913ae294c87ae90dc.patch";
hash = "sha256-0XtNaAvDGpSTtQZjxmLbHOoY4OMZDJfLDzBh7gNQh2c=";
})
];
nativeBuildInputs = [ cmake ];
# Required to build tests, even if they aren't executed
buildInputs = [ catch2_3 ];
propagatedBuildInputs = [ fmt ];
cmakeFlags = [
(lib.cmakeBool "SPDLOG_BUILD_SHARED" (!staticBuild))
(lib.cmakeBool "SPDLOG_BUILD_STATIC" staticBuild)
(lib.cmakeBool "SPDLOG_BUILD_EXAMPLE" false)
(lib.cmakeBool "SPDLOG_BUILD_BENCH" false)
(lib.cmakeBool "SPDLOG_BUILD_TESTS" true)
(lib.cmakeBool "SPDLOG_FMT_EXTERNAL" true)
];
outputs = [
"out"
"doc"
"dev"
];
postInstall = ''
mkdir -p $out/share/doc/spdlog
cp -rv ../example $out/share/doc/spdlog
substituteInPlace $dev/include/spdlog/tweakme.h \
--replace-fail \
'// #define SPDLOG_FMT_EXTERNAL' \
'#define SPDLOG_FMT_EXTERNAL'
'';
doCheck = true;
passthru = {
tests = {
inherit bear tiledb;
};
updateScript = nix-update-script { };
};
meta = {
description = "Very fast, header only, C++ logging library";
homepage = "https://github.com/gabime/spdlog";
changelog = "https://github.com/gabime/spdlog/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ obadz ];
platforms = lib.platforms.all;
};
})