[openssl][vcpkg_find_acquire_program] Use msys to provide perl for vcpkg_find_acquire_program. Revert openssl to use this instead of msys directly.

This commit is contained in:
Robert Schumacher 2017-08-01 17:12:59 -07:00
parent ef3acf597a
commit ebc875df58
5 changed files with 21 additions and 32 deletions

View File

@ -25,7 +25,7 @@ vcpkg_find_acquire_program(PERL)
vcpkg_acquire_msys(MSYS_ROOT)
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
set(ENV{PATH} "${PERL_EXE_PATH};${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;$ENV{PATH}")
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")

View File

@ -38,7 +38,7 @@ vcpkg_apply_patches(
# openblas require perl to generate .def for exports
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}")
set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}

View File

@ -29,20 +29,9 @@ include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2l_WinRT)
vcpkg_find_acquire_program(PERL)
vcpkg_find_acquire_program(JOM)
get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY)
vcpkg_acquire_msys(MSYS_ROOT)
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
vcpkg_execute_required_process(
COMMAND ${BASH} --noprofile --norc -c 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed perl'
WORKING_DIRECTORY ${MSYS_ROOT}
LOGNAME pacman-${TARGET_TRIPLET}
)
set(PERL ${MSYS_ROOT}/usr/bin/perl.exe)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH};${JOM_EXE_PATH}")

View File

@ -7,20 +7,10 @@ include(vcpkg_common_functions)
set(OPENSSL_VERSION 1.0.2l)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-${OPENSSL_VERSION})
vcpkg_find_acquire_program(PERL)
vcpkg_find_acquire_program(NASM)
find_program(NMAKE nmake)
vcpkg_acquire_msys(MSYS_ROOT)
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
vcpkg_execute_required_process(
COMMAND ${BASH} --noprofile --norc -c 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed perl'
WORKING_DIRECTORY ${MSYS_ROOT}
LOGNAME pacman-${TARGET_TRIPLET}
)
set(PERL ${MSYS_ROOT}/usr/bin/perl.exe)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
vcpkg_find_acquire_program(JOM)
@ -65,11 +55,11 @@ endif()
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
message(STATUS "Build ${TARGET_TRIPLET}-rel")
file(COPY ${MASTER_COPY_SOURCE_PATH} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/openssl-${OPENSSL_VERSION})
set(OPENSSLDIR_RELEASE ${CURRENT_PACKAGES_DIR})
message(STATUS "Configure ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${CONFIGURE_COMMAND} ${OPENSSL_ARCH} "--prefix=${OPENSSLDIR_RELEASE}" "--openssldir=${OPENSSLDIR_RELEASE}" -FS
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
@ -80,6 +70,9 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SOURCE_PATH_RELEASE}
LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-rel
)
message(STATUS "Configure ${TARGET_TRIPLET}-rel done")
message(STATUS "Build ${TARGET_TRIPLET}-rel")
# Openssl's buildsystem has a race condition which will cause JOM to fail at some point.
# This is ok; we just do as much work as we can in parallel first, then follow up with a single-threaded build.
make_directory(${SOURCE_PATH_RELEASE}/inc32/openssl)
@ -97,7 +90,7 @@ vcpkg_execute_required_process(
message(STATUS "Build ${TARGET_TRIPLET}-rel done")
message(STATUS "Build ${TARGET_TRIPLET}-dbg")
message(STATUS "Configure ${TARGET_TRIPLET}-dbg")
file(COPY ${MASTER_COPY_SOURCE_PATH} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/openssl-${OPENSSL_VERSION})
set(OPENSSLDIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug)
@ -112,6 +105,9 @@ vcpkg_execute_required_process(
WORKING_DIRECTORY ${SOURCE_PATH_DEBUG}
LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE}-dbg
)
message(STATUS "Configure ${TARGET_TRIPLET}-dbg done")
message(STATUS "Build ${TARGET_TRIPLET}-dbg")
make_directory(${SOURCE_PATH_DEBUG}/inc32/openssl)
execute_process(
COMMAND ${JOM} -k -j $ENV{NUMBER_OF_PROCESSORS} -f ${OPENSSL_MAKEFILE}

View File

@ -33,6 +33,7 @@
## * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake)
## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake)
include(vcpkg_acquire_msys)
function(vcpkg_find_acquire_program VAR)
if(${VAR} AND NOT ${VAR} MATCHES "-NOTFOUND")
return()
@ -46,11 +47,14 @@ function(vcpkg_find_acquire_program VAR)
vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT)
if(VAR MATCHES "PERL")
set(PROGNAME perl)
set(PATHS ${DOWNLOADS}/tools/perl/perl/bin)
set(URL "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit-portable.zip")
set(ARCHIVE "strawberry-perl-5.24.1.1-32bit-portable.zip")
set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26)
vcpkg_acquire_msys(MSYS_ROOT)
vcpkg_execute_required_process(
COMMAND ${MSYS_ROOT}/usr/bin/bash.exe --noprofile --norc -c 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed perl'
WORKING_DIRECTORY ${MSYS_ROOT}
LOGNAME acquire-perl-${TARGET_TRIPLET}
)
set(PERL "${MSYS_ROOT}/usr/bin/perl.exe" PARENT_SCOPE)
return()
elseif(VAR MATCHES "NASM")
set(PROGNAME nasm)
set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02)