Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / fo / formatjson5 / package.nix
blob6adfece33862a9acdcf70f15af8acfb6caa6e696
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , stdenv
5 , darwin
6 }:
8 rustPlatform.buildRustPackage rec {
9   pname = "formatjson5";
10   version = "0.2.6";
12   src = fetchFromGitHub {
13     owner = "google";
14     repo = "json5format";
15     # Not tagged, see Cargo.toml.
16     rev = "056829990bab4ddc78c65a0b45215708c91b8628";
17     hash = "sha256-Lredw/Fez+2U2++ShZcKTFCv8Qpai9YUvqvpGjG5W0o=";
18   };
20   cargoHash = "sha256-zPgaZPDyNVPmBXz6QwOYnmh/sbJ8aPST8znLMfIWejk=";
22   buildInputs = lib.optionals stdenv.isDarwin [
23     darwin.apple_sdk.frameworks.Security
24   ];
26   cargoBuildFlags = [
27     "--example formatjson5"
28   ];
30   postInstall =
31     let
32       cargoTarget = rustPlatform.cargoInstallHook.targetSubdirectory;
33     in
34     ''
35       install -D target/${cargoTarget}/release/examples/formatjson5 $out/bin/formatjson5
36     '';
38   meta = {
39     description = "JSON5 formatter";
40     homepage = "https://github.com/google/json5format";
41     license = lib.licenses.bsd3;
42     mainProgram = "formatjson5";
43     maintainers = with lib.maintainers; [ katexochen ];
44   };