nixpkgs/pkgs/tools/security/scrypt/default.nix
sternenseemann ac4d46972d scrypt: fix build of pkgsStatic.scrypt
The getconf input defaults to the glibc one if it is being used and uses
the netbsd version in all other cases. This fixes the build when
building with musl, since it doesn't ship a version of getconf.
2020-09-18 11:17:00 +02:00

40 lines
994 B
Nix

{ stdenv, fetchurl, openssl, utillinux, getconf }:
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";
checkInputs = [ utillinux ];
meta = with stdenv.lib; {
description = "Encryption utility";
homepage = "https://www.tarsnap.com/scrypt.html";
license = licenses.bsd2;
platforms = platforms.all;
maintainers = with maintainers; [ thoughtpolice ];
};
}