Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/maintainers/vcpkg_acquire_msys.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ports/ffmpeg/CONTROL
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 2 additions & 1 deletion ports/ffnvcodec/CONTROL
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 2 additions & 1 deletion ports/icu/CONTROL
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions ports/libpq/CONTROL
Original file line number Diff line number Diff line change
@@ -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/
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion ports/libvpx/CONTROL
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 2 additions & 2 deletions ports/tensorflow-cc/CONTROL
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion ports/tool-meson/CONTROL
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions ports/tool-msys/CONTROL
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions ports/tool-msys/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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)
21 changes: 18 additions & 3 deletions scripts/cmake/vcpkg_acquire_msys.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -99,10 +114,10 @@ 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}" "0")
file(WRITE "${TOOLPATH}/${STAMP}" "${PORT_VERSION}")
message(STATUS "Acquiring MSYS2... OK")
endif()

Expand All @@ -114,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}
)
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ namespace vcpkg::Build
std::vector<System::CMakeVariable> 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()},
Expand Down