aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lalumiere <kevin.lalumiere@gmail.com>2020-11-16 13:26:18 -0500
committerGitHub <noreply@github.com>2020-11-16 10:26:18 -0800
commit3be0fec092cb4f0db935ae03680921b3dc859ed9 (patch)
treeb0b58a8330f8b1a3827fdeac230c7ef0aac45d54
parent838574a4e6dfb26c956a043f50ed27b04d7e4e31 (diff)
downloadvcpkg-3be0fec092cb4f0db935ae03680921b3dc859ed9.tar.gz
vcpkg-3be0fec092cb4f0db935ae03680921b3dc859ed9.zip
[aws-sdk-cpp] Make aws-sdk-cpp rpath relocatable (#14546)
* Make aws-sdk-cpp rpath relocatable (fix #14544) This is important since vcpkg offers binary caching which could be shared between different machines (as long as both machines use the same "toolchains" [more technically, as long as the vcpkg hash is the same]) * Allow cross-compilation * Update port version Co-authored-by: Kevin Lalumiere <klalumiere@coveo.com>
-rw-r--r--ports/aws-sdk-cpp/CONTROL2
-rw-r--r--ports/aws-sdk-cpp/patch-relocatable-rpath.patch12
-rw-r--r--ports/aws-sdk-cpp/portfile.cmake7
3 files changed, 20 insertions, 1 deletions
diff --git a/ports/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL
index 32a2323e8..ca92ed958 100644
--- a/ports/aws-sdk-cpp/CONTROL
+++ b/ports/aws-sdk-cpp/CONTROL
@@ -1,6 +1,6 @@
Source: aws-sdk-cpp
Version: 1.8.83
-Port-Version: 0
+Port-Version: 1
Homepage: https://github.com/aws/aws-sdk-cpp
Description: AWS SDK for C++
Build-Depends: openssl (!uwp&!windows), curl (!uwp&!windows), aws-c-event-stream
diff --git a/ports/aws-sdk-cpp/patch-relocatable-rpath.patch b/ports/aws-sdk-cpp/patch-relocatable-rpath.patch
new file mode 100644
index 000000000..9c5a5a2c5
--- /dev/null
+++ b/ports/aws-sdk-cpp/patch-relocatable-rpath.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a653e38628..76d6067646 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -142,7 +142,6 @@ else()
+ endif()
+
+ # Add Linker search paths to RPATH so as to fix the problem where some linkers can't find cross-compiled dependent libraries in customer paths when linking executables.
+-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
+
+ # build third-party targets
+ if (BUILD_DEPS)
diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake
index 02e81684e..21aac718a 100644
--- a/ports/aws-sdk-cpp/portfile.cmake
+++ b/ports/aws-sdk-cpp/portfile.cmake
@@ -6,6 +6,7 @@ vcpkg_from_github(
REF e98e5732ec7319051f162f7314ae361c85d0a8c9 # 1.8.83
SHA512 da540db60551be833ea0315dd93241f9740ab953ed5657c1c7a8c401ae52a4e75b116758420b0a8a4ebb79358dff8377f5e052b180b36f0af27a36003f28bd56
HEAD_REF master
+ PATCHES patch-relocatable-rpath.patch
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" FORCE_SHARED_CRT)
@@ -16,6 +17,11 @@ include(${CMAKE_CURRENT_LIST_DIR}/compute_build_only.cmake)
string(REPLACE ";" "\\\\\\\\\\;" BUILD_ONLY "${BUILD_ONLY}")
+if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS)
+ set(rpath "@loader_path")
+else()
+ set(rpath "\$ORIGIN")
+endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
DISABLE_PARALLEL_CONFIGURE
@@ -27,6 +33,7 @@ vcpkg_configure_cmake(
-DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE
-DBUILD_ONLY=${BUILD_ONLY}
-DBUILD_DEPS=OFF
+ -DCMAKE_INSTALL_RPATH=${rpath}
)
vcpkg_install_cmake()