2022-10-09 18:49:37 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, nixosTests }:
|
2021-02-28 12:44:53 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libxcrypt";
|
2022-11-18 09:44:04 +00:00
|
|
|
version = "4.4.33";
|
2021-02-28 12:44:53 +00:00
|
|
|
|
2022-07-17 01:01:01 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/besser82/libxcrypt/releases/download/v${version}/libxcrypt-${version}.tar.xz";
|
2022-11-18 09:44:04 +00:00
|
|
|
hash = "sha256-6HrPnGUsVzpHE9VYIVn5jzBdVu1fdUzmT1fUGU1rOm8=";
|
2021-02-28 12:44:53 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 18:45:30 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
2022-07-17 01:01:01 +00:00
|
|
|
configureFlags = [
|
2023-03-10 18:25:45 +00:00
|
|
|
# Update the enabled crypt scheme ids in passthru when the enabled hashes change
|
|
|
|
"--enable-hashes=strong"
|
2022-07-17 01:01:01 +00:00
|
|
|
"--enable-obsolete-api=glibc"
|
|
|
|
"--disable-failure-tokens"
|
2022-11-16 13:58:25 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.libc == "bionic") [
|
2022-09-26 20:44:58 +00:00
|
|
|
"--disable-werror"
|
2022-10-01 14:24:38 +00:00
|
|
|
];
|
|
|
|
|
2022-07-17 01:01:01 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
perl
|
2022-05-01 15:32:16 +00:00
|
|
|
];
|
|
|
|
|
2022-07-17 01:01:01 +00:00
|
|
|
enableParallelBuilding = true;
|
2021-02-28 12:44:53 +00:00
|
|
|
|
2022-11-01 16:28:49 +00:00
|
|
|
doCheck = true;
|
2021-02-28 12:44:53 +00:00
|
|
|
|
2023-03-10 18:25:45 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
inherit (nixosTests) login shadow;
|
|
|
|
};
|
|
|
|
enabledCryptSchemeIds = [
|
|
|
|
# https://github.com/besser82/libxcrypt/blob/v4.4.33/lib/hashes.conf
|
|
|
|
"y" # yescrypt
|
|
|
|
"gy" # gost_yescrypt
|
|
|
|
"7" # scrypt
|
|
|
|
"2b" # bcrypt
|
|
|
|
"2y" # bcrypt_y
|
|
|
|
"2a" # bcrypt_a
|
|
|
|
"6" # sha512crypt
|
|
|
|
];
|
2022-10-09 18:49:37 +00:00
|
|
|
};
|
|
|
|
|
2021-02-28 12:44:53 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Extended crypt library for descrypt, md5crypt, bcrypt, and others";
|
|
|
|
homepage = "https://github.com/besser82/libxcrypt/";
|
|
|
|
platforms = platforms.all;
|
2022-10-09 19:07:00 +00:00
|
|
|
maintainers = with maintainers; [ dottedmag hexa ];
|
2021-02-28 12:44:53 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
};
|
|
|
|
}
|