1{ stdenv
2, lib
3, rustPlatform
4, fetchFromGitHub
5, fetchpatch
6, pkg-config
7, python3
8, openssl
9, libgpg-error
10, gpgme
11, xorg
12, nettle
13, llvmPackages
14, clang
15, AppKit
16, Security
17, installShellFiles
18}:
19
20rustPlatform.buildRustPackage rec {
21 version = "0.6.4";
22 pname = "ripasso-cursive";
23
24 src = fetchFromGitHub {
25 owner = "cortex";
26 repo = "ripasso";
27 rev = "release-${version}";
28 hash = "sha256-9wBaFq2KVfLTd1j8ZPoUlmZJDW2UhvGBAaCGX+qg92s=";
29 };
30
31 patches = [
32 ./fix-tests.patch
33 ];
34
35 cargoPatches = [
36 ./fix-build.patch
37 ];
38
39 cargoLock = {
40 lockFile = ./Cargo.lock;
41 outputHashes = {
42 "qml-0.0.9" = "sha256-ILqvUaH7nSu2JtEs8ox7KroOzYnU5ai44k1HE4Bz5gg=";
43 };
44 };
45
46 cargoBuildFlags = [ "-p ripasso-cursive" ];
47
48 nativeBuildInputs = [
49 pkg-config
50 gpgme
51 python3
52 installShellFiles
53 clang
54 rustPlatform.bindgenHook
55 ];
56
57 buildInputs = [
58 openssl
59 libgpg-error
60 gpgme
61 xorg.libxcb
62 nettle
63 ] ++ lib.optionals stdenv.isDarwin [
64 AppKit
65 Security
66 ];
67
68 preCheck = ''
69 export HOME=$TMPDIR
70 '';
71
72 postInstall = ''
73 installManPage target/man-page/cursive/ripasso-cursive.1
74 '';
75
76 meta = with lib; {
77 description = "A simple password manager written in Rust";
78 homepage = "https://github.com/cortex/ripasso";
79 license = licenses.gpl3;
80 maintainers = with maintainers; [ sgo ];
81 platforms = platforms.unix;
82 };
83}