nixpkgs-suyu/pkgs/development/libraries/libxcrypt/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.8 KiB
Nix
Raw Normal View History

2023-03-25 10:44:21 +01:00
{ lib, stdenv, fetchurl, perl
# Update the enabled crypt scheme ids in passthru when the enabled hashes change
, enableHashes ? "strong"
, nixosTests
, runCommand
, python3
2023-03-25 10:44:21 +01:00
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libxcrypt";
version = "4.4.36";
src = fetchurl {
url = "https://github.com/besser82/libxcrypt/releases/download/v${finalAttrs.version}/libxcrypt-${finalAttrs.version}.tar.xz";
hash = "sha256-5eH0yu4KAd4q7ibjE4gH1tPKK45nKHlm0f79ZeH9iUM=";
};
outputs = [
"out"
"man"
];
configureFlags = [
2023-03-25 10:44:21 +01:00
"--enable-hashes=${enableHashes}"
"--enable-obsolete-api=glibc"
"--disable-failure-tokens"
# required for musl, android, march=native
2022-09-26 22:44:58 +02:00
"--disable-werror"
2022-10-01 16:24:38 +02:00
];
nativeBuildInputs = [
perl
];
enableParallelBuilding = true;
doCheck = true;
passthru = {
tests = {
inherit (nixosTests) login shadow;
passthruMatches = runCommand "libxcrypt-test-passthru-matches" { } ''
${python3.interpreter} "${./check_passthru_matches.py}" ${lib.escapeShellArgs ([ finalAttrs.src enableHashes "--" ] ++ finalAttrs.passthru.enabledCryptSchemeIds)}
touch "$out"
'';
};
enabledCryptSchemeIds = [
# https://github.com/besser82/libxcrypt/blob/v4.4.35/lib/hashes.conf
"y" # yescrypt
"gy" # gost_yescrypt
"7" # scrypt
"2b" # bcrypt
"2y" # bcrypt_y
"2a" # bcrypt_a
"6" # sha512crypt
];
};
meta = with lib; {
changelog = "https://github.com/besser82/libxcrypt/blob/v${finalAttrs.version}/NEWS";
description = "Extended crypt library for descrypt, md5crypt, bcrypt, and others";
homepage = "https://github.com/besser82/libxcrypt/";
platforms = platforms.all;
2022-10-09 21:07:00 +02:00
maintainers = with maintainers; [ dottedmag hexa ];
license = licenses.lgpl21Plus;
};
})