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
933 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";
2023-03-22 02:07:56 +00:00
version = "0.4.3";
2021-03-10 23:43:57 +00:00
src = fetchCrate {
inherit version;
crateName = "fst-bin";
2023-03-22 02:07:56 +00:00
sha256 = "sha256-x2rvLMOhatMWU2u5GAdpYy2uuwZLi3apoE6aaTF+M1g=";
2021-03-10 23:43:57 +00:00
};
2023-03-22 02:07:56 +00:00
cargoHash = "sha256-yTbEaw+BbjVks3j7/b75kGoUjVftLaVYvYIdI/bbfdk=";
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 ];
};
}