Merge pull request #185779 from tobim/pkgs/crc32c-avoid-gtest-conflict

This commit is contained in:
Martin Weinelt 2022-08-11 11:57:18 +02:00 committed by GitHub
commit cd6f36c63d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,7 @@ stdenv.mkDerivation rec {
"-DCRC32C_BUILD_TESTS=1"
"-DCRC32C_BUILD_BENCHMARKS=0"
"-DCRC32C_USE_GLOG=0"
"-DINSTALL_GTEST=0"
"-DBUILD_SHARED_LIBS=${if staticOnly then "0" else "1"}"
];
@ -42,20 +43,7 @@ stdenv.mkDerivation rec {
runHook postInstallCheck
'';
postInstallCheck = ''
# without removing these libraries, dependents will look for
# libgtest/libgmock etc here, which can result in link time errors
rm $out/lib/libg*
'';
postFixup = ''
# dependents shouldn't be able to find gtest libraries as dependencies of
# this package
rm -r $out/lib/pkgconfig
# remove GTest cmake config files
rm -r $out/lib/cmake/GTest
# fix bogus include paths
for f in $(find $out/lib/cmake -name '*.cmake'); do
substituteInPlace "$f" --replace "\''${_IMPORT_PREFIX}/$out/include" "\''${_IMPORT_PREFIX}/include"