[vcpkg] Replace uses of msys pacman.exe with direct package downloads (#13019)

* wip

Apply suggestions from code review

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>

* [vcpkg_acquire_msys] Trim list of packages. Introduce defaults.

* [behaviortree-cpp] Fix dynamic dependency on ZMQ

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
ras0219 2020-08-31 22:36:25 -07:00 коммит произвёл GitHub
Родитель cdd4a988fd
Коммит 46e25a10d7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
19 изменённых файлов: 462 добавлений и 275 удалений

Просмотреть файл

@ -20,35 +20,23 @@ vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DCMAKE_DISABLE_FIND_PACKAGE_ament_cmake=1
-DCMAKE_DISABLE_FIND_PACKAGE_Curses=1
-DBUILD_EXAMPLES=OFF
-DBUILD_UNIT_TESTS=OFF
-DBUILD_TOOLS=OFF
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/BehaviorTreeV3/cmake TARGET_PATH share/behaviortreev3)
vcpkg_copy_pdbs()
set(TOOLS bt3_log_cat bt3_plugin_manifest)
foreach(tool ${TOOLS})
set(suffix ${VCPKG_TARGET_EXECUTABLE_SUFFIX})
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
endif()
endforeach()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/lib/BehaviorTreeV3"
"${CURRENT_PACKAGES_DIR}/debug/lib/BehaviorTreeV3"
)
vcpkg_test_cmake(PACKAGE_NAME BehaviorTreeV3)

Просмотреть файл

