refactor(3p/nix): Inline LLVM overrides on dependencies
Change-Id: I5963ef4b83f1df25273a869f0e85144d347e444b Reviewed-on: https://cl.tvl.fyi/c/depot/+/5251 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
a81b1dc6ef
commit
aa96c3bd83
1 changed files with 35 additions and 4 deletions
39
third_party/nix/default.nix
vendored
39
third_party/nix/default.nix
vendored
|
@ -6,6 +6,36 @@ args@{ depot ? (import ../.. { })
|
|||
}:
|
||||
|
||||
let
|
||||
# Override some external dependencies for C++17 & clang compat.
|
||||
abseil-cpp = pkgs.abseil-cpp.override {
|
||||
stdenv = pkgs.fullLlvm11Stdenv;
|
||||
cxxStandard = "17";
|
||||
};
|
||||
|
||||
protobuf = pkgs.callPackage (pkgs.path + "/pkgs/development/libraries/protobuf/generic-v3.nix") {
|
||||
version = "3.12.2";
|
||||
sha256 = "1lp368aa206vpic9fmax4k6llnmf28plfvkkm4vqhgphmjqykvl2";
|
||||
stdenv = pkgs.fullLlvm11Stdenv;
|
||||
buildPackages = {
|
||||
inherit (pkgs.buildPackages) which;
|
||||
stdenv = pkgs.buildPackages.fullLlvm11Stdenv;
|
||||
};
|
||||
};
|
||||
|
||||
re2 = pkgs.re2.override {
|
||||
stdenv = pkgs.fullLlvm11Stdenv;
|
||||
};
|
||||
|
||||
grpc = (pkgs.grpc.override {
|
||||
inherit abseil-cpp protobuf re2;
|
||||
stdenv = pkgs.fullLlvm11Stdenv;
|
||||
}).overrideAttrs (orig: rec {
|
||||
cmakeFlags = orig.cmakeFlags ++ [
|
||||
"-DCMAKE_CXX_STANDARD_REQUIRED=ON"
|
||||
"-DCMAKE_CXX_STANDARD=17"
|
||||
];
|
||||
});
|
||||
|
||||
aws-s3-cpp = pkgs.aws-sdk-cpp.override {
|
||||
apis = [ "s3" "transfer" ];
|
||||
customMemoryManagement = false;
|
||||
|
@ -46,9 +76,9 @@ let
|
|||
protoSrcs = pkgs.runCommand "nix-proto-srcs" { } ''
|
||||
export PROTO_SRCS=${./src/proto}
|
||||
mkdir -p $out/libproto
|
||||
${depot.third_party.protobuf}/bin/protoc -I=$PROTO_SRCS \
|
||||
${protobuf}/bin/protoc -I=$PROTO_SRCS \
|
||||
--cpp_out=$out/libproto \
|
||||
--plugin=protoc-gen-grpc=${depot.third_party.grpc}/bin/grpc_cpp_plugin \
|
||||
--plugin=protoc-gen-grpc=${grpc}/bin/grpc_cpp_plugin \
|
||||
--grpc_out=$out/libproto \
|
||||
$PROTO_SRCS/*.proto
|
||||
'';
|
||||
|
@ -92,8 +122,9 @@ lib.fix (self: pkgs.fullLlvm11Stdenv.mkDerivation {
|
|||
sqlite
|
||||
systemd.dev
|
||||
xz
|
||||
]) ++ (with depot.third_party; [
|
||||
abseil_cpp
|
||||
|
||||
# dependencies with custom overrides
|
||||
abseil-cpp
|
||||
grpc
|
||||
protobuf
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue