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

skim: 0.20.5 -> 2.0.1 (#485765)

parents b4ebfb3c 900cff8c
Loading
Loading
Loading
Loading
+42 −12
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  tmux,
  fetchFromGitHub,
  installShellFiles,
  nix-update-script,
@@ -9,10 +9,9 @@
  skim,
  testers,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "skim";
  version = "0.20.5";
  version = "2.0.1";

  outputs = [
    "out"
@@ -23,17 +22,21 @@ rustPlatform.buildRustPackage rec {
  src = fetchFromGitHub {
    owner = "skim-rs";
    repo = "skim";
    tag = "v${version}";
    hash = "sha256-BX0WW7dNpNLwxlclFCxj0QnrQ58lchKiEnmethzceqk=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-MQV7Fcbna6x4t3NFFn8m/EHvOM1CrPpfdwUJGQz09LU=";
  };

  postPatch = ''
    sed -i -e "s|expand('<sfile>:h:h')|'$out'|" plugin/skim.vim
  '';

  cargoHash = "sha256-t2hkWTb/GhesNCWe2/YunZFo26xcXMjoNCiaKaFLOBk=";
  cargoHash = "sha256-BlY1idYk6LpVI40dLdH0Sn49ZChbecp6KhwWORgKP3k=";

  nativeBuildInputs = [ installShellFiles ];
  nativeCheckInputs = [ tmux ];

  # frizbee requires nightly features
  env.RUSTC_BOOTSTRAP = 1;

  postBuild = ''
    cat <<SCRIPT > sk-share
@@ -58,9 +61,36 @@ rustPlatform.buildRustPackage rec {
      --zsh shell/completion.zsh
  '';

  # Doc tests are broken on aarch64
  # https://github.com/lotabout/skim/issues/440
  cargoTestFlags = lib.optional stdenv.hostPlatform.isAarch64 "--all-targets";
  useNextest = true;

  checkPhase =
    let
      skippedTests = [
        # Assertion Error: Insta: Code output doesn't match the expected snapshot
        "opt_replstr"
        "opt_with_nth_preview"
        "preview_offset_expr"
        "preview_navigation"
        "preview_offset_fixed"
        "preview_nul_char"
        "preview_nowrap"
        "preview_offset_fixed_and_expr"
        "preview_plus"
        "preview_preserve_quotes"
        "preview_pty_linux"
        "preview_wrap"
        "preview_window_down"
        "preview_window_left"
        "preview_window_up"
      ];
      filterExpr =
        "not ("
        + (builtins.concatStringsSep " or " (map (testName: "test(${testName})") skippedTests))
        + ")";
    in
    ''
      cargo nextest run --features test-utils --release --offline -E '${filterExpr}'
    '';

  passthru = {
    tests.version = testers.testVersion { package = skim; };
@@ -70,7 +100,7 @@ rustPlatform.buildRustPackage rec {
  meta = {
    description = "Command-line fuzzy finder written in Rust";
    homepage = "https://github.com/skim-rs/skim";
    changelog = "https://github.com/skim-rs/skim/releases/tag/v${version}";
    changelog = "https://github.com/skim-rs/skim/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      dywedir
@@ -79,4 +109,4 @@ rustPlatform.buildRustPackage rec {
    ];
    mainProgram = "sk";
  };
}
})