nixpkgs/pkgs/by-name/bo/boringssl/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

88 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchgit,
cmake,
ninja,
perl,
buildGoModule,
}:
# reference: https://boringssl.googlesource.com/boringssl/+/2661/BUILDING.md
buildGoModule {
pname = "boringssl";
version = "unstable-2024-09-20";
src = fetchgit {
url = "https://boringssl.googlesource.com/boringssl";
rev = "718900aeb84c601523e71abbd18fd70c9e2ad884";
hash = "sha256-TdSObRECiGRQcgz6N2LhKvSi9yRYOZYJdK6MyfJX2Bo=";
};
nativeBuildInputs = [
cmake
ninja
perl
];
vendorHash = "sha256-GlhLsPD+yp2LdqsIsfXNEaNKKlc76p0kBCyu4rlEmMg=";
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)
"-Wno-error=stringop-overflow"
]
);
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 = ''
mkdir -p $bin/bin $dev $out/lib
mv tool/bssl $bin/bin
mv ssl/libssl.a $out/lib
mv crypto/libcrypto.a $out/lib
mv decrepit/libdecrepit.a $out/lib
mv ../include $dev
'';
outputs = [
"out"
"bin"
"dev"
];
meta = with lib; {
description = "Free TLS/SSL implementation";
mainProgram = "bssl";
homepage = "https://boringssl.googlesource.com";
maintainers = [ maintainers.thoughtpolice ];
license = with licenses; [
openssl
isc
mit
bsd3
];
};
}