2020-01-14 17:56:19 +03:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, gflags, perl }:
|
2014-01-24 18:51:04 +04:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "glog";
|
2019-04-01 17:00:12 +03:00
|
|
|
version = "0.4.0";
|
2017-10-27 02:44:19 +03:00
|
|
|
|
2015-04-22 01:33:39 +03:00
|
|
|
src = fetchFromGitHub {
|
2017-11-12 16:37:36 +03:00
|
|
|
owner = "google";
|
2015-04-22 01:33:39 +03:00
|
|
|
repo = "glog";
|
|
|
|
rev = "v${version}";
|
2019-04-01 17:00:12 +03:00
|
|
|
sha256 = "1xd3maiipfbxmhc9rrblc5x52nxvkwxp14npg31y5njqvkvzax9b";
|
2014-01-24 18:51:04 +04:00
|
|
|
};
|
|
|
|
|
2019-12-15 06:02:41 +03: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-13 00:53:27 +03: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 15:04:53 +03:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2020-01-13 00:53:27 +03:00
|
|
|
propagatedBuildInputs = [ gflags ];
|
|
|
|
|
2020-01-14 17:56:19 +03:00
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
|
2015-04-22 01:33:39 +03:00
|
|
|
|
2018-08-08 21:31:20 +03:00
|
|
|
checkInputs = [ perl ];
|
|
|
|
doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm"
|
|
|
|
|
2021-01-21 20:00:13 +03:00
|
|
|
meta = with lib; {
|
2019-12-16 15:04:53 +03:00
|
|
|
homepage = "https://github.com/google/glog";
|
2015-04-22 01:33:39 +03:00
|
|
|
license = licenses.bsd3;
|
2014-08-24 18:21:08 +04:00
|
|
|
description = "Library for application-level logging";
|
2015-04-22 01:33:39 +03:00
|
|
|
platforms = platforms.unix;
|
2014-01-24 18:51:04 +04:00
|
|
|
};
|
|
|
|
}
|