1 { lib, stdenv, fetchurl, perl
2 # Update the enabled crypt scheme ids in passthru when the enabled hashes change
3 , enableHashes ? "strong"
9 stdenv.mkDerivation (finalAttrs: {
14 url = "https://github.com/besser82/libxcrypt/releases/download/v${finalAttrs.version}/libxcrypt-${finalAttrs.version}.tar.xz";
15 hash = "sha256-5eH0yu4KAd4q7ibjE4gH1tPKK45nKHlm0f79ZeH9iUM=";
24 "--enable-hashes=${enableHashes}"
25 "--enable-obsolete-api=glibc"
26 "--disable-failure-tokens"
27 # required for musl, android, march=native
31 # fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified
32 makeFlags = lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS=-no-undefined"] ;
38 enableParallelBuilding = true;
44 inherit (nixosTests) login shadow;
46 passthruMatches = runCommand "libxcrypt-test-passthru-matches" { } ''
47 ${python3.interpreter} "${./check_passthru_matches.py}" ${lib.escapeShellArgs ([ finalAttrs.src enableHashes "--" ] ++ finalAttrs.passthru.enabledCryptSchemeIds)}
51 enabledCryptSchemeIds = [
52 # https://github.com/besser82/libxcrypt/blob/v4.4.35/lib/hashes.conf
64 changelog = "https://github.com/besser82/libxcrypt/blob/v${finalAttrs.version}/NEWS";
65 description = "Extended crypt library for descrypt, md5crypt, bcrypt, and others";
66 homepage = "https://github.com/besser82/libxcrypt/";
67 platforms = platforms.all;
68 maintainers = with maintainers; [ dottedmag hexa ];
69 license = licenses.lgpl21Plus;