pkgsStatic.protobuf: fix installation of protoc

+20
+2
pkgs/development/libraries/protobuf/generic-v3-cmake.nix
··· 53 53 url = "https://github.com/protocolbuffers/protobuf/commit/a7324f88e92bc16b57f3683403b6c993bf68070b.patch"; 54 54 sha256 = "sha256-SmwaUjOjjZulg/wgNmR/F5b8rhYA2wkKAjHIOxjcQdQ="; 55 55 }) 56 + ] ++ lib.optionals stdenv.hostPlatform.isStatic [ 57 + ./static-executables-have-no-rpath.patch 56 58 ]; 57 59 58 60 nativeBuildInputs = let
+18
pkgs/development/libraries/protobuf/static-executables-have-no-rpath.patch
··· 1 + diff --git a/cmake/install.cmake b/cmake/install.cmake 2 + index 26a55be8b..b6823c3f9 100644 3 + --- a/cmake/install.cmake 4 + +++ b/cmake/install.cmake 5 + @@ -32,13 +32,6 @@ if (protobuf_BUILD_PROTOC_BINARIES) 6 + install(TARGETS protoc EXPORT protobuf-targets 7 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc 8 + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) 9 + - if (UNIX AND NOT APPLE) 10 + - set_property(TARGET protoc 11 + - PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") 12 + - elseif (APPLE) 13 + - set_property(TARGET protoc 14 + - PROPERTY INSTALL_RPATH "@loader_path/../lib") 15 + - endif() 16 + endif (protobuf_BUILD_PROTOC_BINARIES) 17 + 18 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")