about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/ripasso/cursive.nix
blob: 1a4b1de1b1fb3a4115ffe80c94fdf5136de5f1fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ stdenv, lib, rustPlatform, fetchFromGitHub, pkg-config, ncurses, python3, openssl, libgpgerror, gpgme, xorg, AppKit, Security, installShellFiles }:

with rustPlatform;
buildRustPackage rec {
  version = "0.5.1";
  pname = "ripasso-cursive";

  src = fetchFromGitHub {
    owner = "cortex";
    repo = "ripasso";
    rev  = "release-${version}";
    sha256 = "1jx6qv7skikl1ap3g1r34rkz4ab756kra7dgwwv45vl2fb6x74k4";
  };

  patches = [ ./fix-tests.patch ];

  cargoSha256 = "1li1gmcs7lnjr4qhzs0rrgngdcxy1paiibjwk9zx2rrs71021cgk";

  cargoBuildFlags = [ "-p ripasso-cursive" ];

  nativeBuildInputs = [ pkg-config gpgme python3 installShellFiles ];
  buildInputs = [
    ncurses openssl libgpgerror gpgme xorg.libxcb
  ] ++ lib.optionals stdenv.isDarwin [ AppKit Security ];

  preCheck = ''
    export HOME=$TMPDIR
  '';

  postInstall = ''
    installManPage target/man-page/cursive/ripasso-cursive.1
  '';

  meta = with lib; {
    description = "A simple password manager written in Rust";
    homepage = "https://github.com/cortex/ripasso";
    license = licenses.gpl3;
    maintainers = with maintainers; [ sgo ];
    platforms = platforms.unix;
  };
}