nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchCrate,
5 stdenv,
6 libiconv,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "fst";
11 version = "0.4.3";
12
13 src = fetchCrate {
14 inherit version;
15 crateName = "fst-bin";
16 hash = "sha256-x2rvLMOhatMWU2u5GAdpYy2uuwZLi3apoE6aaTF+M1g=";
17 };
18
19 cargoHash = "sha256-zO2RYJpTyFFEQ+xZH4HU0CPaeiy6G3uq/qOwPawYSkk=";
20
21 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
22
23 doInstallCheck = true;
24 installCheckPhase = ''
25 csv="$(mktemp)"
26 fst="$(mktemp)"
27 printf "abc,1\nabcd,1" > "$csv"
28 $out/bin/fst map "$csv" "$fst" --force
29 $out/bin/fst fuzzy "$fst" 'abc'
30 $out/bin/fst --help > /dev/null
31 '';
32
33 meta = {
34 description = "Represent large sets and maps compactly with finite state transducers";
35 mainProgram = "fst";
36 homepage = "https://github.com/BurntSushi/fst";
37 license = with lib.licenses; [
38 unlicense # or
39 mit
40 ];
41 maintainers = with lib.maintainers; [ rmcgibbo ];
42 };
43}