From c95158747779baf6c2cfcb596de37c63fe20f8dc Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Mon, 20 Oct 2025 15:17:50 +0200 Subject: [PATCH] boringssl: refactor build Co-Authored-By: Theo Paris --- pkgs/by-name/bo/boringssl/package.nix | 38 +-------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/pkgs/by-name/bo/boringssl/package.nix b/pkgs/by-name/bo/boringssl/package.nix index ec0d2186b3c4..71f09d807713 100644 --- a/pkgs/by-name/bo/boringssl/package.nix +++ b/pkgs/by-name/bo/boringssl/package.nix @@ -5,12 +5,11 @@ cmake, ninja, perl, - buildGoModule, gitUpdater, }: # reference: https://boringssl.googlesource.com/boringssl/+/refs/tags/0.20250818.0/BUILDING.md -buildGoModule (finalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = "boringssl"; version = "0.20251002.0"; @@ -31,18 +30,6 @@ buildGoModule (finalAttrs: { perl ]; - vendorHash = "sha256-IXmnoCYLoiQ/XL2wjksRFv5Kwsje0VNkcupgGxG6rSY="; - proxyVendor = true; - - # hack to get both go and cmake configure phase - # (if we use postConfigure then cmake will loop runHook postConfigure) - preBuild = '' - cmakeConfigurePhase - '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - export GOARCH=$(go env GOHOSTARCH) - ''; - env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.cc.isGNU [ # Needed with GCC 12 but breaks on darwin (with clang) @@ -53,29 +40,6 @@ buildGoModule (finalAttrs: { ] ); - buildPhase = '' - ninjaBuildPhase - ''; - - # CMAKE_OSX_ARCHITECTURES is set to x86_64 by Nix, but it confuses boringssl on aarch64-linux. - cmakeFlags = [ - "-GNinja" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ "-DCMAKE_OSX_ARCHITECTURES=" ]; - - installPhase = '' - runHook preInstall - - mkdir -p $bin/bin $dev $out/lib - - install -Dm755 bssl -t $bin/bin - install -Dm644 {libcrypto,libdecrepit,libpki,libssl}.a -t $out/lib - - cp -r ../include $dev - - runHook postInstall - ''; - outputs = [ "out" "bin"