nixpkgs/pkgs/tools/text/fst/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
935 B
Nix
Raw Normal View History

2021-03-10 23:43:57 +00:00
{ lib
, rustPlatform
, fetchCrate
, stdenv
2021-03-10 23:43:57 +00:00
, libiconv
}:
rustPlatform.buildRustPackage rec {
pname = "fst";
version = "0.4.2";
2021-03-10 23:43:57 +00:00
src = fetchCrate {
inherit version;
crateName = "fst-bin";
sha256 = "sha256-m9JDVHy+o4RYLGkYnhOpTuLyJjXtOwwl2SQpzRuz1m0=";
2021-03-10 23:43:57 +00:00
};
cargoSha256 = "sha256-RMjNk8tE7AYBYgys4IjCCfgPdDgwbYVmrWpWNBOf70E=";
2021-03-10 23:43:57 +00:00
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
doInstallCheck = true;
installCheckPhase = ''
csv="$(mktemp)"
fst="$(mktemp)"
printf "abc,1\nabcd,1" > "$csv"
$out/bin/fst map "$csv" "$fst" --force
$out/bin/fst fuzzy "$fst" 'abc'
$out/bin/fst --help > /dev/null
'';
meta = with lib; {
description = "Represent large sets and maps compactly with finite state transducers";
homepage = "https://github.com/BurntSushi/fst";
license = with licenses; [ unlicense /* or */ mit ];
maintainers = with maintainers; [ rmcgibbo ];
};
}