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";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.10.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "sha256-LkPkwYsaSLfaZktHF23Fgaks+fDlbB1S6SRgXtJRBqQ=";
|
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" ];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
cargoSha256 = "sha256-lG26dgvjqCZ/4KgzurMrlhl+JKec+xLt/5uA6XcsSPk=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|