depot/third_party/nixpkgs/pkgs/development/libraries/glog/default.nix
Default email 7bc014aa9c Project import generated by Copybara.
GitOrigin-RevId: c97e777ff06fcb8d37dcdf5e21e9eff1f34f0e90
2022-09-11 12:47:08 -03:00

48 lines
1.4 KiB
Nix

{ stdenv, lib, fetchFromGitHub, cmake, gflags, gtest, perl }:
stdenv.mkDerivation rec {
pname = "glog";
version = "0.6.0";
src = fetchFromGitHub {
owner = "google";
repo = "glog";
rev = "v${version}";
sha256 = "sha256-xqRp9vaauBkKz2CXbh/Z4TWqhaUtqfbsSlbYZR/kW9s=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ gtest ];
propagatedBuildInputs = [ gflags ];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
];
# TODO: Re-enable Darwin tests once we're on a release that has https://github.com/google/glog/issues/709#issuecomment-960381653 fixed
doCheck = !stdenv.isDarwin;
# There are some non-thread safe tests that can fail
enableParallelChecking = false;
checkInputs = [ perl ];
GTEST_FILTER =
let
filteredTests = lib.optionals stdenv.hostPlatform.isMusl [
"Symbolize.SymbolizeStackConsumption"
"Symbolize.SymbolizeWithDemanglingStackConsumption"
] ++ lib.optionals stdenv.hostPlatform.isStatic [
"LogBacktraceAt.DoesBacktraceAtRightLineWhenEnabled"
];
in
lib.optionalString doCheck "-${builtins.concatStringsSep ":" filteredTests}";
meta = with lib; {
homepage = "https://github.com/google/glog";
license = licenses.bsd3;
description = "Library for application-level logging";
platforms = platforms.unix;
maintainers = with maintainers; [ nh2 r-burns ];
};
}