@@ -1,16 +1,15 @@
1−{ lib, stdenv, fetchFromGitHub, nasm, which }:
1+{ lib, stdenv, fetchFromGitHub, }:
22
3−with lib;
43stdenv.mkDerivation rec {
54 pname = "crypto++";
6− version = "8.2.0";
7− underscoredVersion = strings.replaceStrings ["."] ["_"] version;
5+ version = "8.4.0";
6+ underscoredVersion = lib.strings.replaceStrings ["."] ["_"] version;
87
98 src = fetchFromGitHub {
109 owner = "weidai11";
1110 repo = "cryptopp";
1211 rev = "CRYPTOPP_${underscoredVersion}";
13− sha256 = "01zrrzjn14yhkb9fzzl57vmh7ig9a6n6fka45f8za0gf7jpcq3mj";
12+ sha256 = "1gwn8yh1mh41hkh6sgnhb9c3ygrdazd7645msl20i0zdvcp7f5w3";
1413 };
1514
1615 postPatch = ''
@@ -19,9 +18,6 @@ stdenv.mkDerivation rec {
1918 --replace "ARFLAGS = -static -o" "ARFLAGS = -cru"
2019 '';
2120
22− nativeBuildInputs = optionals stdenv.hostPlatform.isx86 [ nasm which ];
23−
24− preBuild = optionalString stdenv.hostPlatform.isx86 "${stdenv.shell} rdrand-nasm.sh";
2521 makeFlags = [ "PREFIX=${placeholder "out"}" ];
2622 buildFlags = [ "shared" "libcryptopp.pc" ];
2723 enableParallelBuilding = true;
@@ -31,17 +27,17 @@ stdenv.mkDerivation rec {
3127 preInstall = "rm libcryptopp.a"; # built for checks but we don't install static lib into the nix store
3228 installTargets = [ "install-lib" ];
3329 installFlags = [ "LDCONF=true" ];
34− postInstall = optionalString (!stdenv.hostPlatform.isDarwin) ''
35− ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${versions.majorMinor version}
36− ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${versions.major version}
30+ postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
31+ ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.majorMinor version}
32+ ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.major version}
3733 '';
3834
3935 meta = {
4036 description = "Crypto++, a free C++ class library of cryptographic schemes";
4137 homepage = "https://cryptopp.com/";
4238 changelog = "https://raw.githubusercontent.com/weidai11/cryptopp/CRYPTOPP_${underscoredVersion}/History.txt";
43− license = with licenses; [ boost publicDomain ];
44− platforms = platforms.all;
45− maintainers = with maintainers; [ c0bw3b ];
39+ license = with lib.licenses; [ boost publicDomain ];
40+ platforms = lib.platforms.all;
41+ maintainers = with lib.maintainers; [ c0bw3b ];
4642 };
4743}