nixpkgs/pkgs/by-name/ma/magic-enum/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

41 lines
1.1 KiB
Nix

{ 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 ];
};
}