File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,18 @@ pkgs.stdenv.mkDerivation {
5656 mkdir -p $out/bin
5757 cp build/tests/lgx_tests $out/bin/
5858 cp build/tests/lgx_lib_tests $out/bin/
59+
60+ # Fix rpath for lgx_lib_tests to find liblgx.so at $out/lib
61+ # Keep Nix store entries (libstdc++, etc.) but replace /build/ paths
62+ if [ -f $out/bin/lgx_lib_tests ]; then
63+ if [[ "$(uname)" == "Darwin" ]]; then
64+ install_name_tool -add_rpath $out/lib $out/bin/lgx_lib_tests
65+ else
66+ old_rpath=$(patchelf --print-rpath $out/bin/lgx_lib_tests)
67+ new_rpath=$(echo "$old_rpath" | tr ':' '\n' | grep -v '/build/' | tr '\n' ':' | sed 's/:$//')
68+ patchelf --set-rpath "$out/lib:$new_rpath" $out/bin/lgx_lib_tests
69+ fi
70+ fi
5971
6072 # Fix rpath for lgx_lib_tests to find the shared library
6173 if [ -f $out/bin/lgx_lib_tests ]; then
Original file line number Diff line number Diff line change 1717 pkgs . zlib
1818 pkgs . icu
1919 pkgs . nlohmann_json
20- pkgs . gtest
20+ # GTest built static so test binaries don't depend on libgtest at runtime
21+ ( pkgs . gtest . overrideAttrs ( old : {
22+ cmakeFlags = ( old . cmakeFlags or [ ] ) ++ [ "-DBUILD_SHARED_LIBS=OFF" ] ;
23+ } ) )
2124 ] ;
2225
2326 # Common CMake flags
You can’t perform that action at this time.
0 commit comments