@ -1,7 +1,7 @@
{
"name": "behaviortree-cpp",
"version-string": "3.5.1",
"port-version": 1,
"port-version": 2,
"description": "Behavior Trees Library in C++.",
"homepage": "https://www.behaviortree.dev",
"supports": "!uwp & !osx",

Просмотреть файл

@ -1,6 +1,6 @@
Source: ffmpeg
Version: 4.2
Port-Version: 21
Port-Version: 22
Homepage: https://ffmpeg.org
Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.
FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.

Просмотреть файл

@ -18,7 +18,7 @@ vcpkg_from_github(
0012-Fix-ssl-110-detection.patch
)
if (${SOURCE_PATH} MATCHES " ")
if (SOURCE_PATH MATCHES " ")
message(FATAL_ERROR "Error: ffmpeg will not build with spaces in the path. Please use a directory with no spaces")
endif()
@ -26,35 +26,46 @@ vcpkg_find_acquire_program(YASM)
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
if(VCPKG_TARGET_IS_WINDOWS)
set(SEP ";")
#We're assuming that if we're building for Windows we're using MSVC
set(INCLUDE_VAR "INCLUDE")
set(LIB_PATH_VAR "LIB")
else()
set(SEP ":")
set(INCLUDE_VAR "CPATH")
set(LIB_PATH_VAR "LIBRARY_PATH")
endif()
set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${YASM_EXE_PATH}")
set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect")
if(VCPKG_TARGET_IS_WINDOWS)
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make pkg-config)
vcpkg_acquire_msys(MSYS_ROOT
DIRECT_PACKAGES
# Required for "cpp.exe" preprocessor
"https://repo.msys2.org/msys/x86_64/gcc-9.3.0-1-x86_64.pkg.tar.xz"
76af0192a092278e6b26814b2d92815a2c519902a3fec056b057faec19623b1770ac928a59a39402db23cfc23b0d7601b7f88b367b27269361748c69d08654b2
"https://repo.msys2.org/msys/x86_64/isl-0.22.1-1-x86_64.pkg.tar.xz"
f4db50d00bad0fa0abc6b9ad965b0262d936d437a9faa35308fa79a7ee500a474178120e487b2db2259caf51524320f619e18d92acf4f0b970b5cbe5cc0f63a2
"https://repo.msys2.org/msys/x86_64/zlib-1.2.11-1-x86_64.pkg.tar.xz"
b607da40d3388b440f2a09e154f21966cd55ad77e02d47805f78a9dee5de40226225bf0b8335fdfd4b83f25ead3098e9cb974d4f202f28827f8468e30e3b790d
"https://repo.msys2.org/msys/x86_64/mpc-1.1.0-1-x86_64.pkg.tar.xz"
7d0715c41c27fdbf91e6dcc73d6b8c02ee62c252e027f0a17fa4bfb974be8a74d8e3a327ef31c2460721902299ef69a7ef3c7fce52c8f02ce1cb47f0b6e073e9
"https://repo.msys2.org/msys/x86_64/mpfr-4.1.0-1-x86_64.pkg.tar.zst"
d64fa60e188124591d41fc097d7eb51d7ea4940bac05cdcf5eafde951ed1eaa174468f5ede03e61106e1633e3428964b34c96de76321ed8853b398fbe8c4d072
"https://repo.msys2.org/msys/x86_64/gmp-6.2.0-1-x86_64.pkg.tar.xz"
1389a443e775bb255d905665dd577bef7ed71d51a8c24d118097f8119c08c4dfe67505e88ddd1e9a3764dd1d50ed8b84fa34abefa797d257e90586f0cbf54de8
)
else()
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make pkg-config)
vcpkg_acquire_msys(MSYS_ROOT)
endif()
set(SHELL ${MSYS_ROOT}/usr/bin/bash.exe)
set(OPTIONS "--toolchain=msvc ${OPTIONS}")
else()
set(ENV{PATH} "$ENV{PATH}:${YASM_EXE_PATH}")
set(SHELL /bin/sh)
endif()
set(ENV{${INCLUDE_VAR}} "${CURRENT_INSTALLED_DIR}/include${SEP}$ENV{${INCLUDE_VAR}}")
set(ENV{${INCLUDE_VAR}} "${CURRENT_INSTALLED_DIR}/include${VCPKG_HOST_PATH_SEPARATOR}$ENV{${INCLUDE_VAR}}")
set(_csc_PROJECT_PATH ffmpeg)
@ -333,7 +344,7 @@ if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQU
vcpkg_find_acquire_program(GASPREPROCESSOR)
foreach(GAS_PATH ${GASPREPROCESSOR})
get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${GAS_ITEM_PATH}")
set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${GAS_ITEM_PATH}")
endforeach(GAS_PATH)
elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
@ -382,7 +393,7 @@ message(STATUS "Building Options: ${OPTIONS}")
# Release build
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release)
message(STATUS "Building Release Options: ${OPTIONS_RELEASE}")
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${SEP}${ENV_LIB_PATH}")
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}")
set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}")
set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}")
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")
@ -405,7 +416,7 @@ endif()
# Debug build
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
message(STATUS "Building Debug Options: ${OPTIONS_DEBUG}")
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${SEP}${ENV_LIB_PATH}")
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}")
set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}")
set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}")
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig")
@ -425,36 +436,36 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
)
endif()
file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def)
if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(LIB_MACHINE_ARG /machine:ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(LIB_MACHINE_ARG /machine:ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(LIB_MACHINE_ARG /machine:x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(LIB_MACHINE_ARG /machine:x64)
else()
message(FATAL_ERROR "Unsupported target architecture")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(LIB_MACHINE_ARG /machine:ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(LIB_MACHINE_ARG /machine:ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(LIB_MACHINE_ARG /machine:x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(LIB_MACHINE_ARG /machine:x64)
else()
message(FATAL_ERROR "Unsupported target architecture")
endif()
foreach(DEF_FILE ${DEF_FILES})
get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY)
get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME)
string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}")
file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE)
file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE)
message(STATUS "Generating ${OUT_FILE_NATIVE}")
vcpkg_execute_required_process(
COMMAND lib.exe /def:${DEF_FILE_NATIVE} /out:${OUT_FILE_NATIVE} ${LIB_MACHINE_ARG}
WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}
LOGNAME libconvert-${TARGET_TRIPLET}
)
endforeach()
foreach(DEF_FILE ${DEF_FILES})
get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY)
get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME)
string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}")
file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE)
file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE)
message(STATUS "Generating ${OUT_FILE_NATIVE}")
vcpkg_execute_required_process(
COMMAND lib.exe /def:${DEF_FILE_NATIVE} /out:${OUT_FILE_NATIVE} ${LIB_MACHINE_ARG}
WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}
LOGNAME libconvert-${TARGET_TRIPLET}
)
endforeach()
# Handle tools
if (VCPKG_TARGET_IS_WINDOWS)
# Handle tools
file(GLOB EXP_FILES ${CURRENT_PACKAGES_DIR}/lib/*.exp ${CURRENT_PACKAGES_DIR}/debug/lib/*.exp)
file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX})
file(GLOB EXE_FILES_REL ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX})
@ -484,15 +495,15 @@ vcpkg_copy_pdbs()
# Handle copyright
file(STRINGS ${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-out.log LICENSE_STRING REGEX "License: .*" LIMIT_COUNT 1)
if(${LICENSE_STRING} STREQUAL "License: LGPL version 2.1 or later")
if(LICENSE_STRING STREQUAL "License: LGPL version 2.1 or later")
set(LICENSE_FILE "COPYING.LGPLv2.1")
elseif(${LICENSE_STRING} STREQUAL "License: LGPL version 3 or later")
elseif(LICENSE_STRING STREQUAL "License: LGPL version 3 or later")
set(LICENSE_FILE "COPYING.LGPLv3")
elseif(${LICENSE_STRING} STREQUAL "License: GPL version 2 or later")
elseif(LICENSE_STRING STREQUAL "License: GPL version 2 or later")
set(LICENSE_FILE "COPYING.GPLv2")
elseif(${LICENSE_STRING} STREQUAL "License: GPL version 3 or later")
elseif(LICENSE_STRING STREQUAL "License: GPL version 3 or later")
set(LICENSE_FILE "COPYING.GPLv3")
elseif(${LICENSE_STRING} STREQUAL "License: nonfree and unredistributable")
elseif(LICENSE_STRING STREQUAL "License: nonfree and unredistributable")
set(LICENSE_FILE "COPYING.NONFREE")
file(WRITE ${SOURCE_PATH}/${LICENSE_FILE} ${LICENSE_STRING})
else()

Просмотреть файл

@ -1,5 +1,6 @@
Source: kf5i18n
Version: 5.64.0
Port-Version: 1
Homepage: https://api.kde.org/frameworks/ki18n/html/index.html
Description: Advanced internationalization framework
Build-Depends: ecm, qt5-declarative, qt5-tools, gettext

Просмотреть файл

@ -6,7 +6,22 @@ vcpkg_from_github(
)
if(CMAKE_HOST_WIN32)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES mingw-w64-i686-gettext)
vcpkg_acquire_msys(MSYS_ROOT NO_DEFAULT_PACKAGES DIRECT_PACKAGES
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gettext-0.19.8.1-9-any.pkg.tar.zst"
c632877544183def8b19659421c5511b87f8339596e1606bd47608277a0bf427d370aba1732915c2832c91f6d525261623401f145b951ff3015f79ac54179c19
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-libiconv-1.16-1-any.pkg.tar.xz"
ba236e1efc990cb91d459f938be6ca6fc2211be95e888d73f8de301bce55d586f9d2b6be55dacb975ec1afa7952b510906284eff70210238919e341dffbdbeb8
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-10.2.0-1-any.pkg.tar.zst"
113d8b3b155ea537be8b99688d454f781d70c67c810c2643bc02b83b332d99bfbf3a7fcada6b927fda67ef02cf968d4fdf930466c5909c4338bda64f1f3f483e
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz"
d236b815ec3cf569d24d96a386eca9f69a2b1e8af18e96c3f1e5a4d68a3598d32768c7fb3c92207ecffe531259822c1a421350949f2ffabd8ee813654f1af864
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpfr-4.1.0-2-any.pkg.tar.zst"
caac5cb73395082b479597a73c7398bf83009dbc0051755ef15157dc34996e156d4ed7881ef703f9e92861cfcad000888c4c32e4bf38b2596c415a19aafcf893
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gmp-6.2.0-1-any.pkg.tar.xz"
37747f3f373ebff1a493f5dec099f8cd6d5abdc2254d9cd68a103ad7ba44a81a9a97ccaba76eaee427b4d67b2becb655ee2c379c2e563c8051b6708431e3c588
)
set(GETTEXT_PATH ${MSYS_ROOT}/mingw32/bin)
vcpkg_add_to_path(${GETTEXT_PATH})
endif()

Просмотреть файл

@ -13,5 +13,5 @@ Build-Depends: openblas
Description: Use external optimized BLAS
Feature: blas-select
Build-Depends: lapack-reference[core, noblas](!windows|(windows&!static))
Build-Depends: lapack-reference[core, noblas](!windows|!static)
Description: Use external optimized BLAS

Просмотреть файл

@ -113,12 +113,11 @@ if("cblas" IN_LIST FEATURES)
endif()
endif()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
# remove debug includs
# remove debug includes
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
if(VCPKG_TARGET_IS_WINDOWS)

Просмотреть файл

@ -1,5 +1,6 @@
Source: libvpx
Version: 1.9.0
Port-Version: 1
Homepage: https://github.com/webmproject/libvpx
Description: The reference software implementation for the video coding formats VP8 and VP9.
Supports: !(uwp&arm)

Просмотреть файл

@ -18,7 +18,6 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
if(CMAKE_HOST_WIN32)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES make)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils)
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
set(ENV{PATH} "${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;$ENV{PATH};${PERL_EXE_PATH}")
else()

Просмотреть файл

@ -1,6 +1,6 @@
Source: tensorflow-cc
Version: 1.14
Port-Version: 4
Port-Version: 5
Description: Library for computation using data flow graphs for scalable machine learning
Build-Depends: c-ares
Supports: !x86

Просмотреть файл

@ -26,22 +26,21 @@ get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path(PREPEND ${PYTHON3_DIR})
set(ENV{PYTHON_BIN_PATH} "${PYTHON3}")
vcpkg_find_acquire_program(GIT)
get_filename_component(GIT_DIR "${GIT}" DIRECTORY)
vcpkg_add_to_path(PREPEND ${GIT_DIR})
function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE)
file(REMOVE_RECURSE ${PATH_TO_REMOVE})
if (EXISTS "${PATH_TO_REMOVE}")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5)
_execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5)
file(REMOVE_RECURSE ${PATH_TO_REMOVE})
endif()
endfunction()
# we currently only support the release version
tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
file(GLOB SOURCES ${SOURCE_PATH}/*)
file(COPY ${SOURCES} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
if(CMAKE_HOST_WIN32)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES bash unzip patch diffutils libintl gzip coreutils)
vcpkg_add_to_path(${MSYS_ROOT}/usr/bin)
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe)
@ -50,6 +49,11 @@ if(CMAKE_HOST_WIN32)
set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion})
endif()
# we currently only support the release version
tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
file(RENAME ${SOURCE_PATH} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
# tensorflow has long file names, which will not work on windows
set(ENV{TEST_TMPDIR} ${CURRENT_BUILDTREES_DIR}/../.bzl)

Просмотреть файл

@ -1,4 +1,4 @@
Source: vcpkg-gfortran
Version: 1
Version: 3
Description: Metaport to install gfortran dependencies from msys if VCPKG_USE_EXTERNAL_Fortran is false
Supports: windows & !arm

Просмотреть файл

@ -32,22 +32,21 @@ if(VCPKG_USE_INTERNAL_Fortran)
message(FATAL_ERROR "Unsupported target architecture ${VCPKG_TARGET_ARCHITECTURE}!" )
endif()
vcpkg_acquire_msys(MSYS_ROOT PACKAGES "mingw-w64-${MSYS_TARGET}-gcc-fortran") # TODO: make x86 work
set(MINGW_BIN "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/bin/")
set(MINGW_Fortran_DLLS "${MINGW_BIN}/libgfortran-5.dll"
"${MINGW_BIN}/libquadmath-0.dll"
"${MINGW_BIN}/libwinpthread-1.dll"
"${MINGW_BIN}/libgcc_${GCC_LIB_SUFFIX}.dll")
file(INSTALL ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(INSTALL ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
set(MINGW_BIN "${vcpkg_find_fortran_MSYS_ROOT}/mingw${MINGW_W_TARGET}/bin/")
set(MINGW_Fortran_DLLS
"${MINGW_BIN}/libgfortran-5.dll"
"${MINGW_BIN}/libquadmath-0.dll"
"${MINGW_BIN}/libwinpthread-1.dll"
"${MINGW_BIN}/libgcc_${GCC_LIB_SUFFIX}.dll"
)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(COPY ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(COPY ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(COPY "${vcpkg_find_fortran_MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${vcpkg_find_fortran_MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/crt/COPYING.MinGW-w64-runtime.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled) # due to outdated msvcrt
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/winpthreads" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/license")
file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/gcc-libs" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/license")
file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/crt/COPYING.MinGW-w64-runtime.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
else()
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
endif()

Просмотреть файл

@ -4,7 +4,11 @@
##
## ## Usage
## ```cmake
## vcpkg_acquire_msys(<MSYS_ROOT_VAR> [PACKAGES <package>...] [TIMEOUT <seconds>])
## vcpkg_acquire_msys(<MSYS_ROOT_VAR>
## PACKAGES <package>...
## [NO_DEFAULT_PACKAGES]
## [DIRECT_PACKAGES <URL> <SHA512> <URL> <SHA512> ...]
## )
## ```
##
## ## Parameters
@ -14,10 +18,22 @@
## ### PACKAGES
## A list of packages to acquire in msys.
##
## ### TIMEOUT
## Optional timeout to override the default (10 min.) after which installation of PACKAGES is terminated.
## To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.16)`
##
## To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)`
## ### NO_DEFAULT_PACKAGES
## Exclude the normal base packages.
##
## The list of base packages includes: bash, coreutils, sed, grep, gawk, diffutils, make, and pkg-config
##
## ### DIRECT_PACKAGES
## A list of URL/SHA512 pairs to acquire in msys.
##
## This parameter can be used by a port to privately extend the list of msys packages to be acquired.
## The URLs can be found on the msys2 website[1] and should be a direct archive link:
##
## https://repo.msys2.org/mingw/i686/mingw-w64-i686-gettext-0.19.8.1-9-any.pkg.tar.zst
##
## [1] https://packages.msys2.org/search
##
## ## Notes
## A call to `vcpkg_acquire_msys` will usually be followed by a call to `bash.exe`:
@ -39,140 +55,247 @@
## * [libvpx](https://github.com/Microsoft/vcpkg/blob/master/ports/libvpx/portfile.cmake)
function(vcpkg_acquire_msys PATH_TO_ROOT_OUT)
set(TIMESTAMP 20200812)
set(TOOLPATH ${DOWNLOADS}/tools/msys2-${TIMESTAMP})
cmake_parse_arguments(_am "" "TIMEOUT" "PACKAGES" ${ARGN})
cmake_parse_arguments(_am "NO_DEFAULT_PACKAGES" "" "PACKAGES;DIRECT_PACKAGES" ${ARGN})
if(_am_TIMEOUT)
set(TIMEOUT_PACKAGES "TIMEOUT;${_am_TIMEOUT}")
else()
set(TIMEOUT_PACKAGES "TIMEOUT;600")
set(TOTAL_HASH 0)
set(ARCHIVES)
set(PACKAGES ${_am_PACKAGES})
if(NOT _am_NO_DEFAULT_PACKAGES)
list(APPEND PACKAGES bash coreutils sed grep gawk diffutils make pkg-config)
endif()
if(NOT CMAKE_HOST_WIN32)
message(FATAL_ERROR "vcpkg_acquire_msys() can only be used on Windows hosts")
endif()
# detect host architecture
if(DEFINED ENV{PROCESSOR_ARCHITEW6432})
set(_vam_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITEW6432})
else()
set(_vam_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITECTURE})
endif()
if(_vam_HOST_ARCHITECTURE STREQUAL "AMD64")
set(TOOLSUBPATH msys64)
set(URLS
"https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20190524.tar.xz/download"
"https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20190524.tar.xz"
)
set(ARCHIVE "msys2-base-x86_64-20190524.tar.xz")
set(HASH 50796072d01d30cc4a02df0f9dafb70e2584462e1341ef0eff94e2542d3f5173f20f81e8f743e9641b7528ea1492edff20ce83cb40c6e292904905abe2a91ccc)
set(STAMP "initialized-msys2_64.stamp")
else()
set(TOOLSUBPATH msys32)
set(URLS
"https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20190524.tar.xz/download"
"https://repo.msys2.org/distrib/i686/msys2-base-i686-20190524.tar.xz"
)
set(ARCHIVE "msys2-base-i686-20190524.tar.xz")
set(HASH b26d7d432e1eabe2138c4caac5f0a62670f9dab833b9e91ca94b9e13d29a763323b0d30160f09a381ac442b473482dac799be0fea5dd7b28ea2ddd3ba3cd3c25)
set(STAMP "initialized-msys2_32.stamp")
endif()
set(PATH_TO_ROOT ${TOOLPATH}/${TOOLSUBPATH})
if(NOT EXISTS "${TOOLPATH}/${STAMP}")
message(STATUS "Acquiring MSYS2...")
vcpkg_download_distfile(ARCHIVE_PATH
URLS ${URLS}
FILENAME ${ARCHIVE}
SHA512 ${HASH}
)
# download the new keyring, without it new packages and package updates
# might not install
vcpkg_download_distfile(KEYRING_PATH
URLS https://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
SHA512 a5023fd17ccf6364bc6e27c5e63aea25f1fc264a5247cbae4008864c828c38c3e0b4de09ded650e28d2e24e319b5fcf7a9c0da0fa3a8ac81679470fc6bd120c9
)
vcpkg_download_distfile(KEYRING_SIG_PATH
URLS https://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig
FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig
SHA512 c326fefd13f58339afe0d0dc78306aa6ab27cafa8c4d792c2d34aa81fdd1f759d490990ab79daa9664a03a6dfa14ffd2b2ad828bf19a883410112d01f5ed6c4c
)
file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH})
file(MAKE_DIRECTORY ${TOOLPATH})
_execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH}
WORKING_DIRECTORY ${TOOLPATH}
)
_execute_process(
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate"
WORKING_DIRECTORY ${TOOLPATH}
)
# install the new keyring
_execute_process(
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --verify \"${KEYRING_SIG_PATH}\""
WORKING_DIRECTORY ${TOOLPATH}
RESULT_VARIABLE _vam_error_code
)
if(_vam_error_code)
message(FATAL_ERROR "Cannot verify MSYS2 keyring.")
macro(msys_package)
cmake_parse_arguments(p "ZST;ANY" "URL;NAME;SHA512;VERSION;REPO" "DEPS" ${ARGN})
if(p_URL AND NOT p_NAME)
if(NOT p_URL MATCHES "^https://repo\\.msys2\\.org/.*/(([^-]+(-[^0-9][^-]*)*)-.+\\.pkg\\.tar\\.(xz|zst))\$")
message(FATAL_ERROR "Regex does not match supplied URL to vcpkg_acquire_msys: ${p_URL}")
endif()
set(FILENAME "${CMAKE_MATCH_1}")
set(p_NAME "${CMAKE_MATCH_2}")
else()
if(p_ZST)
set(EXT zst)
else()
set(EXT xz)
endif()
if(p_ANY)
set(ARCH any)
else()
set(ARCH x86_64)
endif()
if(NOT p_REPO)
set(p_REPO msys/x86_64)
endif()
set(FILENAME "${p_NAME}-${p_VERSION}-${ARCH}.pkg.tar.${EXT}")
set(p_URL "https://repo.msys2.org/${p_REPO}/${FILENAME}")
endif()
_execute_process(
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -U \"${KEYRING_PATH}\" --noconfirm"
WORKING_DIRECTORY ${TOOLPATH}
)
# we have to kill all GnuPG daemons otherwise bash would potentially not be
# able to start after the core system upgrade, additionally vcpkg would
# likely hang waiting for spawned processes to exit
_execute_process(
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;gpgconf --homedir /etc/pacman.d/gnupg --kill all"
WORKING_DIRECTORY ${TOOLPATH}
)
# we need to update pacman before anything else due to pacman transitioning
# to using zstd packages, and our pacman is too old to support those
_execute_process(
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Sy pacman --noconfirm --disable-download-timeout"
WORKING_DIRECTORY ${TOOLPATH}
TIMEOUT 600
)
# dash relies on specific versions of the base packages, which prevents us
# from doing a proper update. However, we don't need it so we remove it
_execute_process(
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Rc dash --noconfirm"
WORKING_DIRECTORY ${TOOLPATH}
)
_execute_process(
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm --disable-download-timeout"
WORKING_DIRECTORY ${TOOLPATH}
TIMEOUT 600
)
file(WRITE "${TOOLPATH}/${STAMP}" "0")
message(STATUS "Acquiring MSYS2... OK")
if("${p_NAME}" IN_LIST PACKAGES)
list(REMOVE_ITEM PACKAGES "${p_NAME}")
list(APPEND PACKAGES ${p_DEPS})
vcpkg_download_distfile(MSYS_ARCHIVE
URLS "${p_URL}"
SHA512 "${p_SHA512}"
FILENAME "msys-${FILENAME}"
QUIET
)
string(APPEND TOTAL_HASH "${p_SHA512}")
list(APPEND ARCHIVES "${MSYS_ARCHIVE}")
endif()
endmacro()
unset(N)
foreach(P IN LISTS _am_DIRECT_PACKAGES)
if(NOT DEFINED N)
set(N "${P}")
else()
get_filename_component(FILENAME "${N}" NAME)
vcpkg_download_distfile(MSYS_ARCHIVE
URLS "${N}"
SHA512 "${P}"
FILENAME "msys-${FILENAME}"
QUIET
)
string(APPEND TOTAL_HASH "${P}")
list(APPEND ARCHIVES "${MSYS_ARCHIVE}")
unset(N)
endif()
endforeach()
if(DEFINED N)
message(FATAL_ERROR "vcpkg_acquire_msys(... DIRECT_PACKAGES ...) requires exactly pairs of URL/SHA512")
endif()
if(_am_PACKAGES)
message(STATUS "Acquiring MSYS Packages from ${TOOLPATH}...")
string(REPLACE ";" " " _am_PACKAGES "${_am_PACKAGES}")
# To add new entries, use https://packages.msys2.org/package/$PACKAGE?repo=msys
msys_package(
URL "https://repo.msys2.org/msys/x86_64/unzip-6.0-2-x86_64.pkg.tar.xz"
SHA512 b8a1e0ce6deff26939cb46267f80ada0a623b7d782e80873cea3d388b4dc3a1053b14d7565b31f70bc904bf66f66ab58ccc1cd6bfa677065de1f279dd331afb9
DEPS libbz2
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/libbz2-1.0.8-2-x86_64.pkg.tar.xz"
SHA512 d128bd1792d0f5750e6a63a24db86a791e7ee457db8c0bef68d217099be4a6eef27c85caf6ad09b0bcd5b3cdac6fc0a2b9842cc58d381a4035505906cc4803ec
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/patch-2.7.6-1-x86_64.pkg.tar.xz"
SHA512 04d06b9d5479f129f56e8290e0afe25217ffa457ec7bed3e576df08d4a85effd80d6e0ad82bd7541043100799b608a64da3c8f535f8ea173d326da6194902e8c
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/gzip-1.10-1-x86_64.pkg.tar.xz"
SHA512 2d0a60f2c384e3b9e2bed2212867c85333545e51ee0f583a33914e488e43c265ed0017cd4430a6e3dafdca99c0414b3756a4b9cc92a6f04d5566eff8b68def75
DEPS msys2-runtime
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/bash-4.4.023-2-x86_64.pkg.tar.xz"
SHA512 1cf2a07022113010e00e150e7004732013a793d49e7a6ac7c2be27a0b2c0ce3366150584b9974e30df042f8876a84d6a77c1a46f0607e38ebe18f8a25f51c32d
DEPS msys2-runtime
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/autoconf-2.69-5-any.pkg.tar.xz"
SHA512 66b9c97bd3d1dfe2a2ab576235b6b8c204a9e4c099ba14cf5d0139e564bba1e735e3b1083354b4cac8c6c42233cbdd5e1e277e32cadfe24017b94d2fbdeb5617
DEPS m4
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/diffutils-3.7-1-x86_64.pkg.tar.xz"
SHA512 0c39837a26b2111bb6310cdfe0bc14656e3d57456ad8023f59c9386634a8f1f236915c79a57348b64c508897c73ed88d8abce2b9ac512a427e9a3956939f2040
DEPS msys2-runtime
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/binutils-2.34-4-x86_64.pkg.tar.zst"
SHA512 5271288d11489879082bc1f2298bb8bedbcfcf6ee19f8a9b3b552b6a4395543d9385bb833e3c32b1560bff1b411d2be503e2c12a7201bf37b85cfacc5f5baba3
DEPS libiconv libintl
)
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
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/coreutils-8.32-1-x86_64.pkg.tar.xz"
SHA512 1a2ae4f296954421ce36f764b9b1c77ca72fc8583c46060b817677d0ad6adc7d7e3c2bbe1ae0179afd116a3d62f28e59eae2f7c84c1c8ffb7d22d2f2b40c0cdc
DEPS libiconv libintl gmp
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/grep-3.0-2-x86_64.pkg.tar.xz"
SHA512 c784d5f8a929ae251f2ffaccf7ab0b3936ae9f012041e8f074826dd6077ad0a859abba19feade1e71b3289cc640626dfe827afe91c272b38a1808f228f2fdd00
DEPS libiconv libintl libpcre
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/sed-4.8-1-x86_64.pkg.tar.xz"
SHA512 b6e7ed0af9e04aba4992ee26d8616f7ac675c8137bb28558c049d50709afb571b33695ce21d01e5b7fe8e188c008dd2e8cbafc72a7e2a919c2d678506095132b
DEPS libintl
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/libpcre-8.44-1-x86_64.pkg.tar.xz"
SHA512 e9e56386fc5cca0f3c36cee21eda91300d9a13a962ec2f52eeea00f131915daea1cfeb0e1b30704bf3cc4357d941d356e0d72192bab3006c2548e18cd96dad77
DEPS gcc-libs
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/m4-1.4.18-2-x86_64.pkg.tar.xz"
SHA512 061e9243c1e013aa093546e3872984ad47b7fc9d64d4c39dcce62e750ed632645df00be3fe382a2f55f3bf623dd0d649e2092be23e8f22f921f582e41893e36a
DEPS msys2-runtime
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/automake-wrapper-11-1-any.pkg.tar.xz"
SHA512 0fcfc80c31fd0bda5a46c55e9100a86d2fc788a92c7e2ca4fd281e551375c62eb5b9cc9ad9338bb44a815bf0b1d1b60b882c8e68ca3ea529b442f2d03d1d3e1f
DEPS gawk
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/gawk-5.1.0-1-x86_64.pkg.tar.xz"
SHA512 4e2be747b184f27945df6fb37d52d56fd8117d2fe4b289370bcdb5b15a4cf90cbeaea98cf9e64bcbfa2c13db50d8bd14cbd719c5f31b420842da903006dbc959
DEPS libintl libreadline mpfr
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/mpfr-4.1.0-1-x86_64.pkg.tar.zst"
SHA512 d64fa60e188124591d41fc097d7eb51d7ea4940bac05cdcf5eafde951ed1eaa174468f5ede03e61106e1633e3428964b34c96de76321ed8853b398fbe8c4d072
DEPS gmp gcc-libs
)
msys_package(
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/libreadline-8.0.004-1-x86_64.pkg.tar.xz"
SHA512 42760bddedccc8d93507c1e3a7a81595dc6392b5e4319d24a85275eb04c30eb79078e4247eb2cdd00ff3884d932639130c89bf1b559310a17fa4858062491f97
DEPS ncurses
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/ncurses-6.2-1-x86_64.pkg.tar.xz"
SHA512 d4dc566d3dbd32e7646e328cb350689ede7eaa7008c8ed971072f8869a2986fe3935e7df1700851b52716af7ef20c49f9e6628d3163a5e9208a8872b5014eaea
DEPS msys2-runtime
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/automake1.16-1.16.2-1-any.pkg.tar.zst"
SHA512 568d1250a31a53452e029d1c236da66d67fffa786a8713128027d33a6a9408cda6e493e9c1555a816efee6245b05a1ef8f9ce3482c39de71356c2e983d926bf7
DEPS perl
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/automake1.15-1.15.1-1-any.pkg.tar.xz"
SHA512 d5bb245ab1bb6b57c40ef97755bfb0919dcceb0eccc33e848809922bf6b032f9e4eb36d89aedf41542051277d92238bd48a74115867db0bbc1e1db1c975cc72c
DEPS perl
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/perl-5.32.0-1-x86_64.pkg.tar.zst"
SHA512 8acc6c4901bd2e24faf1951084d70029847f05e870826e07b8d9a5d90144f4aa0ab6e568e77c28c36650f016ee75ce78b0356c75673b212c992401f7f1543dd8
DEPS libcrypt
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/libcrypt-2.1-2-x86_64.pkg.tar.xz"
SHA512 59a13f79f560934f880d68209a58a3c39ee4a1d24500035bde90d7a6f6ab0d4f72fe14edea6f19a8eb54d4d53b0b6ad4589b388f1521a07ab24a0f8307619cab
DEPS gcc-libs
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/pkg-config-0.29.2-1-x86_64.pkg.tar.xz"
SHA512 f1d70f0b4ebcfeb3fa2156a7a4f7b0b404795853e05361de14054dc6658a6154915bb982626cbfe76bef0828325f993f30da6817361ca8d7ea440a40023fa864
DEPS libiconv
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/make-4.3-1-x86_64.pkg.tar.xz"
SHA512 7306dec7859edc27d70a24ab4b396728481484a426c5aa2f7e9fed2635b3b25548b05b7d37a161a86a8edaa5922948bee8c99b1e8a078606e69ca48a433fe321
DEPS libintl msys2-runtime
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/libintl-0.19.8.1-1-x86_64.pkg.tar.xz"
SHA512 4e54c252b828c862f376d8f5a2410ee623a43d70cbb07d0b8ac20c25096f59fb3ae8dcd011d1792bec76f0b0b9411d0e184ee23707995761dc50eb76f9fc6b92
DEPS libiconv
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz"
SHA512 6f9b778d449410273a50cdd1af737cdcb8890a5536d78211477eed7382340253c7aadfb04977f1038ae4f4cef5a641f1acfda26fd06323d0b196a3e6da7fd425
DEPS gcc-libs
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/gcc-libs-9.3.0-1-x86_64.pkg.tar.xz"
SHA512 2816afbf45aa0ff47f94a623ad083d9421bca5284dc55683c2f1bc09ea0eadfe720afb75aafef60c2ff6384d051c4fbe2a744bb16a20acf34c04dc59b17c3d8c
DEPS msys2-runtime
)
msys_package(
URL "https://repo.msys2.org/msys/x86_64/msys2-runtime-3.1.6-3-x86_64.pkg.tar.xz"
SHA512 f094a7f4926195ef7ba015f0c5c56587b1faa94d85530f07aaaa5557a1494c3bd75257d4687c8401cbf1328d23e5586a92b05f0a872caebb1a7e941a07829776
)
set(_ENV_ORIGINAL $ENV{PATH})
set(ENV{PATH} ${PATH_TO_ROOT}/usr/bin)
vcpkg_execute_required_process(
ALLOW_IN_DOWNLOAD_MODE
COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -S --noconfirm --disable-download-timeout --needed ${_am_PACKAGES}"
WORKING_DIRECTORY ${TOOLPATH}
LOGNAME msys-pacman-${TARGET_TRIPLET}
${TIMEOUT_PACKAGES}
)
set(ENV{PATH} "${_ENV_ORIGINAL}")
message(STATUS "Acquiring MSYS Packages... OK")
if(PACKAGES)
message(FATAL_ERROR "Unknown packages were required for vcpkg_acquire_msys(${_am_PACKAGES}): ${PACKAGES}\nThis can be resolved by explicitly passing URL/SHA pairs to DIRECT_PACKAGES.")
endif()
string(SHA512 TOTAL_HASH "${TOTAL_HASH}")
string(SUBSTRING "${TOTAL_HASH}" 0 16 TOTAL_HASH)
set(PATH_TO_ROOT ${DOWNLOADS}/tools/msys2/${TOTAL_HASH})
if(NOT EXISTS "${PATH_TO_ROOT}")
file(REMOVE_RECURSE ${PATH_TO_ROOT}.tmp)
file(MAKE_DIRECTORY ${PATH_TO_ROOT}.tmp/tmp)
set(I 0)
foreach(ARCHIVE IN LISTS ARCHIVES)
vcpkg_execute_required_process(
ALLOW_IN_DOWNLOAD_MODE
COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE}
LOGNAME msys-${TARGET_TRIPLET}-${I}
WORKING_DIRECTORY ${PATH_TO_ROOT}.tmp
)
math(EXPR I "${I} + 1")
endforeach()
file(RENAME ${PATH_TO_ROOT}.tmp ${PATH_TO_ROOT})
endif()
message(STATUS "Using msys root at ${DOWNLOADS}/tools/msys2/${TOTAL_HASH}")
set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE)
endfunction()

