From bdc92788abb950da7cf47ae85ca2e1c7054dea31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Wed, 3 Nov 2021 23:17:31 +0000 Subject: [PATCH 1/3] glog: Add nh2 and r-burns as maintainers --- pkgs/development/libraries/glog/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/glog/default.nix b/pkgs/development/libraries/glog/default.nix index 4bb20ebfd93e4..a7e92854ca9de 100644 --- a/pkgs/development/libraries/glog/default.nix +++ b/pkgs/development/libraries/glog/default.nix @@ -40,5 +40,6 @@ stdenv.mkDerivation rec { license = licenses.bsd3; description = "Library for application-level logging"; platforms = platforms.unix; + maintainers = with lib.maintainers; [ nh2 r-burns ]; }; } From 197b5f2ec37c50b213b4729f0bc993d85974e934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Wed, 3 Nov 2021 22:56:12 +0000 Subject: [PATCH 2/3] glog: 0.4.0 -> 0.5.0, also enable tests --- pkgs/development/libraries/glog/default.nix | 34 ++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/development/libraries/glog/default.nix b/pkgs/development/libraries/glog/default.nix index a7e92854ca9de..f632ac45c139f 100644 --- a/pkgs/development/libraries/glog/default.nix +++ b/pkgs/development/libraries/glog/default.nix @@ -2,38 +2,44 @@ 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" ]; + # 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" + + # Add `build/` directory (`$PWD`) to LD_LIBRARY_PATH so that the built library + # can be loaded for the tests. + # Adding to LD_LIBRARY_PATH correctly is nontrivial: + # https://jdhao.github.io/2021/07/03/ld_library_path_empty_item/ + # https://unix.stackexchange.com/questions/162891/append-to-path-like-variable-without-creating-leading-colon-if-unset + preCheck = '' + export LD_LIBRARY_PATH=''${LD_LIBRARY_PATH:+''${LD_LIBRARY_PATH}:}''$PWD + ''; meta = with lib; { homepage = "https://github.com/google/glog"; From 8b9d12e3fa2bc75d57d9275ca83ad192794b7d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Thu, 4 Nov 2021 01:38:03 +0000 Subject: [PATCH 3/3] glog: Simpler approach to fix tests. See: * https://github.com/NixOS/nixpkgs/pull/144561#discussion_r742468811 * https://github.com/NixOS/nixpkgs/pull/108496 --- pkgs/development/libraries/glog/default.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/glog/default.nix b/pkgs/development/libraries/glog/default.nix index f632ac45c139f..38cd40377a5c3 100644 --- a/pkgs/development/libraries/glog/default.nix +++ b/pkgs/development/libraries/glog/default.nix @@ -26,21 +26,17 @@ stdenv.mkDerivation rec { 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 ]; - # Add `build/` directory (`$PWD`) to LD_LIBRARY_PATH so that the built library - # can be loaded for the tests. - # Adding to LD_LIBRARY_PATH correctly is nontrivial: - # https://jdhao.github.io/2021/07/03/ld_library_path_empty_item/ - # https://unix.stackexchange.com/questions/162891/append-to-path-like-variable-without-creating-leading-colon-if-unset - preCheck = '' - export LD_LIBRARY_PATH=''${LD_LIBRARY_PATH:+''${LD_LIBRARY_PATH}:}''$PWD - ''; - meta = with lib; { homepage = "https://github.com/google/glog"; license = licenses.bsd3;