1 { lib, stdenv, fetchFromGitHub, cmake, fmt }:
4 generic = { version, sha256 }:
9 src = fetchFromGitHub {
16 nativeBuildInputs = [ cmake ];
17 # spdlog <1.3 uses a bundled version of fmt
18 propagatedBuildInputs = lib.optional (lib.versionAtLeast version "1.3") fmt;
21 "-DSPDLOG_BUILD_SHARED=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
22 "-DSPDLOG_BUILD_STATIC=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
23 "-DSPDLOG_BUILD_EXAMPLE=OFF"
24 "-DSPDLOG_BUILD_BENCH=OFF"
25 "-DSPDLOG_BUILD_TESTS=ON"
26 "-DSPDLOG_FMT_EXTERNAL=ON"
29 outputs = [ "out" "doc" ]
30 # spdlog <1.4 is header only, no need to split libraries and headers
31 ++ lib.optional (lib.versionAtLeast version "1.4") "dev";
34 mkdir -p $out/share/doc/spdlog
35 cp -rv ../example $out/share/doc/spdlog
39 preCheck = "export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH";
42 description = "Very fast, header only, C++ logging library";
43 homepage = "https://github.com/gabime/spdlog";
44 license = licenses.mit;
45 maintainers = with maintainers; [ obadz ];
46 platforms = platforms.all;
53 sha256 = "sha256-D29jvDZQhPscaOHlrzGN1s7/mXlcsovjbqYpXd7OM50=";
58 sha256 = "112kfh4fbpm5cvrmgbgz4d8s802db91mhyjpg7cwhlywffnzkwr9";