From c625e03c43a3089c42ec34ba272f25dff0733611 Mon Sep 17 00:00:00 2001 From: quapka Date: Thu, 25 Jul 2024 14:42:53 +0200 Subject: Build Crypto++ shim through Nix --- flake.nix | 2 ++ nix/cryptoppshim.nix | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 nix/cryptoppshim.nix diff --git a/flake.nix b/flake.nix index c841ce4..44fe3f6 100644 --- a/flake.nix +++ b/flake.nix @@ -120,6 +120,7 @@ # Current list of targets: tomcrypt botan cryptopp openssl boringssl gcrypt mbedtls ippcp nettle libressl tomcryptShim = import ./nix/tomcryptshim.nix { inherit pkgs libtomcrypt libtommath; }; botanShim = import ./nix/botanshim.nix { inherit pkgs; }; + cryptoppShim = import ./nix/cryptoppshim.nix { inherit pkgs cryptopp; }; mbedtlsShim = import ./nix/mbedtlsshim.nix { pkgs = pkgs; }; ippcryptoShim = import ./nix/ippcryptoshim.nix { pkgs = pkgs; ipp-crypto = customPkgs.ipp-crypto; }; @@ -158,6 +159,7 @@ popd cp ${tomcryptShim.out}/lib/tomcrypt_provider.so ${jniLibsPath} cp ${botanShim.out}/lib/botan_provider.so ${jniLibsPath} + cp ${cryptoppShim.out}/lib/cryptopp_provider.so ${jniLibsPath} cp ${commonLibs}/lib/* ${jniLibsPath} ''; diff --git a/nix/cryptoppshim.nix b/nix/cryptoppshim.nix new file mode 100644 index 0000000..1c3532c --- /dev/null +++ b/nix/cryptoppshim.nix @@ -0,0 +1,23 @@ +{ + pkgs + , cryptopp +}: +with pkgs; stdenv.mkDerivation { + name = "Crypto++ Shim"; + src = ../standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni; + + buildInputs = [ + cryptopp + pkg-config + jdk11_headless + ]; + + buildPhase = '' + make cryptopp + ''; + + installPhase = '' + mkdir --parents $out/lib + cp cryptopp_provider.so $out/lib/ + ''; +} -- cgit v1.3.1