1{ fetchFromGitHub
2, lib
3, stdenv
4, cmake
5}:
6stdenv.mkDerivation rec{
7 pname = "magic-enum";
8 version = "0.9.5";
9
10 src = fetchFromGitHub {
11 owner = "Neargye";
12 repo = "magic_enum";
13 rev = "refs/tags/v${version}";
14 hash = "sha256-Q82HdlEMXpiGISnqdjFd0rxiLgsobsoWiqqGLawu2pM=";
15 };
16
17 nativeBuildInputs = [ cmake ];
18
19 cmakeFlags = [
20 # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
21 # (setting it to an absolute path causes include files to go to $out/$out/include,
22 # because the absolute path is interpreted with root at $out).
23 "-DCMAKE_INSTALL_INCLUDEDIR=include"
24 "-DCMAKE_INSTALL_LIBDIR=lib"
25 ];
26
27 meta = with lib;{
28 description = "Static reflection for enums (to string, from string, iteration) for modern C++";
29 homepage = "https://github.com/Neargye/magic_enum";
30 changelog = "https://github.com/Neargye/magic_enum/releases/tag/v${version}";
31 license = licenses.mit;
32 maintainers = with maintainers; [ Alper-Celik ];
33 };
34}