diff options
| author | Jacob Zhong <cmpute@qq.com> | 2018-02-24 16:00:51 +0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-02-24 00:00:51 -0800 |
| commit | 63901137f66ec90f4a51070bd53a2d7433b4b54a (patch) | |
| tree | e52b6c07eaa92c1ad2d21b7f62da9595a78f02e1 | |
| parent | c55ccbf146f6aeaba158f58614578906ae3f01ab (diff) | |
| download | vcpkg-63901137f66ec90f4a51070bd53a2d7433b4b54a.tar.gz vcpkg-63901137f66ec90f4a51070bd53a2d7433b4b54a.zip | |
Add doxygen and add packages option to vcpkg_require_msys (#2869)
* Add doxygen to acquired programs
* Add packages option to msys function
* Add documentation for PACKAGES in vcpkg_require_msys
* [ffmpeg][x264] Update to use `PACKAGES` parameter. Tweak docs.
| -rw-r--r-- | docs/maintainers/vcpkg_acquire_msys.md | 20 | ||||
| -rw-r--r-- | ports/ffmpeg/build.sh | 1 | ||||
| -rw-r--r-- | ports/ffmpeg/portfile.cmake | 14 | ||||
| -rw-r--r-- | ports/icu/portfile.cmake | 7 | ||||
| -rw-r--r-- | ports/libvpx/portfile.cmake | 10 | ||||
| -rw-r--r-- | ports/x264/portfile.cmake | 7 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_acquire_msys.cmake | 41 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_find_acquire_program.cmake | 6 |
8 files changed, 45 insertions, 61 deletions
diff --git a/docs/maintainers/vcpkg_acquire_msys.md b/docs/maintainers/vcpkg_acquire_msys.md index 53aa6532e..4dc8f5391 100644 --- a/docs/maintainers/vcpkg_acquire_msys.md +++ b/docs/maintainers/vcpkg_acquire_msys.md @@ -4,13 +4,18 @@ Download and prepare an MSYS2 instance. ## Usage ```cmake -vcpkg_acquire_msys(<MSYS_ROOT_VAR>) +vcpkg_acquire_msys(<MSYS_ROOT_VAR> [PACKAGES <package>...]) ``` ## Parameters ### MSYS_ROOT_VAR An out-variable that will be set to the path to MSYS2. +### PACKAGES +A list of packages to acquire in msys. + +To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)` + ## Notes A call to `vcpkg_acquire_msys` will usually be followed by a call to `bash.exe`: ```cmake @@ -23,19 +28,6 @@ vcpkg_execute_required_process( LOGNAME build-${TARGET_TRIPLET}-rel ) ``` -To ensure a package is available: -```cmake -vcpkg_acquire_msys(MSYS_ROOT) -set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) - -message(STATUS "Installing MSYS Packages") -vcpkg_execute_required_process( - COMMAND - ${BASH} --noprofile --norc -c - 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed make' - WORKING_DIRECTORY ${MSYS_ROOT} - LOGNAME pacman-${TARGET_TRIPLET}) -``` ## Examples diff --git a/ports/ffmpeg/build.sh b/ports/ffmpeg/build.sh index eea05c959..048d9ec08 100644 --- a/ports/ffmpeg/build.sh +++ b/ports/ffmpeg/build.sh @@ -8,7 +8,6 @@ fi if [ "$HTTPS_PROXY" ]; then export https_proxy=$HTTPS_PROXY fi -pacman -Sy --noconfirm --needed diffutils make PATH_TO_BUILD_DIR="`cygpath "$1"`" PATH_TO_SRC_DIR="`cygpath "$2"`" diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 9e969bf6c..56b467685 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -17,7 +17,11 @@ vcpkg_find_acquire_program(YASM) get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}") -vcpkg_acquire_msys(MSYS_ROOT) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make) +else() + vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make) +endif() set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}") @@ -45,14 +49,6 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY) set(ENV{PATH} "$ENV{PATH};${GAS_ITEM_PATH}") endforeach(GAS_PATH) - - ## Get Perl and GCC for MSYS2 - vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c 'PATH=/usr/bin:\$PATH;pacman -Sy --noconfirm --needed perl gcc' - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} - LOGNAME msys-${TARGET_TRIPLET} - ) - elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") else() diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 11637b061..dcf9efda5 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -15,7 +15,7 @@ vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable-escapestr-tool.patch)
# Acquire tools
-vcpkg_acquire_msys(MSYS_ROOT)
+vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)
# 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}")
@@ -23,11 +23,6 @@ string(REPLACE ";$ENV{SystemRoot}\\System32;" ";${MSYS_ROOT}/usr/bin;$ENV{System set(ENV{PATH} "${NEWPATH}")
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
-vcpkg_execute_required_process(
- COMMAND ${BASH} --noprofile --norc -c "pacman -Sy --noconfirm --needed make automake1.15"
- WORKING_DIRECTORY "${MSYS_ROOT}"
- LOGNAME "pacman-${TARGET_TRIPLET}")
-
set(AUTOMAKE_DIR ${MSYS_ROOT}/usr/share/automake-1.15)
file(COPY ${AUTOMAKE_DIR}/config.guess ${AUTOMAKE_DIR}/config.sub DESTINATION ${SOURCE_PATH}/source)
diff --git a/ports/libvpx/portfile.cmake b/ports/libvpx/portfile.cmake index f7e36b5a8..31630332a 100644 --- a/ports/libvpx/portfile.cmake +++ b/ports/libvpx/portfile.cmake @@ -22,20 +22,12 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_find_acquire_program(YASM) vcpkg_find_acquire_program(PERL) -vcpkg_acquire_msys(MSYS_ROOT) +vcpkg_acquire_msys(MSYS_ROOT PACKAGES make) get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;$ENV{PATH};${PERL_EXE_PATH}") set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) -message(STATUS "Installing MSYS Packages") -vcpkg_execute_required_process( - COMMAND - ${BASH} --noprofile --norc -c - "pacman -Sy --noconfirm --needed make" - WORKING_DIRECTORY ${MSYS_ROOT} - LOGNAME pacman-${TARGET_TRIPLET}) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) if(VCPKG_CRT_LINKAGE STREQUAL static) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index a6115f8d1..b9dbfa34d 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -11,18 +11,13 @@ vcpkg_from_github( ) # Acquire tools -vcpkg_acquire_msys(MSYS_ROOT) +vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15) # 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}") set(ENV{PATH} "${NEWPATH}") set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) -vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc -c "pacman -Sy --noconfirm --needed make automake1.15" - WORKING_DIRECTORY "${MSYS_ROOT}" - LOGNAME "pacman-${TARGET_TRIPLET}") - set(AUTOMAKE_DIR ${MSYS_ROOT}/usr/share/automake-1.15) #file(COPY ${AUTOMAKE_DIR}/config.guess ${AUTOMAKE_DIR}/config.sub DESTINATION ${SOURCE_PATH}/source) diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 80a30bf2b..ab0f4d047 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -4,13 +4,18 @@ ## ## ## Usage ## ```cmake -## vcpkg_acquire_msys(<MSYS_ROOT_VAR>) +## vcpkg_acquire_msys(<MSYS_ROOT_VAR> [PACKAGES <package>...]) ## ``` ## ## ## Parameters ## ### MSYS_ROOT_VAR ## An out-variable that will be set to the path to MSYS2. ## +## ### PACKAGES +## A list of packages to acquire in msys. +## +## To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)` +## ## ## Notes ## A call to `vcpkg_acquire_msys` will usually be followed by a call to `bash.exe`: ## ```cmake @@ -23,19 +28,6 @@ ## LOGNAME build-${TARGET_TRIPLET}-rel ## ) ## ``` -## To ensure a package is available: -## ```cmake -## vcpkg_acquire_msys(MSYS_ROOT) -## set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) -## -## message(STATUS "Installing MSYS Packages") -## vcpkg_execute_required_process( -## COMMAND -## ${BASH} --noprofile --norc -c -## 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed make' -## WORKING_DIRECTORY ${MSYS_ROOT} -## LOGNAME pacman-${TARGET_TRIPLET}) -## ``` ## ## ## Examples ## @@ -45,6 +37,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(TOOLPATH ${DOWNLOADS}/tools/msys2) + cmake_parse_arguments(_am "" "" "PACKAGES" ${ARGN}) # detect host architecture if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) @@ -85,16 +78,32 @@ 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:\$PATH;pacman-key --init;pacman-key --populate" + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin:\$PATH;pacman -Syu --noconfirm" + 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") message(STATUS "Acquiring MSYS2... OK") endif() + if(_am_PACKAGES) + message(STATUS "Acquiring MSYS Packages...") + string(REPLACE ";" " " _am_PACKAGES "${_am_PACKAGES}") + + set(_ENV_ORIGINAL $ENV{PATH}) + set(ENV{PATH} ${PATH_TO_ROOT}/usr/bin) + vcpkg_execute_required_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -Sy --noconfirm --needed ${_am_PACKAGES}" + WORKING_DIRECTORY ${TOOLPATH} + LOGNAME msys-pacman-${TARGET_TRIPLET} + ) + set(ENV{PATH} "${_ENV_ORIGINAL}") + + message(STATUS "Acquiring MSYS Packages... OK") + endif() + set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 1e6979bad..b24345021 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -159,6 +159,12 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download") set(ARCHIVE "scons-local-3.0.1.zip") set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) + elseif(VAR MATCHES "DOXYGEN") + set(PROGNAME doxygen) + set(PATHS ${DOWNLOADS}/tools/doxygen) + set(URL "http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.14.windows.bin.zip") + set(ARCHIVE "doxygen-1.8.14.windows.bin.zip") + set(HASH d0d706501e7112045b1f401f22d12a2c8d9b7728edee9ad1975a17dff914c16494ae48a70beab6f6304643779935843f268c7afed3b9da7d403b5cb11cac0c50) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() |
