depot/third_party/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
Default email ec92d4d331 Project import generated by Copybara.
GitOrigin-RevId: 540dccb2aeaffa9dc69bfdc41c55abd7ccc6baa3
2021-05-28 11:39:13 +02:00

55 lines
1.2 KiB
Nix

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, installShellFiles
, blas
, gfortran
, lapack
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "finalfusion-utils";
version = "0.12.0";
src = fetchFromGitHub {
owner = "finalfusion";
repo = pname;
rev = version;
sha256 = "0gxcjrhfa86kz5qmdf5h278ydc3nc0nfj61brnykb723mg45jj41";
};
cargoSha256 = "0dj3xpinzzdfgy06wkp336sp1nyqk7nnvd3hwhyysripmz9apdgg";
# Enables build against a generic BLAS.
cargoBuildFlags = [
"--features"
"netlib"
];
nativeBuildInputs = [ installShellFiles ];
buildInputs = [
blas
gfortran.cc.lib
lapack
] ++ lib.optionals stdenv.isDarwin [
Security
];
postInstall = ''
# Install shell completions
for shell in bash fish zsh; do
$out/bin/finalfusion completions $shell > finalfusion.$shell
done
installShellCompletion finalfusion.{bash,fish,zsh}
'';
meta = with lib; {
description = "Utility for converting, quantizing, and querying word embeddings";
homepage = "https://github.com/finalfusion/finalfusion-utils/";
license = licenses.asl20;
maintainers = with maintainers; [ danieldk ];
};
}