2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchCrate
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "skim";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "0.10.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-C2yK+SO8Tpw3BxXXu1jeDzYJ2548RZa7NFWaE0SdNJ0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
outputs = [ "out" "vim" ];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
cargoHash = "sha256-jBcgoWbmBOgU7M71lr4OXOe2S6NAXl+I8D+ZtT45Vos=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e "s|expand('<sfile>:h:h')|'$out'|" plugin/skim.vim
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -D -m 555 bin/sk-tmux -t $out/bin
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
install -D -m 444 plugin/skim.vim -t $vim/plugin
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
install -D -m 444 shell/* -t $out/share/skim
|
|
|
|
|
|
|
|
installManPage man/man1/*
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cat <<SCRIPT > $out/bin/sk-share
|
|
|
|
#! ${stdenv.shell}
|
|
|
|
# Run this script to find the skim shared folder where all the shell
|
|
|
|
# integration scripts are living.
|
|
|
|
echo $out/share/skim
|
|
|
|
SCRIPT
|
|
|
|
chmod +x $out/bin/sk-share
|
|
|
|
'';
|
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
# https://github.com/lotabout/skim/issues/440
|
|
|
|
doCheck = !stdenv.isAarch64;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Command-line fuzzy finder written in Rust";
|
|
|
|
homepage = "https://github.com/lotabout/skim";
|
|
|
|
license = licenses.mit;
|
2022-08-12 12:06:08 +00:00
|
|
|
mainProgram = "sk";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ dywedir ];
|
|
|
|
};
|
|
|
|
}
|