Unverified Commit aedf7245 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

samply: 0.12.0 -> 0.13.1, useFetchCargoVendor and refactor (#381595)

parents e2e9af3b 8b9bbf8b
Loading
Loading
Loading
Loading

pkgs/by-name/sa/samply/Cargo.lock

deleted100644 → 0
+0 −2497

File deleted.

Preview size limit exceeded, changes collapsed.

+16 −34
Original line number Diff line number Diff line
@@ -2,61 +2,43 @@
  lib,
  rustPlatform,
  fetchCrate,
  jq,
  moreutils,
  stdenv,
  darwin,
  versionCheckHook,
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
  pname = "samply";
  version = "0.12.0";
  version = "0.13.1";

  src = fetchCrate {
    inherit pname version;
    hash = "sha256-7bf1lDIZGhRpvnn8rHNwzH2GBY8CwtYCjuRAUTQgbsA=";
    hash = "sha256-zTwAsE6zXY3esO7x6UTCO2DbzdUSKZ6qc5Rr9qcI+Z8=";
  };

  # Can't use fetchCargoVendor:
  # https://github.com/NixOS/nixpkgs/issues/377986
  cargoLock.lockFile = ./Cargo.lock;

  # the dependencies linux-perf-data and linux-perf-event-reader contains both README.md and Readme.md,
  # which causes a hash mismatch on systems with a case-insensitive filesystem
  # this removes the readme files and updates cargo's checksum file accordingly
  depsExtraArgs = {
    nativeBuildInputs = [
      jq
      moreutils
    ];

    postBuild = ''
      for crate in linux-perf-data linux-perf-event-reader; do
        pushd $name/$crate

        rm -f README.md Readme.md
        jq 'del(.files."README.md") | del(.files."Readme.md")' \
          .cargo-checksum.json -c \
          | sponge .cargo-checksum.json

        popd
      done
    '';
  };
  useFetchCargoVendor = true;
  cargoHash = "sha256-mQykzO9Ldokd3PZ1fY4pK/GtLmYMVas2iHj1Pqi9WqQ=";

  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
    darwin.apple_sdk.frameworks.CoreServices
  ];

  meta = with lib; {
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgramArg = "--version";
  doInstallCheck = true;

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Command line profiler for macOS and Linux";
    mainProgram = "samply";
    homepage = "https://github.com/mstange/samply";
    changelog = "https://github.com/mstange/samply/releases/tag/samply-v${version}";
    license = with licenses; [
    license = with lib.licenses; [
      asl20
      mit
    ];
    maintainers = with maintainers; [ figsoda ];
    maintainers = with lib.maintainers; [ figsoda ];
    mainProgram = "samply";
  };
}