Просмотреть файл

@ -188,7 +188,7 @@ function(vcpkg_configure_make)
else()
message(FATAL_ERROR "Could not determine method to configure make")
endif()
debug_message("REQUIRES_AUTOGEN:${REQUIRES_AUTOGEN}")
debug_message("REQUIRES_AUTOCONFIG:${REQUIRES_AUTOCONFIG}")
# Backup environment variables
@ -209,7 +209,6 @@ function(vcpkg_configure_make)
_vcpkg_backup_env_variables(INCLUDE LIB LIBPATH)
if(CURRENT_PACKAGES_DIR MATCHES " " OR CURRENT_INSTALLED_DIR MATCHES " ")
# Don't bother with whitespace. The tools will probably fail and I tried very hard trying to make it work (no success so far)!
message(WARNING "Detected whitespace in root directory. Please move the path to one without whitespaces! The required tools do not handle whitespaces correctly and the build will most likely fail")
endif()
@ -218,20 +217,14 @@ function(vcpkg_configure_make)
if (CMAKE_HOST_WIN32)
_vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build=
list(APPEND MSYS_REQUIRE_PACKAGES diffutils
pkg-config
binutils
libtool
gettext
gettext-devel
)
list(APPEND MSYS_REQUIRE_PACKAGES make)
list(APPEND MSYS_REQUIRE_PACKAGES binutils libtool autoconf automake-wrapper automake1.16 m4)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES})
# This inserts msys before system32 (which masks sort.exe and find.exe) but after MSVC (which avoids masking link.exe)
string(REPLACE ";$ENV{SystemRoot}\\System32;" ";${MSYS_ROOT}/usr/share/automake-1.16;${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "$ENV{PATH}")
set(ENV{PATH} "${NEWPATH}")
set(BASH "${MSYS_ROOT}/usr/bin/bash.exe")
if (_csc_AUTOCONFIG)
list(APPEND MSYS_REQUIRE_PACKAGES autoconf
autoconf-archive
automake
m4
)
# --build: the machine you are building on
# --host: the machine you are building for
# --target: the machine that CC will produce binaries for
@ -251,17 +244,6 @@ function(vcpkg_configure_make)
endif()
debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}")
endif()
vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES})
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
set(BASH "${MSYS_ROOT}/usr/bin/bash.exe")
# This is required because PATH contains sort and find from Windows but the MSYS versions are needed
# ${MSYS_ROOT}/urs/bin cannot be prepended to PATH due to other conflicts
file(CREATE_LINK "${MSYS_ROOT}/usr/bin/sort.exe" "${SCRIPTS}/buildsystems/make_wrapper/sort.exe" COPY_ON_ERROR)
file(CREATE_LINK "${MSYS_ROOT}/usr/bin/find.exe" "${SCRIPTS}/buildsystems/make_wrapper/find.exe" COPY_ON_ERROR)
vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there
vcpkg_add_to_path(PREPEND "${MSYS_ROOT}/usr/share/automake-1.16") # Required wrappers are located here (compile ar-lib)
macro(_vcpkg_append_to_configure_environment inoutstring var defaultval)
# Allows to overwrite settings in custom triplets via the environment
@ -420,17 +402,9 @@ function(vcpkg_configure_make)
# Run autoconf if necessary
set(_GENERATED_CONFIGURE FALSE)
if (_csc_AUTOCONFIG OR REQUIRES_AUTOCONFIG)
find_program(AUTORECONF autoreconf REQUIRED)
find_program(AUTORECONF autoreconf)
if(NOT AUTORECONF)
message(STATUS "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")")
endif()
find_program(LIBTOOL libtool REQUIRED)
if(NOT LIBTOOL)
message(STATUS "${PORT} requires libtool from the system package manager (example: \"sudo apt-get install libtool libtool-bin\")")
endif()
find_program(AUTOPOINT autopoint REQUIRED)
if(NOT AUTOPOINT)
message(STATUS "${PORT} requires autopoint from the system package manager (example: \"sudo apt-get install autopoint\")")
message(FATAL_ERROR "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")")
endif()
message(STATUS "Generating configure for ${TARGET_TRIPLET}")
if (CMAKE_HOST_WIN32)
@ -441,7 +415,7 @@ function(vcpkg_configure_make)
)
else()
vcpkg_execute_required_process(
COMMAND autoreconf -vfi
COMMAND ${AUTORECONF} -vfi
WORKING_DIRECTORY "${SRC_DIR}"
LOGNAME autoconf-${TARGET_TRIPLET}
)

