at 23.11-beta 42 lines 1.3 kB view raw
1let version = "2.9.11"; in 2{ stdenv, lib, buildPackages, fetchurl, zlib, gettext 3, lists ? [ (fetchurl { 4 url = "https://github.com/cracklib/cracklib/releases/download/v${version}/cracklib-words-${version}.gz"; 5 hash = "sha256-popxGjE1c517Z+nzYLM/DU7M+b1/rE0XwNXkVqkcUXo="; 6}) ] 7}: 8 9stdenv.mkDerivation rec { 10 pname = "cracklib"; 11 inherit version; 12 13 src = fetchurl { 14 url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2"; 15 hash = "sha256-yosEmjwtOyIloejRXWE3mOvHSOOVA4jtomlN5Qe6YCA="; 16 }; 17 18 nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib; 19 buildInputs = [ zlib gettext ]; 20 21 postPatch = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' 22 chmod +x util/cracklib-format 23 patchShebangs util 24 25 '' + '' 26 ln -vs ${toString lists} dicts/ 27 ''; 28 29 postInstall = '' 30 make dict-local 31 ''; 32 doInstallCheck = true; 33 installCheckTarget = "test"; 34 35 meta = with lib; { 36 homepage = "https://github.com/cracklib/cracklib"; 37 description = "A library for checking the strength of passwords"; 38 license = licenses.lgpl21; # Different license for the wordlist: http://www.openwall.com/wordlists 39 maintainers = with maintainers; [ lovek323 ]; 40 platforms = platforms.unix; 41 }; 42}