From c6c8d5db10eac9829e9e990029d18fa2cdf905a5 Mon Sep 17 00:00:00 2001 From: emptyVoid Date: Fri, 19 Jun 2020 15:32:50 +0300 Subject: [PATCH 1/4] [vcpkg] Provide portfiles with the port version. --- toolsrc/src/vcpkg/build.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 2c79f71ce9d831..bbe45068ef5c45 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -376,6 +376,7 @@ namespace vcpkg::Build std::vector variables{ {"CMD", "BUILD"}, {"PORT", scf.core_paragraph->name}, + {"PORT_VERSION", scf.core_paragraph->version}, {"CURRENT_PORT_DIR", scfl.source_location}, {"TARGET_TRIPLET", triplet.canonical_name()}, {"TARGET_TRIPLET_FILE", paths.get_triplet_file_path(triplet).u8string()}, From 873fa5ded321b52ecbd1356b23e8e2ff58c99cf4 Mon Sep 17 00:00:00 2001 From: emptyVoid Date: Sun, 21 Jun 2020 13:40:22 +0300 Subject: [PATCH 2/4] Add tool-msys metaport to update MSYS2 and rebuilt the dependent ports. --- docs/maintainers/vcpkg_acquire_msys.md | 4 ++++ ports/tool-msys/CONTROL | 5 +++++ ports/tool-msys/portfile.cmake | 7 +++++++ scripts/cmake/vcpkg_acquire_msys.cmake | 17 ++++++++++++++++- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 ports/tool-msys/CONTROL create mode 100644 ports/tool-msys/portfile.cmake diff --git a/docs/maintainers/vcpkg_acquire_msys.md b/docs/maintainers/vcpkg_acquire_msys.md index 4dc8f53917e285..ac102c7d671017 100644 --- a/docs/maintainers/vcpkg_acquire_msys.md +++ b/docs/maintainers/vcpkg_acquire_msys.md @@ -29,6 +29,10 @@ vcpkg_execute_required_process( ) ``` +### Modifying vcpkg_acquire_msys +A change to `vcpkg_acquire_msys` should be accompanied by an increment of `tool-msys` port's version. +This ensures all the MSYS2 dependent ports are built with the same MSYS2 environment. + ## Examples * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) diff --git a/ports/tool-msys/CONTROL b/ports/tool-msys/CONTROL new file mode 100644 index 00000000000000..0ee57a7085746d --- /dev/null +++ b/ports/tool-msys/CONTROL @@ -0,0 +1,5 @@ +Source: tool-msys +Version: 2019-05-24 +Homepage: https://www.msys2.org/ +Description: MSYS2 software distro and building platform for Windows +Supports: windows diff --git a/ports/tool-msys/portfile.cmake b/ports/tool-msys/portfile.cmake new file mode 100644 index 00000000000000..00aa296f0c0622 --- /dev/null +++ b/ports/tool-msys/portfile.cmake @@ -0,0 +1,7 @@ +# This port represents a dependency on the MSYS2 build system. +# In the future, it is expected that this port acquires and installs MSYS2. +# Currently it is used to update MSYS2 installation and to rebuild the ports using vcpkg_acquire_msys. + +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_acquire_msys(MSYS_ROOT) diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 8fa6a6d662651c..239ae4acee7151 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -29,6 +29,10 @@ ## ) ## ``` ## +## ### Modifying vcpkg_acquire_msys +## A change to `vcpkg_acquire_msys` should be accompanied by an increment of `tool-msys` port's version. +## This ensures all the MSYS2 dependent ports are built with the same MSYS2 environment. +## ## ## Examples ## ## * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) @@ -72,7 +76,18 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(PATH_TO_ROOT ${TOOLPATH}/${TOOLSUBPATH}) + # the version of tool-msys port specifies "an epoch" of MSYS2 installation + if(EXISTS "${TOOLPATH}/${STAMP}" AND PORT STREQUAL tool-msys) + file(READ "${TOOLPATH}/${STAMP}" _vam_VERSION) + if(NOT _vam_VERSION STREQUAL PORT_VERSION) + file(REMOVE_RECURSE "${TOOLPATH}") + endif() + endif() + if(NOT EXISTS "${TOOLPATH}/${STAMP}") + if(NOT PORT STREQUAL tool-msys) + message(FATAL_ERROR "vcpkg_acquire_msys() depends on tool-msys -- add 'tool-msys (windows)' to port's build dependencies") + endif() message(STATUS "Acquiring MSYS2...") vcpkg_download_distfile(ARCHIVE_PATH @@ -102,7 +117,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm" WORKING_DIRECTORY ${TOOLPATH} ) - file(WRITE "${TOOLPATH}/${STAMP}" "0") + file(WRITE "${TOOLPATH}/${STAMP}" "${PORT_VERSION}") message(STATUS "Acquiring MSYS2... OK") endif() From a80a6b2a2dfa5023632818f3b2f12b468a111ca7 Mon Sep 17 00:00:00 2001 From: emptyVoid Date: Sun, 21 Jun 2020 14:02:22 +0300 Subject: [PATCH 3/4] [vcpkg-acquire-msys] Cache packages in vcpkg downloads directory. --- scripts/cmake/vcpkg_acquire_msys.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 239ae4acee7151..75ea2cf9b73914 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -114,7 +114,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) WORKING_DIRECTORY ${TOOLPATH} ) _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm" + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm --cachedir \"${DOWNLOADS}\"" WORKING_DIRECTORY ${TOOLPATH} ) file(WRITE "${TOOLPATH}/${STAMP}" "${PORT_VERSION}") @@ -129,7 +129,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) 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 --needed ${_am_PACKAGES}" + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -S --noconfirm --cachedir \"${DOWNLOADS}\" --needed ${_am_PACKAGES}" WORKING_DIRECTORY ${TOOLPATH} LOGNAME msys-pacman-${TARGET_TRIPLET} ) From d6e181a049e8a7599c048f3f962bbfa08abfdaca Mon Sep 17 00:00:00 2001 From: emptyVoid Date: Sun, 21 Jun 2020 14:05:54 +0300 Subject: [PATCH 4/4] Add tool-msys dependency to ports using vcpkg_acquire_msys. --- ports/ffmpeg/CONTROL | 4 ++-- ports/ffnvcodec/CONTROL | 3 ++- ports/icu/CONTROL | 3 ++- ports/libpq/CONTROL | 4 ++-- ports/libvpx/CONTROL | 3 ++- ports/tensorflow-cc/CONTROL | 4 ++-- ports/tool-meson/CONTROL | 3 ++- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 2b85582d503c24..76f17f9c9e2e3c 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,6 +1,6 @@ Source: ffmpeg -Version: 4.2-10 -Build-Depends: zlib +Version: 4.2-11 +Build-Depends: zlib, tool-msys (windows) 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. diff --git a/ports/ffnvcodec/CONTROL b/ports/ffnvcodec/CONTROL index 5779ec9e3dd385..796562e284a1b6 100644 --- a/ports/ffnvcodec/CONTROL +++ b/ports/ffnvcodec/CONTROL @@ -1,4 +1,5 @@ Source: ffnvcodec -Version: 9.1.23.1 +Version: 9.1.23.1-1 Homepage: https://github.com/FFmpeg/nv-codec-headers Description: FFmpeg version of Nvidia Codec SDK headers. +Build-Depends: tool-msys (windows) diff --git a/ports/icu/CONTROL b/ports/icu/CONTROL index e1427b39b61d25..6b464eb0c6d2c6 100644 --- a/ports/icu/CONTROL +++ b/ports/icu/CONTROL @@ -1,5 +1,6 @@ Source: icu -Version: 67.1 +Version: 67.1-1 Homepage: http://icu-project.org/apiref/icu4c/ Description: Mature and widely used Unicode and localization library. +Build-Depends: tool-msys (windows) Supports: !(arm|uwp) diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index b4e4abcfe1cbc6..a0f04cf4d163c7 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,5 +1,5 @@ Source: libpq -Version: 12.2-2 +Version: 12.2-3 Build-Depends: libpq[bonjour] (osx) Supports: !uwp Homepage: https://www.postgresql.org/ @@ -35,7 +35,7 @@ Build-Depends: tcl, libpq[core,client] Description: build the PL/Tcl procedural language(dynamic only?) (--with-tcl) Feature: nls -Build-Depends: gettext +Build-Depends: gettext, tool-msys (windows) Description: Native Language Support (--enable-nls[=LANGUAGES]) Feature: kerberos diff --git a/ports/libvpx/CONTROL b/ports/libvpx/CONTROL index bc79a7e6694262..1f42f5a01c241c 100644 --- a/ports/libvpx/CONTROL +++ b/ports/libvpx/CONTROL @@ -1,5 +1,6 @@ Source: libvpx -Version: 1.8.1-6 +Version: 1.8.1-7 Homepage: https://github.com/webmproject/libvpx Description: The reference software implementation for the video coding formats VP8 and VP9. +Build-Depends: tool-msys (windows) Supports: !(uwp&arm) \ No newline at end of file diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 60c30234666f35..931b867384cdf9 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,5 +1,5 @@ Source: tensorflow-cc -Version: 1.14-2 +Version: 1.14-3 Description: Library for computation using data flow graphs for scalable machine learning -Build-Depends: c-ares +Build-Depends: c-ares, tool-msys (windows) Supports: !x86 diff --git a/ports/tool-meson/CONTROL b/ports/tool-meson/CONTROL index 483508089e66e3..964f5a28eee57c 100644 --- a/ports/tool-meson/CONTROL +++ b/ports/tool-meson/CONTROL @@ -1,4 +1,5 @@ Source: tool-meson -Version: 0.54.2 +Version: 0.54.2-1 Homepage: https://github.com/mesonbuild/meson Description: Meson build system +Build-Depends: tool-msys (windows)