Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glog: 0.4.0 -> 0.5.0, also enable tests #144561

Merged
merged 3 commits into from
Nov 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions pkgs/development/libraries/glog/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,46 @@

stdenv.mkDerivation rec {
pname = "glog";
version = "0.4.0";
version = "0.5.0";

src = fetchFromGitHub {
owner = "google";
repo = "glog";
rev = "v${version}";
sha256 = "1xd3maiipfbxmhc9rrblc5x52nxvkwxp14npg31y5njqvkvzax9b";
sha256 = "17014q25c99qyis6l3fwxidw6222bb269fdlr74gn7pzmzg4lvg3";
};

patches = lib.optionals stdenv.hostPlatform.isMusl [
# TODO: Remove at next release that includes this commit.
patches = [
# Fix duplicate-concatenated nix store path in cmake file, see:
# https://github.com/NixOS/nixpkgs/pull/144561#issuecomment-960296043
# TODO: Remove when https://github.com/google/glog/pull/733 is merged and available.
(fetchpatch {
name = "glog-Fix-symbolize_unittest-for-musl-builds.patch";
url = "https://github.com/google/glog/commit/834dd780bf1fe0704b8ed0350ca355a55f711a9f.patch";
sha256 = "0k4lanxg85anyvjsj3mh93bcgds8gizpiamcy2zvs3yyfjl40awn";
name = "glog-cmake-Fix-incorrect-relative-path-concatenation.patch";
url = "https://github.com/google/glog/pull/733/commits/57c636c02784f909e4b5d3c2f0ecbdbb47097266.patch";
sha256 = "1py93gkzmcyi2ypcwyj3nri210z8fmlaif51yflzmrrv507zd7bi";
})
];

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
'';

nativeBuildInputs = [ cmake ];

propagatedBuildInputs = [ gflags ];

cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
# Mak CMake place RPATHs such that tests will find the built libraries.
# See https://github.com/NixOS/nixpkgs/pull/144561#discussion_r742468811 and https://github.com/NixOS/nixpkgs/pull/108496
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
];

# 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;
checkInputs = [ perl ];
doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm"

meta = with lib; {
homepage = "https://github.com/google/glog";
license = licenses.bsd3;
description = "Library for application-level logging";
platforms = platforms.unix;
maintainers = with lib.maintainers; [ nh2 r-burns ];
};
}