From a1e13e8d589cca3c89075561cd68aa34bc32b9a2 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 15 Dec 2023 02:37:17 +0100 Subject: [PATCH] [icu] Update, enable uwp, fix osx-dynamic (#35530) * [cppcms] No uwp * [libzim] No uwp * [cppcms] Fix dependencies and linkage * [libzim] Update to 9.0.0 * [cppcms] No python for build * Fixup * CI: uwp * [vcpkg-ci-boost] Enable boost-regex[icu] * [icu] Enable uwp * [icu] Update to 74.1 * [icu] Cleanup * v * [icu] Set install names during linking * Revert "CI: uwp" This reverts commit 127afe8aa1518b1148f57b071bdee2ff22838d24. * CI * [icu] Use --enable-rpath on osx --- ports/icu/darwin-rpath.patch | 14 +++ ports/icu/portfile.cmake | 123 ++++--------------- ports/icu/vcpkg.json | 7 +- scripts/test_ports/vcpkg-ci-boost/vcpkg.json | 3 +- versions/baseline.json | 4 +- versions/i-/icu.json | 5 + 6 files changed, 49 insertions(+), 107 deletions(-) create mode 100644 ports/icu/darwin-rpath.patch diff --git a/ports/icu/darwin-rpath.patch b/ports/icu/darwin-rpath.patch new file mode 100644 index 0000000000..3de84594fd --- /dev/null +++ b/ports/icu/darwin-rpath.patch @@ -0,0 +1,14 @@ +diff --git a/source/config/mh-darwin b/source/config/mh-darwin +index 7b15709..e2cdbdb 100644 +--- a/source/config/mh-darwin ++++ b/source/config/mh-darwin +@@ -31,7 +31,8 @@ SHLIB.cc= $(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS) $(LD_SOOPTIONS) + + ## Compiler switches to embed a library name and version information + ifeq ($(ENABLE_RPATH),YES) +-LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET)) ++ID_PREFIX = @rpath ++LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(ID_PREFIX)/$(notdir $(MIDDLE_SO_TARGET)) + else + LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE) + endif diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 36cddcc09e..0beaa23622 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -6,7 +6,7 @@ vcpkg_download_distfile( ARCHIVE URLS "https://github.com/unicode-org/icu/releases/download/release-${VERSION3}/icu4c-${VERSION2}-src.tgz" FILENAME "icu4c-${VERSION2}-src.tgz" - SHA512 e788e372716eecebc39b56bbc88f3a458e21c3ef20631c2a3d7ef05794a678fe8dad482a03a40fdb9717109a613978c7146682e98ee16fade5668d641d5c48f8 + SHA512 32c28270aa5d94c58d2b1ef46d4ab73149b5eaa2e0621d4a4c11597b71d146812f5e66db95f044e8aaa11b94e99edd4a48ab1aa8efbe3d72a73870cd56b564c2 ) vcpkg_extract_source_archive(SOURCE_PATH @@ -20,36 +20,33 @@ vcpkg_extract_source_archive(SOURCE_PATH disable-static-prefix.patch # https://gitlab.kitware.com/cmake/cmake/-/issues/16617; also mingw. fix-win-build.patch vcpkg-cross-data.patch + darwin-rpath.patch ) vcpkg_find_acquire_program(PYTHON3) set(ENV{PYTHON} "${PYTHON3}") vcpkg_list(SET CONFIGURE_OPTIONS) -vcpkg_list(SET CONFIGURE_OPTIONS_RELEASE) -vcpkg_list(SET CONFIGURE_OPTIONS_DEBUG) vcpkg_list(SET BUILD_OPTIONS) if(VCPKG_TARGET_IS_EMSCRIPTEN) vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-extras) vcpkg_list(APPEND BUILD_OPTIONS "PKGDATA_OPTS=--without-assembly -O ../data/icupkg.inc") +elseif(VCPKG_TARGET_IS_UWP) + vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-extras ac_cv_func_tzset=no ac_cv_func__tzset=no) + string(APPEND VCPKG_C_FLAGS " -DU_PLATFORM_HAS_WINUWP_API=1") + string(APPEND VCPKG_CXX_FLAGS " -DU_PLATFORM_HAS_WINUWP_API=1") +elseif(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_list(APPEND CONFIGURE_OPTIONS --enable-rpath) + if(DEFINED CMAKE_INSTALL_NAME_DIR) + vcpkg_list(APPEND BUILD_OPTIONS "ID_PREFIX=${CMAKE_INSTALL_NAME_DIR}") + endif() endif() if(VCPKG_TARGET_IS_WINDOWS) list(APPEND CONFIGURE_OPTIONS --enable-icu-build-win) endif() -list(APPEND CONFIGURE_OPTIONS --disable-samples --disable-tests --disable-layoutex) - -list(APPEND CONFIGURE_OPTIONS_RELEASE --disable-debug --enable-release) -list(APPEND CONFIGURE_OPTIONS_DEBUG --enable-debug --disable-release) - -set(CONFIG_TRIPLETS) -list(APPEND CONFIG_TRIPLETS ${TARGET_TRIPLET}-rel) -if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - list(APPEND CONFIG_TRIPLETS ${TARGET_TRIPLET}-dbg) -endif() - if("tools" IN_LIST FEATURES) list(APPEND CONFIGURE_OPTIONS --enable-tools) else() @@ -67,94 +64,22 @@ endif() vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" - AUTOCONFIG PROJECT_SUBPATH source - ADDITIONAL_MSYS_PACKAGES autoconf-archive - OPTIONS ${CONFIGURE_OPTIONS} - OPTIONS_RELEASE ${CONFIGURE_OPTIONS_RELEASE} - OPTIONS_DEBUG ${CONFIGURE_OPTIONS_DEBUG} + AUTOCONFIG DETERMINE_BUILD_TRIPLET + ADDITIONAL_MSYS_PACKAGES autoconf-archive + OPTIONS + ${CONFIGURE_OPTIONS} + --disable-samples + --disable-tests + --disable-layoutex + OPTIONS_RELEASE + --disable-debug + --enable-release + OPTIONS_DEBUG + --enable-debug + --disable-release ) - -if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - - vcpkg_build_make() - # remove this block if https://unicode-org.atlassian.net/browse/ICU-21458 - # is resolved and use the configure script instead - if(DEFINED CMAKE_INSTALL_NAME_DIR) - set(ID_PREFIX "${CMAKE_INSTALL_NAME_DIR}") - else() - set(ID_PREFIX "@rpath") - endif() - - # install_name_tool may be missing if cross-compiling - find_program( - INSTALL_NAME_TOOL - install_name_tool - HINTS /usr/bin /Library/Developer/CommandLineTools/usr/bin/ - DOC "Absolute path of install_name_tool" - REQUIRED - ) - - message(STATUS "setting rpath prefix for macOS dynamic libraries") - - if("tools" IN_LIST FEATURES) - set(LIBICUTU_RPATH "libicutu") - endif() - - #31680: Fix @rpath in both debug and release build - foreach(CONFIG_TRIPLE IN LISTS CONFIG_TRIPLETS) - # 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" - "libicuuc.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${CONFIG_TRIPLE}/lib" - LOGNAME "make-build-fix-rpath-${CONFIG_TRIPLE}" - ) - endforeach() - -endif() - vcpkg_install_make(OPTIONS ${BUILD_OPTIONS}) file(REMOVE_RECURSE diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json index d80834ecb6..441d2be0b7 100644 --- a/ports/icu/vcpkg.json +++ b/ports/icu/vcpkg.json @@ -1,11 +1,9 @@ { "name": "icu", - "version": "73.1", - "port-version": 2, + "version": "74.1", "description": "Mature and widely used Unicode and localization library.", "homepage": "https://icu.unicode.org/home", "license": "ICU", - "supports": "!uwp", "dependencies": [ { "name": "icu", @@ -17,7 +15,8 @@ ], "features": { "tools": { - "description": "Build tools" + "description": "Build tools", + "supports": "!uwp" } } } diff --git a/scripts/test_ports/vcpkg-ci-boost/vcpkg.json b/scripts/test_ports/vcpkg-ci-boost/vcpkg.json index c4bdf2a85a..0721b95e33 100644 --- a/scripts/test_ports/vcpkg-ci-boost/vcpkg.json +++ b/scripts/test_ports/vcpkg-ci-boost/vcpkg.json @@ -79,8 +79,7 @@ "default-features": false, "features": [ "icu" - ], - "platform":"!uwp" + ] } ] } diff --git a/versions/baseline.json b/versions/baseline.json index 332897d665..3cea19980a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3385,8 +3385,8 @@ "port-version": 0 }, "icu": { - "baseline": "73.1", - "port-version": 2 + "baseline": "74.1", + "port-version": 0 }, "ideviceinstaller": { "baseline": "2023-07-21", diff --git a/versions/i-/icu.json b/versions/i-/icu.json index d76f3d6c05..9c091e0df3 100644 --- a/versions/i-/icu.json +++ b/versions/i-/icu.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0a6f5ea29d6445c8af30f19952c62cc5dd5e2a5b", + "version": "74.1", + "port-version": 0 + }, { "git-tree": "b6ac20c2420a4f7118d5db326c8c599e50b2c5a4", "version": "73.1",