nixpkgs/pkgs/applications/science/machine-learning/finalfrontier/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

52 lines
1.1 KiB
Nix

{ 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 lib; {
description = "Utility for training word and subword embeddings";
homepage = "https://github.com/finalfusion/finalfrontier/";
license = licenses.asl20;
maintainers = with maintainers; [ danieldk ];
};
}