[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 <bion@microsoft.com>
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
This commit is contained in:
autoantwort 2021-05-01 20:16:52 +02:00 committed by GitHub
parent da9defc3bd
commit 4b6289b936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 145 additions and 307 deletions

View File

@ -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)

View File

@ -25,308 +25,118 @@ vcpkg_extract_source_archive_ex(
vcpkg_find_acquire_program(PYTHON3) vcpkg_find_acquire_program(PYTHON3)
set(ENV{PYTHON} "${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") list(APPEND CONFIGURE_OPTIONS_RELEASE --disable-debug --enable-release)
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --disable-static --enable-shared") list(APPEND CONFIGURE_OPTIONS_DEBUG --enable-debug --disable-release)
else()
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --enable-static --disable-shared")
endif()
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(RELEASE_TRIPLET ${TARGET_TRIPLET}-rel)
set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg) set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg)
if(NOT VCPKG_TARGET_IS_WINDOWS) if(NOT "${TARGET_TRIPLET}" STREQUAL "${HOST_TRIPLET}")
set(BASH bash) # cross compiling
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -fPIC") list(APPEND CONFIGURE_OPTIONS "--with-cross-build=${_VCPKG_INSTALLED_DIR}/${HOST_TRIPLET}/tools/${PORT}")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -fPIC") 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} "-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(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") 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() else()
set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --host=i686-w64-mingw32") set(BUILD_TRIPLET --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")
endif() endif()
endif() endif()
unset(ENV{CFLAGS}) vcpkg_configure_make(
unset(ENV{CXXFLAGS}) SOURCE_PATH ${SOURCE_PATH}
unset(ENV{LDFLAGS}) 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") if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND (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}")
vcpkg_build_make()
# remove this block if https://unicode-org.atlassian.net/browse/ICU-21458 # remove this block if https://unicode-org.atlassian.net/browse/ICU-21458
# is resolved and use the configure script instead # 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)
if(DEFINED CMAKE_INSTALL_NAME_DIR) set(ID_PREFIX "${CMAKE_INSTALL_NAME_DIR}")
set(ID_PREFIX "${CMAKE_INSTALL_NAME_DIR}") else()
else() set(ID_PREFIX "@rpath")
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}"
)
endif() 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( 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}" WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}"
LOGNAME "make-install-${RELEASE_TRIPLET}") LOGNAME "make-install-${RELEASE_TRIPLET}")
message(STATUS "Package ${RELEASE_TRIPLET} done") 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() else()
vcpkg_install_make()
endif()
if(VCPKG_TARGET_IS_MINGW)
file(GLOB ICU_TOOLS file(GLOB ICU_TOOLS
${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX}
${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX}
@ -336,10 +146,10 @@ else()
endif() endif()
file(REMOVE_RECURSE file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/share
${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/lib/icu ${CURRENT_PACKAGES_DIR}/lib/icu
${CURRENT_PACKAGES_DIR}/debug/lib/icu
${CURRENT_PACKAGES_DIR}/debug/lib/icud) ${CURRENT_PACKAGES_DIR}/debug/lib/icud)
file(GLOB TEST_LIBS file(GLOB TEST_LIBS
@ -347,18 +157,7 @@ file(GLOB TEST_LIBS
${CURRENT_PACKAGES_DIR}/debug/lib/*test*) ${CURRENT_PACKAGES_DIR}/debug/lib/*test*)
file(REMOVE ${TEST_LIBS}) file(REMOVE ${TEST_LIBS})
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# 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_TARGET_IS_WINDOWS) if(VCPKG_TARGET_IS_WINDOWS)
# rename static libraries to match import libs # rename static libraries to match import libs
# see https://gitlab.kitware.com/cmake/cmake/issues/16617 # see https://gitlab.kitware.com/cmake/cmake/issues/16617
@ -390,9 +189,37 @@ else()
endforeach() endforeach()
endif() endif()
# Install executables from ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/bin to /tools/icu # Install executables from /tools/icu/sbin to /tools/icu/bin on unix (/bin because icu require this for cross compiling)
file(GLOB ICU_TOOLS ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/bin/*${VCPKG_HOST_EXECUTABLE_SUFFIX}) if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
file(INSTALL ${ICU_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) 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 # remove any remaining dlls in /lib
file(GLOB DUMMY_DLLS ${CURRENT_PACKAGES_DIR}/lib/*.dll ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll) 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}) file(REMOVE ${DUMMY_DLLS})
endif() endif()
# Generates warnings about missing pdbs for icudt.dll
# This is expected because ICU database contains no executable code
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread m) vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread m)

14
ports/icu/vcpkg.json Normal file
View File

@ -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
}
]
}

View File

@ -459,8 +459,6 @@ hiredis:x64-uwp=fail
hpx:x64-windows-static=fail hpx:x64-windows-static=fail
hpx:x64-linux=fail hpx:x64-linux=fail
libhsplasma:x64-windows-static=fail libhsplasma:x64-windows-static=fail
icu:arm-uwp=fail
icu:x64-uwp=fail
ideviceinstaller:x64-windows-static-md=fail ideviceinstaller:x64-windows-static-md=fail
idevicerestore:x64-linux=fail idevicerestore:x64-linux=fail
idevicerestore:x64-osx=fail idevicerestore:x64-osx=fail
@ -687,6 +685,7 @@ libmpeg2:x64-osx=fail
libmpeg2:x64-uwp=fail libmpeg2:x64-uwp=fail
libmupdf:x64-osx=fail libmupdf:x64-osx=fail
libmysql:x86-windows=fail libmysql:x86-windows=fail
libmysql:arm64-windows=fail
#The official website of libnice https://nice.freedesktop.org cannot be accessed #The official website of libnice https://nice.freedesktop.org cannot be accessed
libnice:x86-windows=skip libnice:x86-windows=skip
libnice:x64-windows=skip libnice:x64-windows=skip
@ -1293,6 +1292,7 @@ qpid-proton:x64-uwp=fail
qpid-proton:x64-windows-static=fail qpid-proton:x64-windows-static=fail
qt5-activeqt:x64-linux=fail qt5-activeqt:x64-linux=fail
qt5-activeqt:x64-osx=fail qt5-activeqt:x64-osx=fail
qt5-base:arm64-windows=fail
# Skip deprecated Qt module # Skip deprecated Qt module
# (remnove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly) # (remnove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly)
qt5-canvas3d:x64-linux=skip qt5-canvas3d:x64-linux=skip

View File

@ -2510,7 +2510,7 @@
}, },
"icu": { "icu": {
"baseline": "69.1", "baseline": "69.1",
"port-version": 8 "port-version": 9
}, },
"ideviceinstaller": { "ideviceinstaller": {
"baseline": "1.1.2.23-1", "baseline": "1.1.2.23-1",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "5c039f72ee659cc0522524889b9219615f28263a",
"version": "69.1",
"port-version": 9
},
{ {
"git-tree": "c918e5cfffd2c55c740dd69ef3f5eb36c1e17806", "git-tree": "c918e5cfffd2c55c740dd69ef3f5eb36c1e17806",
"version-string": "69.1", "version-string": "69.1",