summary refs log tree commit diff
path: root/pkgs/tools/security/mpw/default.nix
blob: a565c3b96e14e605498b681ebb5d95aded8ec4a3 (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
42
{ stdenv, fetchurl, autoconf, automake, openssl, libxml2 }:

let
  scrypt_src = fetchurl {
    url = "http://masterpasswordapp.com/libscrypt-b12b554.tar.gz";
    sha256 = "02vz4i66v1acd15xjgki4ilmmp28m6a5603gi4hf8id3d3ndl9n7";
  };

in stdenv.mkDerivation {
  name = "mpw-2.1-cli4";

  srcs = [
    (fetchurl {
      url = "https://ssl.masterpasswordapp.com/mpw-2.1-cli4-0-gf6b2287.tar.gz";
      sha256 = "141bzb3nj18rbnbpdvsri8cdwwwxz4d6akyhfa834542xf96b9vf";
    })
    scrypt_src
  ];

  sourceRoot = ".";

  postUnpack = ''
    cp -R libscrypt-b12b554/* lib/scrypt
  '';

  prePatch = ''
    patchShebangs .
  '';

  NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";

  buildInputs = [ autoconf automake openssl libxml2 ];

  buildPhase = ''
    targets="mpw mpw-tests" ./build
  '';

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