@@ -26,21 +26,17 @@ stdenv.mkDerivation rec {
2626
2727 propagatedBuildInputs = [ gflags ];
2828
29− cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
29+ cmakeFlags = [
30+ "-DBUILD_SHARED_LIBS=ON"
31+ # Mak CMake place RPATHs such that tests will find the built libraries.
32+ # See https://github.com/NixOS/nixpkgs/pull/144561#discussion_r742468811 and https://github.com/NixOS/nixpkgs/pull/108496
33+ "-DCMAKE_SKIP_BUILD_RPATH=OFF"
34+ ];
3035
3136 # TODO: Re-enable Darwin tests once we're on a release that has https://github.com/google/glog/issues/709#issuecomment-960381653 fixed
3237 doCheck = !stdenv.isDarwin;
3338 checkInputs = [ perl ];
3439
35− # Add `build/` directory (`$PWD`) to LD_LIBRARY_PATH so that the built library
36− # can be loaded for the tests.
37− # Adding to LD_LIBRARY_PATH correctly is nontrivial:
38− # https://jdhao.github.io/2021/07/03/ld_library_path_empty_item/
39− # https://unix.stackexchange.com/questions/162891/append-to-path-like-variable-without-creating-leading-colon-if-unset
40− preCheck = ''
41− export LD_LIBRARY_PATH=''${LD_LIBRARY_PATH:+''${LD_LIBRARY_PATH}:}''$PWD
42− '';
43−
4440 meta = with lib; {
4541 homepage = "https://github.com/google/glog";
4642 license = licenses.bsd3;