diff options
| author | quapka | 2024-07-22 13:23:21 +0200 |
|---|---|---|
| committer | quapka | 2024-07-22 13:23:21 +0200 |
| commit | 156fcc306b5661ffb0b25929da1004bbc01e740e (patch) | |
| tree | cdf7c060b898b8bbc9068c6ea1d55d582f5d2ab4 | |
| parent | 4fbc4542e007b6b8c3a49d6eb68a07985689477c (diff) | |
| download | ECTester-156fcc306b5661ffb0b25929da1004bbc01e740e.tar.gz ECTester-156fcc306b5661ffb0b25929da1004bbc01e740e.tar.zst ECTester-156fcc306b5661ffb0b25929da1004bbc01e740e.zip | |
Build shared libs for BoringSSL
| -rw-r--r-- | flake.nix | 44 |
1 files changed, 39 insertions, 5 deletions
@@ -14,23 +14,57 @@ outputs = { self, nixpkgs, flake-utils, gradle2nix, ... }: flake-utils.lib.eachDefaultSystem (system: let - libresslShim = with pkgs; stdenv.mkDerivation { - name = "LibreSSLShim"; + patched_boringssl = with pkgs; pkgs.boringssl.overrideAttrs (final: prev: rec { + src = fetchgit { + url = "https://boringssl.googlesource.com/boringssl"; + # rev = "d274b1bacdca36f3941bf78e43dc38acf676a1a8"; # master at the time of writing + # hash = "sha256-FtJFZorlGqPBfkPgFbEztNvYHweFaRVeuAM8xOMleMk="; + # NOTE + rev = "80a243e07ef77156af66efa7d22ac35aba44c1b3"; # ECTester submodule version at the time of writing + hash = "sha256-Sa1XjU7wi4umVQ6BUj9BxJMHYlXNg6xw9Cb/vBE+ScQ="; + }; + + # NOTE this build does not match upstream, but is what ECTester did at the time of writing + buildPhase = '' + cmake -GNinja -DBUILD_SHARED_LIBS=1 -Bbuild + pushd build + ninja crypto + popd + ''; + + installPhase = '' + mkdir --parents $bin/bin $dev $out/lib + mv include $dev + + pushd build + mv crypto/libcrypto.so $out/lib/lib_boringssl.so + popd + ''; + + }); + + boringsslShim = with pkgs; stdenv.mkDerivation { + name = "BoringSSLShim"; src = ./standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni; buildInputs = [ - libressl + patched_boringssl pkg-config jdk11_headless ]; buildPhase = '' - make libressl + make boringssl ''; + BORINGSSL_CFLAGS = "${patched_boringssl.dev.outPath}/include"; + # LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ + # patched_boringssl + # ]; + installPhase = '' mkdir --parents $out/lib - cp libressl_provider.so $out/lib + cp boringssl_provider.so $out/lib ''; }; # openssl_3013 = pkgs.openssl.overrideAttrs (_old: rec { |
