2023-03-15 16:39:30 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, perl
|
|
|
|
, stdenv
|
|
|
|
}:
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "teip";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "2.3.0";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "greymd";
|
|
|
|
repo = "teip";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-09IKAM1ha40CvF5hdQIlUab7EBBFourC70LAagrs5+4=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
cargoHash = "sha256-cBFczgvLja6upuPnXphG2d9Rf1ZpNAVh16NHAHfXxHg=";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ perl ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
# Cargo.lock is outdated
|
|
|
|
preConfigure = ''
|
|
|
|
cargo update --offline
|
|
|
|
'';
|
|
|
|
|
|
|
|
# tests are locale sensitive
|
|
|
|
preCheck = ''
|
|
|
|
export LANG=${if stdenv.isDarwin then "en_US.UTF-8" else "C.UTF-8"}
|
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage man/teip.1
|
2023-03-15 16:39:30 +00:00
|
|
|
installShellCompletion \
|
|
|
|
--bash completion/bash/teip \
|
|
|
|
--fish completion/fish/teip.fish \
|
|
|
|
--zsh completion/zsh/_teip
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A tool to bypass a partial range of standard input to any command";
|
|
|
|
homepage = "https://github.com/greymd/teip";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/greymd/teip/releases/tag/v${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|