From 41f00c89185c1297f05c2fbcd25a0927f6c69f91 Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Mon, 19 Apr 2021 17:08:34 +0800 Subject: [PATCH] himalaya: init at 0.2.6 - make shell completion optional - specify security and libiconv for apple --- .../mailreaders/himalaya/default.nix | 54 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 58 insertions(+) create mode 100644 pkgs/applications/networking/mailreaders/himalaya/default.nix diff --git a/pkgs/applications/networking/mailreaders/himalaya/default.nix b/pkgs/applications/networking/mailreaders/himalaya/default.nix new file mode 100644 index 000000000000..76f1e92d5f5b --- /dev/null +++ b/pkgs/applications/networking/mailreaders/himalaya/default.nix @@ -0,0 +1,54 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, openssl +, pkg-config +, installShellFiles +, enableCompletions ? stdenv.hostPlatform == stdenv.buildPlatform +, Security +, libiconv +}: +rustPlatform.buildRustPackage rec { + pname = "himalaya"; + version = "0.2.6"; + + src = fetchFromGitHub { + owner = "soywod"; + repo = pname; + rev = "v${version}"; + sha256 = "1fl3lingb4wdh6bz4calzbibixg44wnnwi1qh0js1ijp8b6ll560"; + }; + + cargoSha256 = "10p8di71w7hn36b1994wgk33fnj641lsp80zmccinlg5fiwyzncx"; + + nativeBuildInputs = [ ] + ++ lib.optionals (enableCompletions) [ installShellFiles ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ]; + + buildInputs = + if stdenv.hostPlatform.isDarwin then [ + Security + libiconv + ] else [ + openssl + ]; + + # The completions are correctly installed, and there is issue that himalaya + # generate empty completion files without mail configure. + # This supposed to be fixed in 0.2.7 + 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"; + license = licenses.bsd3; + maintainers = with maintainers; [ yanganto ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 039a95b6c0dc..9c0753a01e31 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23479,6 +23479,10 @@ in hexedit = callPackage ../applications/editors/hexedit { }; + himalaya = callPackage ../applications/networking/mailreaders/himalaya { + inherit (darwin.apple_sdk.frameworks) Security; + }; + hipchat = callPackage ../applications/networking/instant-messengers/hipchat { }; hivelytracker = callPackage ../applications/audio/hivelytracker { };