2023-02-09 11:40:11 +00:00
|
|
|
{ fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, cmake
|
2024-07-01 15:47:52 +00:00
|
|
|
, nix-update-script
|
|
|
|
, testers
|
2023-02-09 11:40:11 +00:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec{
|
|
|
|
pname = "magic-enum";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "0.9.6";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Neargye";
|
|
|
|
repo = "magic_enum";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-1pO9FWd0InXqg8+lwRF3YNFTAeVLjqoI9v15LjWxnZY=";
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
cmakeFlags = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# 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"
|
2023-03-04 12:14:45 +00:00
|
|
|
];
|
2023-02-09 11:40:11 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2023-02-09 11:40:11 +00:00
|
|
|
description = "Static reflection for enums (to string, from string, iteration) for modern C++";
|
|
|
|
homepage = "https://github.com/Neargye/magic_enum";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/Neargye/magic_enum/releases/tag/v${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ Alper-Celik ];
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
}
|