2024-07-15 21:15:44 +00:00
|
|
|
let
|
|
|
|
version = "2.10.0";
|
|
|
|
in
|
2024-07-27 00:43:07 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPackages,
|
|
|
|
fetchurl,
|
|
|
|
zlib,
|
|
|
|
gettext,
|
|
|
|
fetchpatch2,
|
2023-10-10 14:52:00 +00:00
|
|
|
lists ? [
|
|
|
|
(fetchurl {
|
2019-03-04 05:50:37 +00:00
|
|
|
url = "https://github.com/cracklib/cracklib/releases/download/v${version}/cracklib-words-${version}.gz";
|
2024-07-15 21:15:44 +00:00
|
|
|
hash = "sha256-JDLo/bSLIijC2DUl+8Q704i2zgw5cxL6t68wvuivPpY=";
|
2019-03-04 05:50:37 +00:00
|
|
|
})
|
|
|
|
],
|
|
|
|
}:
|
2005-10-25 13:54:52 +00:00
|
|
|
|
2009-02-18 11:40:32 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-03-04 04:37:13 +00:00
|
|
|
pname = "cracklib";
|
2019-03-04 05:50:37 +00:00
|
|
|
inherit version;
|
2009-02-18 11:40:32 +00:00
|
|
|
|
2005-10-25 13:54:52 +00:00
|
|
|
src = fetchurl {
|
2019-03-04 04:37:13 +00:00
|
|
|
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
|
2024-07-15 21:15:44 +00:00
|
|
|
hash = "sha256-cAw5YMplCx6vAhfWmskZuBHyB1o4dGd7hMceOG3V51Y=";
|
2005-10-25 13:54:52 +00:00
|
|
|
};
|
2009-02-18 11:40:32 +00:00
|
|
|
|
2024-07-27 00:43:07 +00:00
|
|
|
patches = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
# Fixes build failure on Darwin due to missing byte order functions.
|
|
|
|
# https://github.com/cracklib/cracklib/pull/96
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/cracklib/cracklib/commit/dff319e543272c1fb958261cf9ee8bb82960bc40.patch";
|
|
|
|
hash = "sha256-QaWpEVV6l1kl4OIkJAqkXPVThbo040Rv9X2dY/+syqs=";
|
|
|
|
stripLen = 1;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-04-18 00:25:40 +00:00
|
|
|
nativeBuildInputs = lib.optional (
|
|
|
|
stdenv.hostPlatform != stdenv.buildPlatform
|
|
|
|
) buildPackages.cracklib;
|
2018-03-14 19:15:06 +00:00
|
|
|
buildInputs = [
|
|
|
|
zlib
|
|
|
|
gettext
|
|
|
|
];
|
2013-07-03 12:00:52 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
postPatch =
|
|
|
|
lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2019-03-04 05:17:20 +00:00
|
|
|
chmod +x util/cracklib-format
|
|
|
|
patchShebangs util
|
2019-03-04 05:50:37 +00:00
|
|
|
|
2020-03-10 22:55:56 +00:00
|
|
|
''
|
|
|
|
+ ''
|
2023-10-10 14:52:00 +00:00
|
|
|
ln -vs ${toString lists} dicts/
|
2019-03-04 05:17:20 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2019-04-18 00:25:40 +00:00
|
|
|
make dict-local
|
2019-03-04 05:17:20 +00:00
|
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "test";
|
|
|
|
|
2019-04-18 00:25:40 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/cracklib/cracklib";
|
2009-02-18 11:40:32 +00:00
|
|
|
description = "Library for checking the strength of passwords";
|
2018-08-15 18:17:54 +00:00
|
|
|
license = licenses.lgpl21; # Different license for the wordlist: http://www.openwall.com/wordlists
|
2013-07-03 12:00:52 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2009-02-18 11:40:32 +00:00
|
|
|
};
|
2005-10-25 13:54:52 +00:00
|
|
|
}
|