1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 installShellFiles,
7 pkg-config,
8 libiconv,
9 openssl,
10}:
11
12rustPlatform.buildRustPackage {
13 pname = "finalfrontier";
14 version = "unstable-2022-01-06";
15
16 src = fetchFromGitHub {
17 owner = "finalfusion";
18 repo = "finalfrontier";
19 rev = "2461fb1dde13b73039926aa66606e470907a1b59";
20 sha256 = "sha256-bnRzXIYairlBjv2JxU16UXYc5BB3VeKZNiJ4+XDzub4=";
21 };
22
23 cargoHash = "sha256-AQiXRKOXV7kXiu9GbtPE0Rddy93t1Y5tuJmww4xFSaU=";
24
25 nativeBuildInputs = [
26 installShellFiles
27 pkg-config
28 ];
29
30 buildInputs = [
31 openssl
32 ]
33 ++ lib.optionals stdenv.hostPlatform.isDarwin [
34 libiconv
35 ];
36
37 postInstall = ''
38 installManPage man/*.1
39
40 # Install shell completions
41 for shell in bash fish zsh; do
42 $out/bin/finalfrontier completions $shell > finalfrontier.$shell
43 done
44 installShellCompletion finalfrontier.{bash,fish,zsh}
45 '';
46
47 meta = with lib; {
48 description = "Utility for training word and subword embeddings";
49 mainProgram = "finalfrontier";
50 homepage = "https://github.com/finalfusion/finalfrontier/";
51 license = licenses.asl20;
52 maintainers = [ ];
53 };
54}