at 24.05-pre 51 lines 1.8 kB view raw
1{ lib, stdenv, fetchFromGitHub, fetchpatch, fixDarwinDylibNames }: 2 3stdenv.mkDerivation rec { 4 pname = "libargon2"; 5 version = "20190702"; 6 7 src = fetchFromGitHub { 8 owner = "P-H-C"; 9 repo = "phc-winner-argon2"; 10 rev = version; 11 sha256 = "0p4ry9dn0mi9js0byijxdyiwx74p1nr8zj7wjpd1fjgqva4sk23i"; 12 }; 13 14 nativeBuildInputs = lib.optionals stdenv.isDarwin [ 15 fixDarwinDylibNames 16 ]; 17 18 patches = [ 19 # TODO: remove when https://github.com/P-H-C/phc-winner-argon2/pull/277 is merged + released 20 (fetchpatch { 21 url = "https://github.com/P-H-C/phc-winner-argon2/commit/cd1c1d8d204e4ec4557e358013567c097cb70562.patch"; 22 sha256 = "0whqv8b6q9602n7vxpzbd8bk8wz22r1jz9x5lrm9z7ib3wz81c8a"; 23 }) 24 ]; 25 26 makeFlags = [ 27 "AR=${stdenv.cc.targetPrefix}ar" # Fix cross-compilation 28 "PREFIX=${placeholder "out"}" 29 "ARGON2_VERSION=${version}" 30 "LIBRARY_REL=lib" 31 "PKGCONFIG_REL=lib" 32 ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 33 "LIBRARIES=$(LIB_ST)" 34 ]; 35 36 meta = with lib; { 37 description = "A key derivation function that was selected as the winner of the Password Hashing Competition in July 2015"; 38 longDescription = '' 39 A password-hashing function created by by Alex Biryukov, Daniel Dinu, and 40 Dmitry Khovratovich. Argon2 was declared the winner of the Password 41 Hashing Competition (PHC). There were 24 submissions and 9 finalists. 42 Catena, Lyra2, Makwa and yescrypt were given special recognition. The PHC 43 recommends using Argon2 rather than legacy algorithms. 44 ''; 45 homepage = "https://www.argon2.com/"; 46 license = with licenses; [ asl20 cc0 ]; 47 maintainers = with maintainers; [ taeer olynch ]; 48 mainProgram = "argon2"; 49 platforms = platforms.all; 50 }; 51}