3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.4 KiB
Nix
Raw Normal View History

{ lib
, rustPlatform
, fetchFromGitHub
2021-10-25 16:36:50 +01:00
, stdenv
, enableCompletions ? stdenv.hostPlatform == stdenv.buildPlatform
2021-10-25 16:36:50 +01:00
, installShellFiles
, pkg-config
, Security
, libiconv
2021-10-25 16:36:50 +01:00
, openssl
}:
2021-10-25 16:36:50 +01:00
rustPlatform.buildRustPackage rec {
pname = "himalaya";
version = "0.5.8";
src = fetchFromGitHub {
owner = "soywod";
repo = pname;
rev = "v${version}";
sha256 = "sha256-Ejaspj0YpkGmfO1omOhx8ZDg77J7NqC32mw5Cd3K1FM=";
};
cargoSha256 = "sha256-xce2iHrqTxIirrut4dN7526pjE4T+ruaDS44jr+KeGs=";
2021-10-25 16:36:50 +01:00
nativeBuildInputs = lib.optionals enableCompletions [ installShellFiles ]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
buildInputs =
if stdenv.hostPlatform.isDarwin then [
Security
libiconv
] else [
openssl
];
cargoTestFlags = [ "--lib" ];
postInstall = lib.optionalString enableCompletions ''
# Install shell function
installShellCompletion --cmd himalaya \
--bash <($out/bin/himalaya completion bash) \
--fish <($out/bin/himalaya completion fish) \
--zsh <($out/bin/himalaya completion zsh)
'';
meta = with lib; {
description = "CLI email client written in Rust";
homepage = "https://github.com/soywod/himalaya";
2021-10-25 16:36:50 +01:00
changelog = "https://github.com/soywod/himalaya/blob/v${version}/CHANGELOG.md";
license = licenses.bsdOriginal;
maintainers = with maintainers; [ yanganto ];
};
}