Skip to content

Commit

Permalink
feat: fix rpath setting in osx dynamic debug build (#31681)
Browse files Browse the repository at this point in the history
  • Loading branch information
liviaerxin authored Jun 1, 2023
1 parent 0f1f520 commit 65e91eb
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 42 deletions.
85 changes: 45 additions & 40 deletions ports/icu/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion ports/icu/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3190,7 +3190,7 @@
},
"icu": {
"baseline": "72.1",
"port-version": 4
"port-version": 5
},
"ideviceinstaller": {
"baseline": "1.1.2.23",
Expand Down
5 changes: 5 additions & 0 deletions versions/i-/icu.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c1735b83e7793135a9d1e3689f7d36475f6d5ff7",
"version": "72.1",
"port-version": 5
},
{
"git-tree": "1a0b575f86d37844108f940fd5f6a312a68d234c",
"version": "72.1",
Expand Down

0 comments on commit 65e91eb

Please sign in to comment.