2022-04-18 01:30:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2022-08-14 02:33:37 +00:00
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
2022-04-18 01:30:05 +00:00
|
|
|
, libxcb
|
2022-08-14 02:33:37 +00:00
|
|
|
, openssl
|
|
|
|
# Darwin dependencies
|
2022-04-18 01:30:05 +00:00
|
|
|
, AppKit
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "didyoumean";
|
2022-12-27 05:53:46 +00:00
|
|
|
version = "1.1.4";
|
2022-04-18 01:30:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hisbaan";
|
|
|
|
repo = "didyoumean";
|
|
|
|
rev = "v${version}";
|
2022-12-27 05:53:46 +00:00
|
|
|
sha256 = "sha256-PSEoh1OMElFJ8m4er1vBMkQak3JvLjd+oWNWA46cows=";
|
2022-04-18 01:30:05 +00:00
|
|
|
};
|
|
|
|
|
2022-12-27 05:53:46 +00:00
|
|
|
cargoSha256 = "sha256-QERnohWpkJ0LWkdxHrY6gKxdGqxDkLla7jlG44laojk=";
|
2022-04-18 01:30:05 +00:00
|
|
|
|
2022-08-14 02:33:37 +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-18 01:30:05 +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-14 02:33:37 +00:00
|
|
|
maintainers = with maintainers; [ evanjs wegank ];
|
2022-05-05 00:46:39 +00:00
|
|
|
mainProgram = "dym";
|
2022-04-18 01:30:05 +00:00
|
|
|
};
|
|
|
|
}
|