From 4b6289b936c71bbdb8f5c65973249132c0946235 Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Sat, 1 May 2021 20:16:52 +0200 Subject: [PATCH] [icu] add host depedency (#16577) * [icu] introduce host dependency * add version files * [icu] host dependency windows, update ci baseline * add version files * [icu] add debug messages * [icu] do not depend on buildtree, install required files instead * [icu] set env variable for dynamic libs * [icu] find dlls for windows * [icu] copy dlls * [icu] cleanup, fix apple arm targets * add version files * [icu] no for-cross-compile subfolder * add version files * [icu] use instead of * add version files * [icu] convert to vcpkg_configure_make * [icu] also build on arm * [icu] add DESTINATION param to vcpkg_copy_tools and use it * [icu] use foreach in macOS build * [icu] fix of copy tool dependencies on windows * [icu] delete more folders on windows * [icu] copy tool dependencies manually * [icu] don't copy non existing pdb files * add version files * [icu] bring vcpkg_copy_pdbs() back * add version files * [icu] add comment * add version files * [icu] use BUILD_TRIPLET instead of VCPKG_MAKE_BUILD_TRIPLET * add version files * [icu] simply logic for build on mac * add version files * Trigger Build * add version files * Trigger Build * Trigger Build * Apply suggestions from code review * Apply suggestions from code review * Trigger Build Co-authored-by: Billy Robert ONeal III Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com> --- ports/icu/CONTROL | 6 - ports/icu/portfile.cmake | 421 ++++++++++++--------------------------- ports/icu/vcpkg.json | 14 ++ scripts/ci.baseline.txt | 4 +- versions/baseline.json | 2 +- versions/i-/icu.json | 5 + 6 files changed, 145 insertions(+), 307 deletions(-) delete mode 100644 ports/icu/CONTROL create mode 100644 ports/icu/vcpkg.json diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL deleted file mode 100644 index 5dbdaaab42..0000000000 --- a/ports/icu/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: icu -Version: 69.1 -Port-Version: 8 -Homepage: http://icu-project.org/apiref/icu4c/ -Description: Mature and widely used Unicode and localization library. -Supports: !(arm|uwp) diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 2960b2eb30..32a8aea06c 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -25,308 +25,118 @@ vcpkg_extract_source_archive_ex( vcpkg_find_acquire_program(PYTHON3) set(ENV{PYTHON} "${PYTHON3}") -set(CONFIGURE_OPTIONS "--disable-samples --disable-tests --disable-layoutex") +list(APPEND CONFIGURE_OPTIONS --disable-samples --disable-tests --disable-layoutex) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --disable-static --enable-shared") -else() - set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --enable-static --disable-shared") -endif() +list(APPEND CONFIGURE_OPTIONS_RELEASE --disable-debug --enable-release) +list(APPEND CONFIGURE_OPTIONS_DEBUG --enable-debug --disable-release) -set(CONFIGURE_OPTIONS_RELEASE "--disable-debug --enable-release --prefix=${CURRENT_PACKAGES_DIR}") -set(CONFIGURE_OPTIONS_DEBUG "--enable-debug --disable-release --prefix=${CURRENT_PACKAGES_DIR}/debug") set(RELEASE_TRIPLET ${TARGET_TRIPLET}-rel) set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg) -if(NOT VCPKG_TARGET_IS_WINDOWS) - set(BASH bash) - set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -fPIC") - set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -fPIC") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - # Configure release - message(STATUS "Configuring ${RELEASE_TRIPLET}") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) - set(ENV{CFLAGS} "-O2 ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") - set(ENV{CXXFLAGS} "-O2 ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE}") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c - "${SOURCE_PATH}/source/runConfigureICU Linux ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_RELEASE}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" - LOGNAME "configure-${RELEASE_TRIPLET}") - message(STATUS "Configuring ${RELEASE_TRIPLET} done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # Configure debug - message(STATUS "Configuring ${DEBUG_TRIPLET}") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) - set(ENV{CFLAGS} "-O0 -g ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") - set(ENV{CXXFLAGS} "-O0 -g ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG}") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c - "${SOURCE_PATH}/source/runConfigureICU Linux ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_DEBUG}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" - LOGNAME "configure-${DEBUG_TRIPLET}") - message(STATUS "Configuring ${DEBUG_TRIPLET} done") - endif() - -else() +if(NOT "${TARGET_TRIPLET}" STREQUAL "${HOST_TRIPLET}") + # cross compiling + list(APPEND CONFIGURE_OPTIONS "--with-cross-build=${_VCPKG_INSTALLED_DIR}/${HOST_TRIPLET}/tools/${PORT}") +endif() +if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --host=x86_64-w64-mingw32") + set(BUILD_TRIPLET --host=x86_64-w64-mingw32) else() - set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --host=i686-w64-mingw32") - endif() - - # Acquire tools - vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.16) - - # Insert msys into the path between the compiler toolset and windows system32. This prevents masking of "link.exe" but DOES mask "find.exe". - string(REPLACE ";$ENV{SystemRoot}\\system32;" ";${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\system32;" NEWPATH "$ENV{PATH}") - string(REPLACE ";$ENV{SystemRoot}\\System32;" ";${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "${NEWPATH}") - set(ENV{PATH} "${NEWPATH}") - set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) - - set(AUTOMAKE_DIR ${MSYS_ROOT}/usr/share/automake-1.16) - file(COPY ${AUTOMAKE_DIR}/config.guess ${AUTOMAKE_DIR}/config.sub DESTINATION ${SOURCE_PATH}/source) - - if(NOT VCPKG_TARGET_IS_MINGW) - set(PLATFORM "MSYS/MSVC") - if(VCPKG_CRT_LINKAGE STREQUAL static) - set(ICU_RUNTIME "-MT") - else() - set(ICU_RUNTIME "-MD") - endif() - set(EXTRA_RELEASE_FLAGS "${ICU_RUNTIME} -O2 -Oi -Zi -FS") - set(RELEASE_LDFLAGS "-DEBUG -INCREMENTAL:NO -OPT:REF -OPT:ICF") - set(EXTRA_DEBUG_FLAGS "${ICU_RUNTIME}d -Od -Zi -FS -RTC1") - set(DEBUG_LDFLAGS "-DEBUG") - else() - set(PLATFORM "MinGW") - set(ENV{CC} "${CMAKE_C_COMPILER}") - set(ENV{CXX} "${CMAKE_CXX_COMPILER}") - endif() - - if(CMAKE_HOST_WIN32 AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") - set(ICU_MSVC_CROSS_COMPILE_TO_ARM ON) - # Need the buildtrees dir, as the required files (e.g. icucross.mk) are not part of the installed package - get_filename_component(ICU_HOST_PATH "${BUILDTREES_DIR}/icu/x86-windows-rel" ABSOLUTE) - if(NOT EXISTS "${ICU_HOST_PATH}") - message(FATAL_ERROR "The x86 icu must be be built locally to build for non-x86/x64 platforms. Please run `vcpkg install icu:x86-windows`.") - endif() - - set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --with-cross-build=${ICU_HOST_PATH}") - set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${ICU_HOST_PATH}/lib") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - # Configure release - message(STATUS "Configuring ${RELEASE_TRIPLET}") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}) - set(ENV{CFLAGS} "${EXTRA_RELEASE_FLAGS} ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") - set(ENV{CXXFLAGS} "${EXTRA_RELEASE_FLAGS} ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE}") - set(ENV{LDFLAGS} "${RELEASE_LDFLAGS}") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c - "${SOURCE_PATH}/source/runConfigureICU ${PLATFORM} ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_RELEASE}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" - LOGNAME "configure-${RELEASE_TRIPLET}") - message(STATUS "Configuring ${RELEASE_TRIPLET} done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # Configure debug - message(STATUS "Configuring ${DEBUG_TRIPLET}") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}) - set(ENV{CFLAGS} "${EXTRA_DEBUG_FLAGS} ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") - set(ENV{CXXFLAGS} "${EXTRA_DEBUG_FLAGS} ${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG}") - set(ENV{LDFLAGS} "${DEBUG_LDFLAGS}") - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c - "${SOURCE_PATH}/source/runConfigureICU ${PLATFORM} ${CONFIGURE_OPTIONS} ${CONFIGURE_OPTIONS_DEBUG}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" - LOGNAME "configure-${DEBUG_TRIPLET}") - message(STATUS "Configuring ${DEBUG_TRIPLET} done") + set(BUILD_TRIPLET --host=i686-w64-mingw32) endif() endif() -unset(ENV{CFLAGS}) -unset(ENV{CXXFLAGS}) -unset(ENV{LDFLAGS}) +vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH source + BUILD_TRIPLET ${BUILD_TRIPLET} + OPTIONS ${CONFIGURE_OPTIONS} + OPTIONS_RELEASE ${CONFIGURE_OPTIONS_RELEASE} + OPTIONS_DEBUG ${CONFIGURE_OPTIONS_DEBUG} +) -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - # Build release - message(STATUS "Package ${RELEASE_TRIPLET}") - vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" - NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" - LOGNAME "make-build-${RELEASE_TRIPLET}") +if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")) + vcpkg_build_make() # remove this block if https://unicode-org.atlassian.net/browse/ICU-21458 # is resolved and use the configure script instead - if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - 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") - - # add ID_PREFIX to libicudata - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -id "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "libicudata.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # add ID_PREFIX to libicui18n - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -id "${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib" - "libicui18n.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # add ID_PREFIX to libicui18n dependencies - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicuuc.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib" - "libicui18n.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicudata.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "libicui18n.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # add ID_PREFIX to libicuio - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -id "${ID_PREFIX}/libicuio.${ICU_VERSION_MAJOR}.dylib" - "libicuio.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # add ID_PREFIX to libicuio dependencies - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicuuc.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib" - "libicuio.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicudata.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "libicuio.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicui18n.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib" - "libicuio.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # add ID_PREFIX to libicutu - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -id "${ID_PREFIX}/libicutu.${ICU_VERSION_MAJOR}.dylib" - "libicutu.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # add ID_PREFIX to libicutu dependencies - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicui18n.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib" - "libicutu.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicuuc.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib" - "libicutu.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -change "libicudata.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "libicutu.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # add ID_PREFIX to libicuuc - vcpkg_execute_build_process( - COMMAND ${INSTALL_NAME_TOOL} -id "${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib" - "libicuuc.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - - # 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}" - ) + 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") + + # add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc + foreach(LIB_NAME libicudata libicui18n libicuio libicutu 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 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}" + ) + 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}" + ) + 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 ${BASH} --noprofile --norc -c "make install" + 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}" + ) + + # make install + vcpkg_execute_build_process( + COMMAND bash --noprofile --norc -c "make install" WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}" LOGNAME "make-install-${RELEASE_TRIPLET}") message(STATUS "Package ${RELEASE_TRIPLET} done") -endif() - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # Build debug - message(STATUS "Package ${DEBUG_TRIPLET}") - vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" - NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" - LOGNAME "make-build-${DEBUG_TRIPLET}") - - vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "make install" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}" - LOGNAME "make-install-${DEBUG_TRIPLET}") - message(STATUS "Package ${DEBUG_TRIPLET} done") -endif() - -if(NOT VCPKG_TARGET_IS_MINGW) # MinGW already has its files placed in the correct directory - file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) + else() + vcpkg_install_make() +endif() + +if(VCPKG_TARGET_IS_MINGW) file(GLOB ICU_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX} @@ -336,10 +146,10 @@ else() endif() file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/lib/icu + ${CURRENT_PACKAGES_DIR}/debug/lib/icu ${CURRENT_PACKAGES_DIR}/debug/lib/icud) file(GLOB TEST_LIBS @@ -347,18 +157,7 @@ file(GLOB TEST_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/*test*) file(REMOVE ${TEST_LIBS}) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - # copy icu dlls from lib to bin - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/lib/icu*${ICU_VERSION_MAJOR}.dll) - file(COPY ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/lib/icu*d${ICU_VERSION_MAJOR}.dll) - file(COPY ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - endif() -else() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") if(VCPKG_TARGET_IS_WINDOWS) # rename static libraries to match import libs # see https://gitlab.kitware.com/cmake/cmake/issues/16617 @@ -390,9 +189,37 @@ else() endforeach() endif() -# Install executables from ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/bin to /tools/icu -file(GLOB ICU_TOOLS ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(INSTALL ${ICU_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) +# Install executables from /tools/icu/sbin to /tools/icu/bin on unix (/bin because icu require this for cross compiling) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) + vcpkg_copy_tools( + TOOL_NAMES icupkg gennorm2 gencmn genccode gensprep + SEARCH_DIR ${CURRENT_PACKAGES_DIR}/tools/icu/sbin + DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin + ) +endif() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/tools/icu/sbin + ${CURRENT_PACKAGES_DIR}/tools/icu/debug) + +# To cross compile, we need some files at specific positions. So lets copy them +file(GLOB CROSS_COMPILE_DEFS ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/config/icucross.*) +file(INSTALL ${CROSS_COMPILE_DEFS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/config) + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/lib/icu*${ICU_VERSION_MAJOR}.dll) + file(COPY ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin) +endif() + +# copy dlls +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/lib/icu*${ICU_VERSION_MAJOR}.dll) + file(COPY ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/lib/icu*${ICU_VERSION_MAJOR}.dll) + file(COPY ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() # remove any remaining dlls in /lib file(GLOB DUMMY_DLLS ${CURRENT_PACKAGES_DIR}/lib/*.dll ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll) @@ -400,8 +227,6 @@ if(DUMMY_DLLS) file(REMOVE ${DUMMY_DLLS}) endif() -# Generates warnings about missing pdbs for icudt.dll -# This is expected because ICU database contains no executable code vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread m) diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json new file mode 100644 index 0000000000..c20dc69201 --- /dev/null +++ b/ports/icu/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "icu", + "version": "69.1", + "port-version": 9, + "description": "Mature and widely used Unicode and localization library.", + "homepage": "http://icu-project.org/apiref/icu4c/", + "supports": "!uwp", + "dependencies": [ + { + "name": "icu", + "host": true + } + ] +} diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index dfb81c7003..9e547a3b30 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -459,8 +459,6 @@ hiredis:x64-uwp=fail hpx:x64-windows-static=fail hpx:x64-linux=fail libhsplasma:x64-windows-static=fail -icu:arm-uwp=fail -icu:x64-uwp=fail ideviceinstaller:x64-windows-static-md=fail idevicerestore:x64-linux=fail idevicerestore:x64-osx=fail @@ -687,6 +685,7 @@ libmpeg2:x64-osx=fail libmpeg2:x64-uwp=fail libmupdf:x64-osx=fail libmysql:x86-windows=fail +libmysql:arm64-windows=fail #The official website of libnice https://nice.freedesktop.org cannot be accessed libnice:x86-windows=skip libnice:x64-windows=skip @@ -1293,6 +1292,7 @@ qpid-proton:x64-uwp=fail qpid-proton:x64-windows-static=fail qt5-activeqt:x64-linux=fail qt5-activeqt:x64-osx=fail +qt5-base:arm64-windows=fail # Skip deprecated Qt module # (remnove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly) qt5-canvas3d:x64-linux=skip diff --git a/versions/baseline.json b/versions/baseline.json index 87efce787d..1f18cd1286 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2510,7 +2510,7 @@ }, "icu": { "baseline": "69.1", - "port-version": 8 + "port-version": 9 }, "ideviceinstaller": { "baseline": "1.1.2.23-1", diff --git a/versions/i-/icu.json b/versions/i-/icu.json index d519ccf77d..7bb611f537 100644 --- a/versions/i-/icu.json +++ b/versions/i-/icu.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5c039f72ee659cc0522524889b9219615f28263a", + "version": "69.1", + "port-version": 9 + }, { "git-tree": "c918e5cfffd2c55c740dd69ef3f5eb36c1e17806", "version-string": "69.1",