summary refs log tree commit diff
path: root/pkgs/tools/security/scrypt/default.nix
blob: aad2873d4aca04cfc2729aeccf76ba8683368d7d (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
43
44
45
{ lib
, stdenv
, fetchurl
, openssl
, getconf
, util-linux
}:

stdenv.mkDerivation rec {
  pname = "scrypt";
  version = "1.3.1";

  src = fetchurl {
    url = "https://www.tarsnap.com/scrypt/${pname}-${version}.tgz";
    sha256 = "1hnl0r6pmyxiy4dmafmqk1db7wpc0x9rqpzqcwr9d2cmghcj6byz";
  };

  outputs = [ "out" "lib" "dev" ];

  configureFlags = [ "--enable-libscrypt-kdf" ];

  buildInputs = [ openssl ];

  nativeBuildInputs = [ getconf ];

  patchPhase = ''
    for f in Makefile.in autotools/Makefile.am libcperciva/cpusupport/Build/cpusupport.sh configure ; do
      substituteInPlace $f --replace "command -p " ""
    done

    patchShebangs tests/test_scrypt.sh
  '';

  doCheck = true;
  checkTarget = "test";
  nativeCheckInputs = lib.optionals stdenv.isLinux [ util-linux ];

  meta = with lib; {
    description = "Encryption utility";
    homepage    = "https://www.tarsnap.com/scrypt.html";
    license     = licenses.bsd2;
    platforms   = platforms.all;
    maintainers = with maintainers; [ thoughtpolice ];
  };
}