Unverified Commit e537703c authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

tailspin: fix build and refactor (#385327)

parents 13d04a55 2736c06a
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -2,16 +2,19 @@
  lib,
  rustPlatform,
  fetchFromGitHub,
  stdenv,
  versionCheckHook,
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "tailspin";
  version = "4.0.0";

  src = fetchFromGitHub {
    owner = "bensadeh";
    repo = "tailspin";
    rev = version;
    tag = finalAttrs.version;
    hash = "sha256-5VbxQDK69If5N8EiS8sIKNqHkCAfquOz8nUS7ynp+nA=";
  };

@@ -20,15 +23,22 @@ rustPlatform.buildRustPackage rec {

  postPatch = ''
    substituteInPlace tests/utils.rs --replace-fail \
      'target/debug' "target/$(rustc -vV | sed -n 's|host: ||p')/debug"
      'target/debug' "target/${stdenv.hostPlatform.rust.rustcTargetSpec}/$cargoCheckType"
  '';

  meta = with lib; {
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgram = "${placeholder "out"}/bin/tspin";
  versionCheckProgramArg = "--version";
  doInstallCheck = true;

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

  meta = {
    description = "Log file highlighter";
    homepage = "https://github.com/bensadeh/tailspin";
    changelog = "https://github.com/bensadeh/tailspin/blob/${version}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ dit7ya ];
    changelog = "https://github.com/bensadeh/tailspin/blob/${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ dit7ya ];
    mainProgram = "tspin";
  };
}
})