base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / sp / spdlog / package.nix
blob6aa91db83549a44b14a208823e8b1fa66810aa8d
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , fmt
6 , catch2_3
7 , staticBuild ? stdenv.hostPlatform.isStatic
9 # tests
10 , bear
11 , tiledb
14 stdenv.mkDerivation rec {
15   pname = "spdlog";
16   version = "1.14.1";
18   src = fetchFromGitHub {
19     owner = "gabime";
20     repo  = "spdlog";
21     rev   = "v${version}";
22     hash  = "sha256-F7khXbMilbh5b+eKnzcB0fPPWQqUHqAYPWJb83OnUKQ=";
23   };
25   nativeBuildInputs = [ cmake ];
26   # Required to build tests, even if they aren't executed
27   buildInputs = [ catch2_3 ];
28   propagatedBuildInputs = [ fmt ];
30   cmakeFlags = [
31     "-DSPDLOG_BUILD_SHARED=${if staticBuild then "OFF" else "ON"}"
32     "-DSPDLOG_BUILD_STATIC=${if staticBuild then "ON" else "OFF"}"
33     "-DSPDLOG_BUILD_EXAMPLE=OFF"
34     "-DSPDLOG_BUILD_BENCH=OFF"
35     "-DSPDLOG_BUILD_TESTS=ON"
36     "-DSPDLOG_FMT_EXTERNAL=ON"
37   ];
39   outputs = [ "out" "doc" "dev" ] ;
41   postInstall = ''
42     mkdir -p $out/share/doc/spdlog
43     cp -rv ../example $out/share/doc/spdlog
44   '';
46   doCheck = true;
48   passthru.tests = {
49     inherit bear tiledb;
50   };
52   meta = with lib; {
53     description    = "Very fast, header only, C++ logging library";
54     homepage       = "https://github.com/gabime/spdlog";
55     license        = licenses.mit;
56     maintainers    = with maintainers; [ obadz ];
57     platforms      = platforms.all;
58   };