1{ lib
2, stdenv
3, fetchurl
4, openssl
5, getconf
6, util-linux
7}:
8
9stdenv.mkDerivation rec {
10 pname = "scrypt";
11 version = "1.3.2";
12
13 src = fetchurl {
14 url = "https://www.tarsnap.com/scrypt/${pname}-${version}.tgz";
15 sha256 = "sha256-1jLBGTQgrG+uv5SC5l4z06VmTszWQ7CaUJ0h0cHym+I=";
16 };
17
18 outputs = [ "out" "lib" "dev" ];
19
20 configureFlags = [ "--enable-libscrypt-kdf" ];
21
22 buildInputs = [ openssl ];
23
24 nativeBuildInputs = [ getconf ];
25
26 patchPhase = ''
27 for f in Makefile.in autotools/Makefile.am libcperciva/cpusupport/Build/cpusupport.sh configure ; do
28 substituteInPlace $f --replace "command -p " ""
29 done
30
31 patchShebangs tests/test_scrypt.sh
32 '';
33
34 doCheck = true;
35 checkTarget = "test";
36 nativeCheckInputs = lib.optionals stdenv.isLinux [ util-linux ];
37
38 meta = with lib; {
39 description = "Encryption utility";
40 homepage = "https://www.tarsnap.com/scrypt.html";
41 license = licenses.bsd2;
42 platforms = platforms.all;
43 maintainers = with maintainers; [ thoughtpolice ];
44 };
45}