mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-09 22:45:08 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
40 lines
969 B
Nix
40 lines
969 B
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchCrate
|
|
, stdenv
|
|
, libiconv
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "fst";
|
|
version = "0.4.3";
|
|
|
|
src = fetchCrate {
|
|
inherit version;
|
|
crateName = "fst-bin";
|
|
hash = "sha256-x2rvLMOhatMWU2u5GAdpYy2uuwZLi3apoE6aaTF+M1g=";
|
|
};
|
|
|
|
cargoHash = "sha256-yTbEaw+BbjVks3j7/b75kGoUjVftLaVYvYIdI/bbfdk=";
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.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";
|
|
mainProgram = "fst";
|
|
homepage = "https://github.com/BurntSushi/fst";
|
|
license = with licenses; [ unlicense /* or */ mit ];
|
|
maintainers = with maintainers; [ rmcgibbo ];
|
|
};
|
|
}
|