From 65e91ebd9e1d8a5c054b98b87abef68d5d36ce6f Mon Sep 17 00:00:00 2001 From: SIYAO CHEN <1yue8haogaoqi@gmail.com> Date: Thu, 1 Jun 2023 09:56:41 +0800 Subject: [PATCH] feat: fix rpath setting in osx dynamic debug build (#31681) --- ports/icu/portfile.cmake | 85 +++++++++++++++++++++------------------- ports/icu/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/i-/icu.json | 5 +++ 4 files changed, 52 insertions(+), 42 deletions(-) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 87c757ef720..355eac58dcf 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -88,53 +88,58 @@ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") if("tools" IN_LIST FEATURES) set(LIBICUTU_RPATH "libicutu") endif() - # add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc - foreach(LIB_NAME IN ITEMS libicudata libicui18n libicuio ${LIBICUTU_RPATH} libicuuc) - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -id "${ID_PREFIX}/${LIB_NAME}.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - endforeach() - # add ID_PREFIX to libicui18n libicuio libicutu dependencies - foreach(LIB_NAME IN ITEMS libicui18n libicuio) - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -change "libicuuc.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) + #31680: Fix @rpath in both debug and release build + foreach(CONFIG_TRIPLE IN ITEMS ${DEBUG_TRIPLET} ${RELEASE_TRIPLET}) + # add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc + foreach(LIB_NAME IN ITEMS libicudata libicui18n libicuio ${LIBICUTU_RPATH} libicuuc) + vcpkg_execute_build_process( + COMMAND "${INSTALL_NAME_TOOL}" -id "${ID_PREFIX}/${LIB_NAME}.${ICU_VERSION_MAJOR}.dylib" + "${LIB_NAME}.${VERSION}.dylib" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib" + LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}" + ) + endforeach() + + # add ID_PREFIX to libicui18n libicuio libicutu dependencies + foreach(LIB_NAME IN ITEMS libicui18n libicuio) + vcpkg_execute_build_process( + COMMAND "${INSTALL_NAME_TOOL}" -change "libicuuc.${ICU_VERSION_MAJOR}.dylib" + "${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib" + "${LIB_NAME}.${VERSION}.dylib" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib" + LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}" + ) + vcpkg_execute_build_process( + COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib" + "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" + "${LIB_NAME}.${VERSION}.dylib" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib" + LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}" + ) + endforeach() + + # add ID_PREFIX to remaining libicuio libicutu dependencies + foreach(LIB_NAME libicuio libicutu) + vcpkg_execute_build_process( + COMMAND "${INSTALL_NAME_TOOL}" -change "libicui18n.${ICU_VERSION_MAJOR}.dylib" + "${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib" + "${LIB_NAME}.${VERSION}.dylib" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib" + LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}" + ) + endforeach() + + # add ID_PREFIX to libicuuc dependencies vcpkg_execute_build_process( COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib" "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" + "libicuuc.${VERSION}.dylib" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib" + LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}" ) endforeach() - # add ID_PREFIX to remaining libicuio libicutu dependencies - foreach(LIB_NAME libicuio libicutu) - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -change "libicui18n.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - endforeach() - - # add ID_PREFIX to libicuuc dependencies - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "libicuuc.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) endif() vcpkg_install_make() diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json index 8e3696afb46..21ed9065f93 100644 --- a/ports/icu/vcpkg.json +++ b/ports/icu/vcpkg.json @@ -1,7 +1,7 @@ { "name": "icu", "version": "72.1", - "port-version": 4, + "port-version": 5, "description": "Mature and widely used Unicode and localization library.", "homepage": "https://icu.unicode.org/home", "license": "ICU", diff --git a/versions/baseline.json b/versions/baseline.json index 358a3105b4d..a4fbec32427 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3190,7 +3190,7 @@ }, "icu": { "baseline": "72.1", - "port-version": 4 + "port-version": 5 }, "ideviceinstaller": { "baseline": "1.1.2.23", diff --git a/versions/i-/icu.json b/versions/i-/icu.json index fbd2ecbdcb1..4e944556b86 100644 --- a/versions/i-/icu.json +++ b/versions/i-/icu.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c1735b83e7793135a9d1e3689f7d36475f6d5ff7", + "version": "72.1", + "port-version": 5 + }, { "git-tree": "1a0b575f86d37844108f940fd5f6a312a68d234c", "version": "72.1",