2020-01-14 14:56:19 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, gflags, perl }:
|
2014-01-24 14:51:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "glog";
|
2019-04-01 15:00:12 +01:00
|
|
|
version = "0.4.0";
|
2017-10-27 00:44:19 +01:00
|
|
|
|
2015-04-21 23:33:39 +01:00
|
|
|
src = fetchFromGitHub {
|
2017-11-12 13:37:36 +00:00
|
|
|
owner = "google";
|
2015-04-21 23:33:39 +01:00
|
|
|
repo = "glog";
|
|
|
|
rev = "v${version}";
|
2019-04-01 15:00:12 +01:00
|
|
|
sha256 = "1xd3maiipfbxmhc9rrblc5x52nxvkwxp14npg31y5njqvkvzax9b";
|
2014-01-24 14:51:04 +00:00
|
|
|
};
|
|
|
|
|
2019-12-15 03:02:41 +00:00
|
|
|
patches = lib.optionals stdenv.hostPlatform.isMusl [
|
|
|
|
# TODO: Remove at next release that includes this commit.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "glog-Fix-symbolize_unittest-for-musl-builds.patch";
|
|
|
|
url = "https://github.com/google/glog/commit/834dd780bf1fe0704b8ed0350ca355a55f711a9f.patch";
|
|
|
|
sha256 = "0k4lanxg85anyvjsj3mh93bcgds8gizpiamcy2zvs3yyfjl40awn";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-01-12 21:53:27 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
# A path clash on case-insensitive file systems blocks creation of the build directory.
|
|
|
|
# The file in question is specific to bazel and does not influence the build result.
|
|
|
|
rm BUILD
|
|
|
|
'';
|
|
|
|
|
2019-12-16 12:04:53 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2020-01-12 21:53:27 +00:00
|
|
|
propagatedBuildInputs = [ gflags ];
|
|
|
|
|
2020-01-14 14:56:19 +00:00
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
|
2015-04-21 23:33:39 +01:00
|
|
|
|
2018-08-08 19:31:20 +01:00
|
|
|
checkInputs = [ perl ];
|
|
|
|
doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm"
|
|
|
|
|
2015-04-21 23:33:39 +01:00
|
|
|
meta = with stdenv.lib; {
|
2019-12-16 12:04:53 +00:00
|
|
|
homepage = "https://github.com/google/glog";
|
2015-04-21 23:33:39 +01:00
|
|
|
license = licenses.bsd3;
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "Library for application-level logging";
|
2015-04-21 23:33:39 +01:00
|
|
|
platforms = platforms.unix;
|
2014-01-24 14:51:04 +00:00
|
|
|
};
|
|
|
|
}
|