about summary refs log tree commit diff
path: root/pkgs/development/libraries/magic-enum/default.nix
blob: 93bcb8a624d861e26ae98cb640b4d5af0ac1c0bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ fetchFromGitHub
, lib
, stdenv
, cmake
, nix-update-script
, testers
}:
stdenv.mkDerivation rec{
  pname = "magic-enum";
  version = "0.9.6";

  src = fetchFromGitHub {
    owner = "Neargye";
    repo = "magic_enum";
    rev = "refs/tags/v${version}";
    hash = "sha256-1pO9FWd0InXqg8+lwRF3YNFTAeVLjqoI9v15LjWxnZY=";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = [
    # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
    # (setting it to an absolute path causes include files to go to $out/$out/include,
    #  because the absolute path is interpreted with root at $out).
    "-DCMAKE_INSTALL_INCLUDEDIR=include"
    "-DCMAKE_INSTALL_LIBDIR=lib"
  ];

  passthru = {
    updateScript = nix-update-script { };
  };

  meta = {
    description = "Static reflection for enums (to string, from string, iteration) for modern C++";
    homepage = "https://github.com/Neargye/magic_enum";
    changelog = "https://github.com/Neargye/magic_enum/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ Alper-Celik ];
  };
}