summary refs log tree commit diff
path: root/pkgs/applications/science/machine-learning/finalfrontier/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/machine-learning/finalfrontier/default.nix')
-rw-r--r--pkgs/applications/science/machine-learning/finalfrontier/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/applications/science/machine-learning/finalfrontier/default.nix b/pkgs/applications/science/machine-learning/finalfrontier/default.nix
new file mode 100644
index 00000000000..f1a2dbaa54f
--- /dev/null
+++ b/pkgs/applications/science/machine-learning/finalfrontier/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, installShellFiles
+, pkg-config
+, libiconv
+, openssl
+, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "finalfrontier";
+  version = "0.9.4";
+
+  src = fetchFromGitHub {
+    owner = "finalfusion";
+    repo = pname;
+    rev = version;
+    sha256 = "1lvwv238p8hrl4sc5pmnvaargl2dd25p44gxl3kibq5ng03afd0n";
+  };
+
+  cargoSha256 = "1ibn22v24brdlrar6j7fryiwimbbw7byak265hrw7a5agf1799x0";
+
+  nativeBuildInputs = [
+    installShellFiles
+    pkg-config
+  ];
+
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
+    libiconv
+    Security
+  ];
+
+  postInstall = ''
+    installManPage man/*.1
+
+    # Install shell completions
+    for shell in bash fish zsh; do
+      $out/bin/finalfrontier completions $shell > finalfrontier.$shell
+    done
+    installShellCompletion finalfrontier.{bash,fish,zsh}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Utility for training word and subword embeddings";
+    homepage = "https://github.com/finalfusion/finalfrontier/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ danieldk ];
+  };
+}