summary refs log tree commit diff
path: root/pkgs/development/libraries/protobuf
diff options
context:
space:
mode:
authorTobias Mayer <tobim@fastmail.fm>2022-10-03 08:28:17 +0200
committerTobias Mayer <tobim@fastmail.fm>2022-10-03 08:28:17 +0200
commit41963339b973da3e3782e227aee22e3537f21909 (patch)
treeac78642f127d21d072c8aeb03100507688d259d6 /pkgs/development/libraries/protobuf
parent978895272f8366f1a8545b26365ec0039b42ab5d (diff)
downloadnixpkgs-41963339b973da3e3782e227aee22e3537f21909.tar
nixpkgs-41963339b973da3e3782e227aee22e3537f21909.tar.gz
nixpkgs-41963339b973da3e3782e227aee22e3537f21909.tar.bz2
nixpkgs-41963339b973da3e3782e227aee22e3537f21909.tar.lz
nixpkgs-41963339b973da3e3782e227aee22e3537f21909.tar.xz
nixpkgs-41963339b973da3e3782e227aee22e3537f21909.tar.zst
nixpkgs-41963339b973da3e3782e227aee22e3537f21909.zip
pkgsStatic.protobuf: fix installation of protoc
Diffstat (limited to 'pkgs/development/libraries/protobuf')
-rw-r--r--pkgs/development/libraries/protobuf/generic-v3-cmake.nix2
-rw-r--r--pkgs/development/libraries/protobuf/static-executables-have-no-rpath.patch18
2 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/development/libraries/protobuf/generic-v3-cmake.nix b/pkgs/development/libraries/protobuf/generic-v3-cmake.nix
index 07e84a2ae06..207017b5edd 100644
--- a/pkgs/development/libraries/protobuf/generic-v3-cmake.nix
+++ b/pkgs/development/libraries/protobuf/generic-v3-cmake.nix
@@ -53,6 +53,8 @@ let
         url = "https://github.com/protocolbuffers/protobuf/commit/a7324f88e92bc16b57f3683403b6c993bf68070b.patch";
         sha256 = "sha256-SmwaUjOjjZulg/wgNmR/F5b8rhYA2wkKAjHIOxjcQdQ=";
       })
+    ] ++ lib.optionals stdenv.hostPlatform.isStatic [
+      ./static-executables-have-no-rpath.patch
     ];
 
     nativeBuildInputs = let
diff --git a/pkgs/development/libraries/protobuf/static-executables-have-no-rpath.patch b/pkgs/development/libraries/protobuf/static-executables-have-no-rpath.patch
new file mode 100644
index 00000000000..cd2474e1459
--- /dev/null
+++ b/pkgs/development/libraries/protobuf/static-executables-have-no-rpath.patch
@@ -0,0 +1,18 @@
+diff --git a/cmake/install.cmake b/cmake/install.cmake
+index 26a55be8b..b6823c3f9 100644
+--- a/cmake/install.cmake
++++ b/cmake/install.cmake
+@@ -32,13 +32,6 @@ if (protobuf_BUILD_PROTOC_BINARIES)
+   install(TARGETS protoc EXPORT protobuf-targets
+     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc
+     BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
+-  if (UNIX AND NOT APPLE)
+-    set_property(TARGET protoc
+-      PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
+-  elseif (APPLE)
+-    set_property(TARGET protoc
+-      PROPERTY INSTALL_RPATH "@loader_path/../lib")
+-  endif()
+ endif (protobuf_BUILD_PROTOC_BINARIES)
+ 
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")