Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 fetchFromGitHub, 3 lib, 4 stdenv, 5 cmake, 6 nix-update-script, 7}: 8stdenv.mkDerivation (finalAttrs: { 9 pname = "magic-enum"; 10 version = "0.9.7"; 11 12 src = fetchFromGitHub { 13 owner = "Neargye"; 14 repo = "magic_enum"; 15 tag = "v${finalAttrs.version}"; 16 hash = "sha256-P6fl/dcGOSE1lTJwZlimbvsTPelHwdQdZr18H4Zji20="; 17 }; 18 19 nativeBuildInputs = [ cmake ]; 20 21 cmakeFlags = [ 22 # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly 23 # (setting it to an absolute path causes include files to go to $out/$out/include, 24 # because the absolute path is interpreted with root at $out). 25 (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include") 26 (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") 27 ]; 28 29 passthru = { 30 updateScript = nix-update-script { }; 31 }; 32 33 meta = { 34 description = "Static reflection for enums (to string, from string, iteration) for modern C++"; 35 homepage = "https://github.com/Neargye/magic_enum"; 36 changelog = "https://github.com/Neargye/magic_enum/releases/tag/v${finalAttrs.version}"; 37 license = lib.licenses.mit; 38 maintainers = with lib.maintainers; [ Alper-Celik ]; 39 }; 40})