From 3a26eb3dc4d684ca6c1748dccc7a15684b9e8d0a Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Tue, 17 Nov 2020 18:18:59 +0100 Subject: [intl/gettext/fontconfig] update to native build system (#11776) * [fontconfig] update fontconfig * [libiconv] update to make * [gettext] update to make * [vcpkg_configure_make] Changes considering pure configure ports without the requirement to run autoconfig * [fontconfig] make it work on windows * Remove install of unofficial cmake config * add function get_cmake_vars * fine tuning. * apply to make based ports. * add log suffix on not windows platforms * fix c&p error * add previous LINK env * setup env on windows and extract cpp flags correctly. * update glib and libxml2 * fix windows regressions * Apply suggestions from code review * add windres wrapper to invoke RC. * remove wrong fi * fix libintl. * try fixing uwp * other things to update * exiv2 fix * libtool does not like -RTC1 * pass the /RTC flag directly to the compiler * trust cmake instead of adding extra flags * fix expat * fix iconv wrapper install * change fontconfig intl linkage. * add appcontainer back in which is required for UWP. Why is this not in the cmake flags? * fix pkg-config in vcpkg_configure_make * fix json-c pkg-config installation * remove remnoved config * comment out debug messages + bit of tuning * finally fontconfig * comment debug messages * expat apply extra patches. * Switch back to -E instead of -EP in cpp * commit changes from fontconfig PR * [expat] fix expat details * Apply suggestions from code review Co-authored-by: nicole mazzuca * cleanup docs * update osx pipeline so that fontconfig actually builds * fix expat the lazy way by using a higher commit than release * fix a barage of regressions due to the use of unofficial targets * [expat] use a higher commit hash with a better stabilized cmake build * forgot freexl regression * more unofficial fixes * fix downstream expat usage * fix wxwidgets * fix gcdm regression * [vtk] fix the regression due to expat * add uwp cl flags back in. Somehow those are not set by cmake * add a few other configure options for full gettext build * fix cmake regression * fix a few regressions * fix static gettext build * fix gettext static * fix libxml2 wrapper for cmake * some more regressions fixes * add conversion from somelib.lib to -lsomelib * add a few option to libiconv. * get logs from CI * add missing ar-lib wrapper * add missing ar-lib wrapper * add fatal error to gettext * remove uuid from the list of LIBS since it seems to not exist in CI? * small but important regex correction * fix regex and add debug message for libs * remove error and only build libintl. * add uuid dependency to fontconfig in qt5-base * osx install gettext for autopoint * fix io2d regression by saying the port is broken ..... (which it is; upstream needs to learn proper cmake) * restore the old libxml2 wrapper with minor modifications * fix xmlsec regression * install wrapper correctly * try actual fixing io2d * improve iconv wrapper * add latest changes from update_fontconfig PR * Apply suggestions from code review first set which don't need special attention Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> * Apply suggestions from code review one more simple change Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> * [x264] set env AS * fix bugs due to refactor * use subpath everywhere * apply changes from CR * fix fontconfig build. * only change libs in static builds * remove unnecessary lines 41 & 44 * remove flag transformation * reintroduce the flag / to - transformation for MSVC * trying to figure out autopoint issue. using wrong (windows) find.exe instead of msys * add correct working_dir to subpath * escape stupid env paths. * fix typo * add findutils remove debug messages * add error if libtool chokes * add file to msys * pass lt_cv_deplibs_check_method=pass_all on windows (couldn't get file.exe to work so that libtool correctly ids the passed libs) * add bzip2 to msys * reenable libtool check. Lets see if CI agrees * unbreak linux try to figure out where uuid should be on windows. * add -L flag and help libtool ? * try to get ci to find uuid. * try to use cygpath * update controls * cleanup merge mistakes * correct merge issues * determine cmake vars if not done before. * move adding of -l earlier * more merge cleanup * fix uwp builds by not transforming libs * fix patches in io2d * fix xz download error * apply code review changes manually * fix the typos left behind in CR Co-authored-by: nicole mazzuca Co-authored-by: Billy Robert O'Neal III Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> --- scripts/cmake/vcpkg_acquire_msys.cmake | 41 +++++++++++++++++++++++++++++++- scripts/cmake/vcpkg_build_make.cmake | 11 +++++++++ scripts/cmake/vcpkg_configure_make.cmake | 33 ++++++++++++++++++------- 3 files changed, 75 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index b502eab6a..49271eeb6 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -183,7 +183,27 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) msys_package( URL "https://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz" SHA512 b309799e5a9d248ef66eaf11a0bd21bf4e8b9bd5c677c627ec83fa760ce9f0b54ddf1b62cbb436e641fbbde71e3b61cb71ff541d866f8ca7717a3a0dbeb00ebf - DEPS grep sed coreutils + DEPS grep sed coreutils file + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/file-5.39-1-x86_64.pkg.tar.zst" + SHA512 be51dd0f6143a2f34f2a3e7d412866eb12511f25daaf3a5478240537733a67d7797a3a55a8893e5638589c06bca5af20aed5ded7db0bf19fbf52b30fae08cadd + DEPS gcc-libs zlib libbz2 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/zlib-1.2.11-1-x86_64.pkg.tar.xz" + SHA512 b607da40d3388b440f2a09e154f21966cd55ad77e02d47805f78a9dee5de40226225bf0b8335fdfd4b83f25ead3098e9cb974d4f202f28827f8468e30e3b790d + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/bzip2-1.0.8-2-x86_64.pkg.tar.xz" + SHA512 336f5b59eb9cf4e93b537a212509d84f72cd9b8a97bf8ac0596eff298f3c0979bdea6c605244d5913670b9d20b017e5ee327f1e606f546a88e177a03c589a636 + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libbz2-1.0.8-2-x86_64.pkg.tar.xz" + SHA512 d128bd1792d0f5750e6a63a24db86a791e7ee457db8c0bef68d217099be4a6eef27c85caf6ad09b0bcd5b3cdac6fc0a2b9842cc58d381a4035505906cc4803ec + DEPS gcc-libs ) msys_package( URL "https://repo.msys2.org/msys/x86_64/coreutils-8.32-1-x86_64.pkg.tar.xz" @@ -229,6 +249,15 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) URL "https://repo.msys2.org/msys/x86_64/gmp-6.2.0-1-x86_64.pkg.tar.xz" SHA512 1389a443e775bb255d905665dd577bef7ed71d51a8c24d118097f8119c08c4dfe67505e88ddd1e9a3764dd1d50ed8b84fa34abefa797d257e90586f0cbf54de8 ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/xz-5.2.5-1-x86_64.pkg.tar.xz" # this seems to require immediate updating on version bumps. + SHA512 99d092c3398277e47586cead103b41e023e9432911fb7bdeafb967b826f6a57d32e58afc94c8230dad5b5ec2aef4f10d61362a6d9e410a6645cf23f076736bba + DEPS liblzma libiconv gettext + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/liblzma-5.2.5-1-x86_64.pkg.tar.xz" + SHA512 8d5c04354fdc7309e73abce679a4369c0be3dc342de51cef9d2a932b7df6a961c8cb1f7e373b1b8b2be40343a95fbd57ac29ebef63d4a2074be1d865e28ca6ad + ) msys_package( URL "https://repo.msys2.org/msys/x86_64/libreadline-8.0.004-1-x86_64.pkg.tar.xz" SHA512 42760bddedccc8d93507c1e3a7a81595dc6392b5e4319d24a85275eb04c30eb79078e4247eb2cdd00ff3884d932639130c89bf1b559310a17fa4858062491f97 @@ -269,6 +298,11 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) SHA512 7306dec7859edc27d70a24ab4b396728481484a426c5aa2f7e9fed2635b3b25548b05b7d37a161a86a8edaa5922948bee8c99b1e8a078606e69ca48a433fe321 DEPS libintl msys2-runtime ) +msys_package( + URL "https://repo.msys2.org/msys/x86_64/gettext-devel-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 648f74c23e4f92145cdd0d45ff5285c2df34e855a9e75e5463dd6646967f8cf34a18ce357c6f498a4680e6d7b84e2d1697ba9deee84da8ea6bb14bbdb594ee22 + DEPS gettext + ) msys_package( URL "https://repo.msys2.org/msys/x86_64/gettext-0.19.8.1-1-x86_64.pkg.tar.xz" SHA512 c8c42d084c297746548963f7ec7a7df46241886f3e637e779811ee4a8fee6058f892082bb2658f6777cbffba2de4bcdfd68e846ba63c6a6552c9efb0c8c1de50 @@ -284,6 +318,11 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) SHA512 a2e8027b9bbee20f8cf60851130ca2af436641b1fb66054f8deba118da7ebecb1cd188224dcf08e4c5b7cde85b412efab058afef2358e843c9de8eb128ca448c DEPS gcc-libs ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/findutils-4.7.0-1-x86_64.pkg.tar.xz" + SHA512 fd09a24562b196ff252f4b5de86ed977280306a8c628792930812f146fcf7355f9d87434bbabe25e6cc17d8bd028f6bc68fc02e5bea83137a49cf5cc6f509e10 + DEPS libintl libiconv + ) msys_package( URL "https://repo.msys2.org/msys/x86_64/libintl-0.19.8.1-1-x86_64.pkg.tar.xz" SHA512 4e54c252b828c862f376d8f5a2410ee623a43d70cbb07d0b8ac20c25096f59fb3ae8dcd011d1792bec76f0b0b9411d0e184ee23707995761dc50eb76f9fc6b92 diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index fb9daa358..a6adebc43 100644 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -42,7 +42,12 @@ ## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake) ## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) function(vcpkg_build_make) + if(NOT _VCPKG_CMAKE_VARS_FILE) + # vcpkg_build_make called without using vcpkg_configure_make before + vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) + endif() include("${_VCPKG_CMAKE_VARS_FILE}") + # parse parameters such that semicolons in options arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 _bc "ADD_BIN_TO_PATH;ENABLE_INSTALL;DISABLE_PARALLEL" "LOGFILE_ROOT;BUILD_TARGET;SUBPATH" "") @@ -117,6 +122,7 @@ function(vcpkg_build_make) message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}") _vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${CMAKE_BUILDTYPE}) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(LINKER_FLAGS_${CMAKE_BUILDTYPE} "${VCPKG_DETECTED_STATIC_LINKERFLAGS_${CMAKE_BUILDTYPE}}") else() # dynamic @@ -173,6 +179,11 @@ function(vcpkg_build_make) ) endif() + file(READ "${CURRENT_BUILDTREES_DIR}/${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}-out.log" LOGDATA) + if(LOGDATA MATCHES "Warning: linker path does not have real file for library") + message(FATAL_ERROR "libtool could not find a file being linked against!") + endif() + if (_bc_ENABLE_INSTALL) message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}") if(MAKE_BASH) diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index d3cba3bf2..0d80e148c 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -206,7 +206,7 @@ function(vcpkg_configure_make) cmake_parse_arguments(PARSE_ARGV 0 _csc "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET" "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" - "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT;ADDITIONAL_MSYS_PACKAGES" ) vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) set(_VCPKG_CMAKE_VARS_FILE "${_VCPKG_CMAKE_VARS_FILE}" PARENT_SCOPE) @@ -265,7 +265,7 @@ function(vcpkg_configure_make) # Pre-processing windows configure requirements if (CMAKE_HOST_WIN32) list(APPEND MSYS_REQUIRE_PACKAGES binutils libtool autoconf automake-wrapper automake1.16 m4) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES}) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES} ${_csc_ADDITIONAL_MSYS_PACKAGES}) if (_csc_AUTOCONFIG AND NOT _csc_BUILD_TRIPLET OR _csc_DETERMINE_BUILD_TRIPLET) _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build= _vcpkg_determine_autotools_target_cpu(TARGET_ARCH) @@ -388,6 +388,7 @@ function(vcpkg_configure_make) # Variables not correctly detected by configure. In release builds. list(APPEND _csc_OPTIONS gl_cv_double_slash_root=yes ac_cv_func_memmove=yes) + #list(APPEND _csc_OPTIONS lt_cv_deplibs_check_method=pass_all) # Just ignore libtool checks if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") list(APPEND _csc_OPTIONS gl_cv_host_cpu_c_abi=no) endif() @@ -478,20 +479,34 @@ function(vcpkg_configure_make) convert_to_list(VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES C_LIBS_LIST) convert_to_list(VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES CXX_LIBS_LIST) set(ALL_LIBS_LIST ${C_LIBS_LIST} ${CXX_LIBS_LIST}) - list(REMOVE_DUPLICATES ALL_LIBS_LIST) list(TRANSFORM ALL_LIBS_LIST STRIP) - list(TRANSFORM ALL_LIBS_LIST REPLACE "(.lib|.a|.so)$" "") - if(VCPKG_TARGET_IS_WINDOWS) - list(REMOVE_ITEM ALL_LIBS_LIST "uuid") + + #Do lib list transformation from name.lib to -lname if necessary + set(_VCPKG_TRANSFORM_LIBS TRUE) + if(VCPKG_TARGET_IS_UWP) + set(_VCPKG_TRANSFORM_LIBS FALSE) + # Avoid libtool choke: "Warning: linker path does not have real file for library -lWindowsApp." + # The problem with the choke is that libtool always falls back to built a static library even if a dynamic was requested. + # Note: Env LIBPATH;LIB are on the search path for libtool by default on windows. + # It even does unix/dos-short/unix transformation with the path to get rid of spaces. + endif() + set(_lprefix) + if(_VCPKG_TRANSFORM_LIBS) + set(_lprefix "-l") + list(TRANSFORM ALL_LIBS_LIST REPLACE "(.dll.lib|.lib|.a|.so)$" "") + if(VCPKG_TARGET_IS_WINDOWS) + list(REMOVE_ITEM ALL_LIBS_LIST "uuid") + endif() endif() - list(JOIN ALL_LIBS_LIST " -l" ALL_LIBS_STRING) + list(JOIN ALL_LIBS_LIST " ${_lprefix}" ALL_LIBS_STRING) if(ALL_LIBS_STRING) + set(ALL_LIBS_STRING "${_lprefix}${ALL_LIBS_STRING}") if(DEFINED ENV{LIBS}) - set(ENV{LIBS} "$ENV{LIBS} -l${ALL_LIBS_STRING}") + set(ENV{LIBS} "$ENV{LIBS} ${ALL_LIBS_STRING}") else() - set(ENV{LIBS} "-l${ALL_LIBS_STRING}") + set(ENV{LIBS} "${ALL_LIBS_STRING}") endif() endif() debug_message(STATUS "ENV{LIBS}:$ENV{LIBS}") -- cgit v1.2.3