2021-04-22 02:08:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, perl
|
|
|
|
, buildGoModule
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# reference: https://boringssl.googlesource.com/boringssl/+/2661/BUILDING.md
|
2021-04-22 02:08:21 +00:00
|
|
|
buildGoModule {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "boringssl";
|
2021-04-22 02:08:21 +00:00
|
|
|
version = "2021-04-18";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://boringssl.googlesource.com/boringssl";
|
2021-04-22 02:08:21 +00:00
|
|
|
rev = "468cde90ca58421d63f4dfeaebcf8bb3fccb4127";
|
|
|
|
sha256 = "0gaqcbvp6r5fq265mckmg0i0rjab0bhxkxcvfxp3ar5dm7q88w39";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja perl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
|
|
|
|
|
|
|
|
# hack to get both go and cmake configure phase
|
|
|
|
# (if we use postConfigure then cmake will loop runHook postConfigure)
|
|
|
|
preBuild = ''
|
|
|
|
cmakeConfigurePhase
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
ninjaBuildPhase
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
# CMAKE_OSX_ARCHITECTURES is set to x86_64 by Nix, but it confuses boringssl on aarch64-linux.
|
2021-04-22 02:08:21 +00:00
|
|
|
cmakeFlags = [ "-GNinja" ] ++ lib.optionals (stdenv.isLinux) [ "-DCMAKE_OSX_ARCHITECTURES=" ];
|
2021-02-17 17:02:09 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
mkdir -p $bin/bin $out/include $out/lib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
mv tool/bssl $bin/bin
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mv ssl/libssl.a $out/lib
|
|
|
|
mv crypto/libcrypto.a $out/lib
|
|
|
|
mv decrepit/libdecrepit.a $out/lib
|
|
|
|
|
|
|
|
mv ../include/openssl $out/include
|
|
|
|
'';
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
outputs = [ "out" "bin" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Free TLS/SSL implementation";
|
|
|
|
homepage = "https://boringssl.googlesource.com";
|
|
|
|
maintainers = [ maintainers.thoughtpolice ];
|
|
|
|
license = with licenses; [ openssl isc mit bsd3 ];
|
|
|
|
};
|
|
|
|
}
|