Skip to content

Commit 11530df

Browse files
committed
Build Nettle shim through Nix
1 parent 642d697 commit 11530df

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

flake.nix

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
gcryptShim = import ./nix/gcryptshim.nix { inherit pkgs libgcrypt libgpg-error; };
125125
mbedtlsShim = import ./nix/mbedtlsshim.nix { pkgs = pkgs; };
126126
ippcpShim = import ./nix/ippcpshim.nix { pkgs = pkgs; ipp-crypto = customPkgs.ipp-crypto; };
127+
nettleShim = import ./nix/nettleshim.nix { inherit pkgs nettle; };
127128
libresslShim = import ./nix/libresslshim.nix { inherit pkgs libressl; };
128129

129130
overlays = [];
@@ -158,6 +159,7 @@
158159
cp ${gcryptShim.out}/lib/gcrypt_provider.so ${jniLibsPath}
159160
cp ${mbedtlsShim.out}/lib/mbedtls_provider.so ${jniLibsPath}
160161
cp ${ippcpShim.out}/lib/ippcp_provider.so ${jniLibsPath}
162+
cp ${nettleShim.out}/lib/nettle_provider.so ${jniLibsPath}
161163
cp ${libresslShim.out}/lib/libressl_provider.so ${jniLibsPath}
162164
cp ${wolfcryptjni}/lib/* ${jniLibsPath}
163165
cp ${commonLibs}/lib/* ${jniLibsPath}

nix/nettleshim.nix

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
pkgs
3+
, nettle
4+
}:
5+
with pkgs; stdenv.mkDerivation rec {
6+
name = "NettleShim";
7+
src = ../standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni;
8+
9+
buildInputs = [
10+
nettle
11+
pkg-config
12+
jdk11_headless
13+
];
14+
15+
buildPhase = ''
16+
make nettle
17+
'';
18+
19+
installPhase = ''
20+
mkdir --parents $out/lib
21+
cp nettle_provider.so $out/lib
22+
'';
23+
}

0 commit comments

Comments
 (0)