about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/crypto++
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
committerAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
commit9becdcc5df71b47a5da84ad670e9a7eae9e0c65a (patch)
tree2ddf0335eb393f89501e3753b50c3f7ab0552d12 /nixpkgs/pkgs/development/libraries/crypto++
parent49f2a77ac9abc88c253f68952eda26557fc3b555 (diff)
parentff96a0fa5635770390b184ae74debea75c3fd534 (diff)
downloadnixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.gz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.bz2
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.lz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.xz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.zst
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.zip
nixpkgs: merge nixos-unstable
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/crypto++')
-rw-r--r--nixpkgs/pkgs/development/libraries/crypto++/default.nix38
1 files changed, 22 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/development/libraries/crypto++/default.nix b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
index 041e7d49d500..0402af92b3b3 100644
--- a/nixpkgs/pkgs/development/libraries/crypto++/default.nix
+++ b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
@@ -1,47 +1,53 @@
-{ lib, stdenv, fetchFromGitHub, nasm, which }:
+{ lib, stdenv, fetchFromGitHub, nasm, which
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !enableStatic
+}:
 
-with lib;
 stdenv.mkDerivation rec {
   pname = "crypto++";
-  version = "8.2.0";
-  underscoredVersion = strings.replaceStrings ["."] ["_"] version;
+  version = "8.4.0";
+  underscoredVersion = lib.strings.replaceStrings ["."] ["_"] version;
 
   src = fetchFromGitHub {
     owner = "weidai11";
     repo = "cryptopp";
     rev = "CRYPTOPP_${underscoredVersion}";
-    sha256 = "01zrrzjn14yhkb9fzzl57vmh7ig9a6n6fka45f8za0gf7jpcq3mj";
+    sha256 = "1gwn8yh1mh41hkh6sgnhb9c3ygrdazd7645msl20i0zdvcp7f5w3";
   };
 
+  outputs = [ "out" "dev" ];
+
   postPatch = ''
     substituteInPlace GNUmakefile \
         --replace "AR = libtool" "AR = ar" \
         --replace "ARFLAGS = -static -o" "ARFLAGS = -cru"
   '';
 
-  nativeBuildInputs = optionals stdenv.hostPlatform.isx86 [ nasm which ];
-
-  preBuild = optionalString stdenv.hostPlatform.isx86 "${stdenv.shell} rdrand-nasm.sh";
   makeFlags = [ "PREFIX=${placeholder "out"}" ];
-  buildFlags = [ "shared" "libcryptopp.pc" ];
+  buildFlags =
+       lib.optional enableStatic "static"
+    ++ lib.optional enableShared "shared"
+    ++ [ "libcryptopp.pc" ];
   enableParallelBuilding = true;
 
   doCheck = true;
 
-  preInstall = "rm libcryptopp.a"; # built for checks but we don't install static lib into the nix store
+  # built for checks but we don't install static lib into the nix store
+  preInstall = lib.optionalString (!enableStatic) "rm libcryptopp.a";
+
   installTargets = [ "install-lib" ];
   installFlags = [ "LDCONF=true" ];
-  postInstall = optionalString (!stdenv.hostPlatform.isDarwin) ''
-    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${versions.majorMinor version}
-    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${versions.major version}
+  postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
+    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.majorMinor version}
+    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.major version}
   '';
 
   meta = {
     description = "Crypto++, a free C++ class library of cryptographic schemes";
     homepage = "https://cryptopp.com/";
     changelog = "https://raw.githubusercontent.com/weidai11/cryptopp/CRYPTOPP_${underscoredVersion}/History.txt";
-    license = with licenses; [ boost publicDomain ];
-    platforms = platforms.all;
-    maintainers = with maintainers; [ c0bw3b ];
+    license = with lib.licenses; [ boost publicDomain ];
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ c0bw3b ];
   };
 }