2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2022-08-21 13:32:41 +00:00
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
2022-04-27 09:35:20 +00:00
|
|
|
, libxcb
|
2022-08-21 13:32:41 +00:00
|
|
|
, openssl
|
|
|
|
# Darwin dependencies
|
2022-04-27 09:35:20 +00:00
|
|
|
, AppKit
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "didyoumean";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "1.1.4";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hisbaan";
|
|
|
|
repo = "didyoumean";
|
|
|
|
rev = "v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
sha256 = "sha256-PSEoh1OMElFJ8m4er1vBMkQak3JvLjd+oWNWA46cows=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
cargoSha256 = "sha256-QERnohWpkJ0LWkdxHrY6gKxdGqxDkLla7jlG44laojk=";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isLinux [
|
|
|
|
libxcb
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage man/dym.1
|
|
|
|
installShellCompletion completions/dym.{bash,fish}
|
|
|
|
installShellCompletion --zsh completions/_dym
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Clipboard doesn't exist in test environment
|
|
|
|
doCheck = false;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A CLI spelling corrector for when you're unsure";
|
|
|
|
homepage = "https://github.com/hisbaan/didyoumean";
|
|
|
|
license = licenses.gpl3Plus;
|
2022-08-21 13:32:41 +00:00
|
|
|
maintainers = with maintainers; [ evanjs wegank ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "dym";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
}
|