about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/mpw/default.nix
blob: 0994c649c83e8a81c6490571360e9692a6c10ba4 (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
{ stdenv, cmake, fetchFromGitHub, ncurses, libsodium, json_c }:

stdenv.mkDerivation rec {
  name = "mpw-2.6-f8043ae";

  src = fetchFromGitHub {
    owner = "Lyndir";
    repo = "MasterPassword";
    rev = "f8043ae16d73ddfb205aadd25c35cd9c5e95b228";
    sha256 = "0hy02ri7y3sca85z3ff5i68crwav5cjd7rrdqj7jrnpp1bw4yapi";
  };

  postUnpack = ''
    sourceRoot+=/platform-independent/cli-c
  '';

  preConfigure = ''
    substituteInPlace CMakeLists.txt --replace curses ncurses
    echo ${name} > VERSION
  '';

  dontUseCmakeBuildDir = true;

  nativeBuildInputs = [ cmake ];

  buildInputs = [ ncurses libsodium json_c ];

  installPhase = ''
    mkdir -p $out/bin
    mv mpw $out/bin/mpw
  '';

  meta = with stdenv.lib; {
    homepage = https://masterpasswordapp.com/;
    description = "A stateless password management solution";
    license = licenses.gpl3;
    platforms = platforms.unix;
  };
}