Просмотреть файл

@ -28,6 +28,9 @@
##
## If this doesn't match the downloaded version, the build will be terminated with a message describing the mismatch.
##
## ### QUIET
## Suppress output on cache hit
##
## ### SKIP_SHA512
## Skip SHA512 hash check for file.
##
@ -47,7 +50,7 @@
## * [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake)
## * [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake)
function(vcpkg_download_distfile VAR)
set(options SKIP_SHA512 SILENT_EXIT)
set(options SKIP_SHA512 SILENT_EXIT QUIET)
set(oneValueArgs FILENAME SHA512)
set(multipleValuesArgs URLS HEADERS)
cmake_parse_arguments(vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN})
@ -103,7 +106,9 @@ function(vcpkg_download_distfile VAR)
endfunction()
if(EXISTS "${downloaded_file_path}")
message(STATUS "Using cached ${downloaded_file_path}")
if(NOT vcpkg_download_distfile_QUIET)
message(STATUS "Using cached ${downloaded_file_path}")
endif()
test_hash("${downloaded_file_path}" "cached file" "Please delete the file and retry if this file should be downloaded again.")
else()
if(_VCPKG_NO_DOWNLOADS)

Просмотреть файл

@ -23,25 +23,94 @@ function(vcpkg_find_fortran additional_cmake_args_out)
if(WIN32)
message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!")
# If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") # Switching to mingw toolchain
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(MINGW_PATH mingw32)
set(MSYS_TARGET i686)
set(MACHINE_FLAG -m32)
vcpkg_acquire_msys(MSYS_ROOT
DIRECT_PACKAGES
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-fortran-10.2.0-1-any.pkg.tar.zst"
ddbdaf9ea865181e16a0931b2ec88c2dcef8add34628e479c7b9de4fa2ccb22e09c7239442e58702e0acd3adabc920565e976984f2bcd90a3668bf7f48a245f1
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst"
150f355085fcf4c54e8bce8f7f08b90fea9ca7e1f32cff0a2e495faa63cf7723f4bf935f0f4ec77c8dd2ba710ceaed88694cb3da71def5e2088dd65e13c9b002
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-10.2.0-1-any.pkg.tar.zst"
113d8b3b155ea537be8b99688d454f781d70c67c810c2643bc02b83b332d99bfbf3a7fcada6b927fda67ef02cf968d4fdf930466c5909c4338bda64f1f3f483e
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gmp-6.2.0-1-any.pkg.tar.xz"
37747f3f373ebff1a493f5dec099f8cd6d5abdc2254d9cd68a103ad7ba44a81a9a97ccaba76eaee427b4d67b2becb655ee2c379c2e563c8051b6708431e3c588
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
e87ad4f4071c6b5bba3b13a85abf6657bb494b73c57ebe65bc5a92e2cef1d9de354e6858d1338ee72809e3dc742ba69ce090aaad4560ae1d3479a61dbebf03c6
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz"
d236b815ec3cf569d24d96a386eca9f69a2b1e8af18e96c3f1e5a4d68a3598d32768c7fb3c92207ecffe531259822c1a421350949f2ffabd8ee813654f1af864
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpfr-4.1.0-2-any.pkg.tar.zst"
caac5cb73395082b479597a73c7398bf83009dbc0051755ef15157dc34996e156d4ed7881ef703f9e92861cfcad000888c4c32e4bf38b2596c415a19aafcf893
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-10.2.0-1-any.pkg.tar.zst"
3085e744e716301ba8e4c8a391ab09c2d51e587e0a2df5dab49f83b403a32160f8d713cf1a42c1d962885b4c6ee3b6ed36ef40de15c4be2b69dbc3f12f974c3c
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-binutils-2.34-3-any.pkg.tar.zst"
ff06b2adebe6e9b278b63ca5638ff704750a346faad1cdc40089431b0a308edb6f2a131815e0577673a19878ec1bd8d5a4fa592aa227de769496c1fd3aedbc85
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-crt-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
120c943ce173719e48400fa18299f3458bc9db4cf18bb5a4dda8a91cc3f816510b337a92f7388077c65b50bbbeae9078793891ceaad631d780b10fde19ad3649
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-headers-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
dbb9f8258da306a3441f9882faa472c3665a67b2ea68657f3e8a1402dcfacf9787a886a3daf0eefe4946f04557bc166eb15b21c1093ad85c909002daadba1923
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-libiconv-1.16-1-any.pkg.tar.xz"
ba236e1efc990cb91d459f938be6ca6fc2211be95e888d73f8de301bce55d586f9d2b6be55dacb975ec1afa7952b510906284eff70210238919e341dffbdbeb8
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-windows-default-manifest-6.4-3-any.pkg.tar.xz"
5b99abc55eaa74cf85ca64a9c91542554cb5c1098bc71effba9bd36242694cfd348503fcd3507fb9ba97486108c092c925e2f38cd744493386b3dc9ab28bc526
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-zlib-1.2.11-7-any.pkg.tar.xz"
459850a8c42b1d497268736629ef713beee70cd0d3161d02c7a9fad08aca4560f4e17ba02d5cabda8a19d7c614f7e0ef5a6ec13afd91dd3004057139a5469c8f
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-zstd-1.4.5-1-any.pkg.tar.zst"
68f431073717b59549ab0fd26be8df8afcb43f3dd85be2ffcbc7d1a629999eed924656a7fc3f50937b2e6605a5067542d016181106b7bc3408b89b268ced5d23
)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(MINGW_PATH mingw64)
set(MSYS_TARGET x86_64)
set(MACHINE_FLAG -m64)
vcpkg_acquire_msys(MSYS_ROOT
DIRECT_PACKAGES
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-10.2.0-1-any.pkg.tar.zst"
0de02db791e978ae21577e675ee9676f741336c9a5ceb5614dbdfc793e2c1c4749b394f41362af7b069e970302fddf8c6772ebd8445fe1c360861606b1784b4d
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst"
c2dee2957356fa51aae39d907d0cc07f966028b418f74a1ea7ea551ff001c175d86781f980c0cf994207794322dcd369fa122ab78b6c6d0f0ab01e39a754e780
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-1-any.pkg.tar.zst"
d17eff08c83d08ef020d999a2ead0d25036ada1c1bf6ed7c02bad9b56840ee5a3304acd790d86f52b83b09c1e788f0cecdf7254dc6760c3c7e478f65882cd32d
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz"
0b22b7363e27cec706eb79ee0c45b5fe7088a5ca69e0868e7366481ed2ea9b3f6623d340cebba0b5ed3d79e4dfc7cf15f53530eb260c6d4057bfc3d92eb8c7bc
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
a6969a5db1c55ba458c1a047d0a2a9d2db6cc24266ea47f740598b149a601995d2de734a0984ac5e57ee611d5982cbc03fd6fc0f498435e8d6401bf15724caad
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
87ae090a8de855de5580f158f4007f88d6dad341429620685dc736be55b1f060487552040327a76003618e214a11c1f8e5105ca2c7abe164908121627449d679
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz"
db075a1406690935db5780af293660385f56699881a1b2cd25ab252183643d71d646b0dadf1e34174df8f0744d51ce8b56dccd719e049efcaf9b7e08e80a7ef6
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.1.0-2-any.pkg.tar.zst"
14739667242b8852f0d26547eb3297899a51fd1edafc7101b4e7489273e1efb9cb8422fc067361e3c3694c2afcc6c49fc89537f9f811ad5b9b595873112ee890
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.2.0-1-any.pkg.tar.zst"
7a08c7923f688ca8f06d55e1e91b9059a933ee56e27075ea073e6e58ae220310fb5f79869886a61b6987ab08993c9f962a4bfc50b6ea80473e933ce5551f3930
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.34-3-any.pkg.tar.zst"
4efd5586c344802110ea0061867469a23571df88529d66a943f86add1287f85ef53b6a9a9b16af2cb67bd09e0760a6f290c3b04ba70c0d5861d8a9f79f0ac209
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-crt-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
0142e4a44c59d17380a4fc7b101a2152486781621d5f9f930045b8f9c4bb2c93ea88211e7d8f8f233e0ae09595c6c8bc948ae80b9673f231e715b0d04c8a1e54
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-headers-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
b547091a45ea7df8182b627edc9a7c91a23f01c0d4e02634a590c02f24311741cad92ceb67b7e4432ffbe4266f135a5289eb3560cc90ffa5c57612c8537a1588
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-1-any.pkg.tar.xz"
c8e2fda532c753e0b1004596bf737c3669355f32af9b45d96c23fcef14994ba21ddf4f75138bdecc94cbf8a8c449eff530d24b74a0da47793e24ce92d154f411
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz"
77d02121416e42ff32a702e21266ce9031b4d8fc9ecdb5dc049d92570b658b3099b65d167ca156367d17a76e53e172ca52d468e440c2cdfd14701da210ffea37
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-7-any.pkg.tar.xz"
bbd4a549efc2a5f4b1e9f1be00331e8726d80401a9c6117afa9d5dd92f4ac42a06cf2ce491a988e5c6ed7a6e536f8f1746081f4944bc6d473ccd16390fea27fe
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zstd-1.4.5-1-any.pkg.tar.zst"
dc2c7289fb206966829c98f6bf4389b423784415532ca3d627a22ae9d756a4fe2faf9844994b3093d814d129d20b2b79897e702aa9569978f58431ea66b55feb
)
else()
message(FATAL_ERROR "Unknown architecture '${VCPKG_TARGET_ARCHITECTURE}' for MinGW Fortran build!")
endif()
vcpkg_acquire_msys(MSYS_ROOT PACKAGES "mingw-w64-${MSYS_TARGET}-gcc-fortran")
set(MINGW_BIN "${MSYS_ROOT}/${MINGW_PATH}/bin")
vcpkg_add_to_path(PREPEND "${MINGW_BIN}")
list(APPEND ARGS_OUT -DCMAKE_GNUtoMS=ON
"-DCMAKE_Fortran_COMPILER=${MINGW_BIN}/gfortran.exe"
"-DCMAKE_C_COMPILER=${MINGW_BIN}/gcc.exe"
"-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms ${MACHINE_FLAG} ${VCPKG_Fortran_FLAGS}")
# This is for private use by vcpkg-gfortran
set(vcpkg_find_fortran_MSYS_ROOT "${MSYS_ROOT}" PARENT_SCOPE)
set(VCPKG_USE_INTERNAL_Fortran TRUE PARENT_SCOPE)
set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled PARENT_SCOPE)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake" PARENT_SCOPE) # Switching to MinGW toolchain for Fortran
@ -58,4 +127,4 @@ function(vcpkg_find_fortran additional_cmake_args_out)
endif()
endif()
set(${additional_cmake_args_out} ${ARGS_OUT} PARENT_SCOPE)
endfunction()
endfunction()

