{ lib, stdenv, whois, perl, pkg-config }:

stdenv.mkDerivation {
  name = "mkpasswd-${whois.version}";

  src = whois.src;

  nativeBuildInputs = [ perl pkg-config ];

  preConfigure = whois.preConfigure;
  buildPhase = "make mkpasswd";
  installPhase = "make install-mkpasswd";

  meta = with lib; {
    homepage = "https://packages.qa.debian.org/w/whois.html";
    description = "Overfeatured front-end to crypt, from the Debian whois package";
    license = licenses.gpl2;
    maintainers = with maintainers; [ cstrahan fpletz ];
    platforms = platforms.linux;
  };
}

{ lib, stdenv, whois, libxcrypt, perl, pkg-config }:

stdenv.mkDerivation {
  name = "mkpasswd-${whois.version}";

  src = whois.src;

  nativeBuildInputs = [ perl pkg-config ];
  buildInputs = [ libxcrypt ];

  preConfigure = whois.preConfigure;
  buildPhase = "make mkpasswd";
  installPhase = "make install-mkpasswd";

  meta = with lib; {
    homepage = "https://packages.qa.debian.org/w/whois.html";
    description = "Overfeatured front-end to crypt, from the Debian whois package";
    license = licenses.gpl2;
    maintainers = with maintainers; [ cstrahan fpletz ];
    platforms = platforms.linux;
  };
}

Include support for more hash methods
mkpasswd: Include support for more hash methods

(Before) Available methods:
sha512crypt     SHA-512
sha256crypt     SHA-256
md5crypt        MD5
descrypt        standard 56 bit DES-based crypt(3)

(After) Available methods:
yescrypt        Yescrypt
gost-yescrypt   GOST Yescrypt
scrypt          scrypt
bcrypt          bcrypt
bcrypt-a        bcrypt (obsolete $2a$ version)
sha512crypt     SHA-512
sha256crypt     SHA-256
sunmd5          SunMD5
md5crypt        MD5
bsdicrypt       BSDI extended DES-based crypt(3)
descrypt        standard 56 bit DES-based crypt(3)
nt              NT-Hash