Просмотреть файл

@ -265,7 +265,6 @@ function(vcpkg_fixup_pkgconfig)
if(NOT _vfpkg_DEBUG_FILES)
file(GLOB_RECURSE _vfpkg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc")
list(FILTER _vfpkg_DEBUG_FILES INCLUDE REGEX "${_vfpkg_ESCAPED_CURRENT_PACKAGES_DIR}/debug/")
endif()
vcpkg_find_acquire_program(PKGCONFIG)
@ -287,9 +286,9 @@ function(vcpkg_fixup_pkgconfig)
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}")
string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}")
string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}")
string(REGEX REPLACE "^prefix[ \t]*=[ \t]*(\")?(\\\\)?\\\${prefix}(\")?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable
string(REGEX REPLACE "[\n]prefix[ \t]*=[ \t]*(\")?(\\\\)?\\\${prefix}(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable
file(WRITE "${_file}" "${_contents}")
string(REGEX REPLACE "^prefix[\t ]*=[^\n]*" "" _contents "${_contents}")
string(REGEX REPLACE "[\n]prefix[\t ]*=[^\n]*" "" _contents "${_contents}")
file(WRITE "${_file}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}\n${_contents}")
unset(PKG_LIB_SEARCH_PATH)
endforeach()
@ -317,10 +316,10 @@ function(vcpkg_fixup_pkgconfig)
string(REPLACE "debug/share" "../share" _contents "${_contents}")
string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}")
string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword
string(REGEX REPLACE "^prefix[ \t]*=[ \t]*(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable
string(REGEX REPLACE "[\n]prefix[ \t]*=[ \t]*(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable
string(REGEX REPLACE "^prefix[\t ]*=[^\n]*" "" _contents "${_contents}") # make pc file relocatable
string(REGEX REPLACE "[\n]prefix[\t ]*=[^\n]*" "" _contents "${_contents}") # make pc file relocatable
string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist.
file(WRITE "${_file}" "${_contents}")
file(WRITE "${_file}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}\n${_contents}")
unset(PKG_LIB_SEARCH_PATH)
endforeach()