Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg_find_acquire_program] Cleanup and add CI testing #12982

Merged
Merged
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
170 changes: 94 additions & 76 deletions scripts/cmake/vcpkg_find_acquire_program.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,55 +52,55 @@ function(vcpkg_find_acquire_program VAR)
unset(NOEXTRACT)
unset(_vfa_RENAME)
unset(SUBDIR)
unset(PROG_PATH_SUBDIR)
unset(REQUIRED_INTERPRETER)
unset(_vfa_SUPPORTED)
unset(POST_INSTALL_COMMAND)

vcpkg_get_program_files_platform_bitness(PROGRAM_FILES_PLATFORM_BITNESS)
set(PROGRAM_FILES_32_BIT $ENV{ProgramFiles\(X86\)})
if (NOT DEFINED PROGRAM_FILES_32_BIT)
set(PROGRAM_FILES_32_BIT $ENV{PROGRAMFILES})
endif()
unset(PATHS)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved

if(VAR MATCHES "PERL")
set(PROGNAME perl)
set(PATHS ${DOWNLOADS}/tools/perl/perl/bin)
set(PERL_VERSION 5.30.0.1)
set(SUBDIR ${PERL_VERSION})
set(PATHS ${DOWNLOADS}/tools/perl/${SUBDIR}/perl/bin)
set(BREW_PACKAGE_NAME "perl")
set(APT_PACKAGE_NAME "perl")
set(URL
"https://strawberry.perl.bot/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit.zip"
"http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-32bit.zip"
"https://strawberry.perl.bot/download/${PERL_VERSION}/strawberry-perl-${PERL_VERSION}-32bit.zip"
"http://strawberryperl.com/download/${PERL_VERSION}/strawberry-perl-${PERL_VERSION}-32bit.zip"
)
set(ARCHIVE "strawberry-perl-5.30.0.1-32bit.zip")
set(ARCHIVE "strawberry-perl-${PERL_VERSION}-32bit.zip")
set(HASH d353d3dc743ebdc6d1e9f6f2b7a6db3c387c1ce6c890bae8adc8ae5deae8404f4c5e3cf249d1e151e7256d4c5ee9cd317e6c41f3b6f244340de18a24b938e0c4)
elseif(VAR MATCHES "NASM")
set(PROGNAME nasm)
set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.14.02)
set(NASM_VERSION 2.14.02)
set(PATHS ${DOWNLOADS}/tools/nasm/nasm-${NASM_VERSION})
set(BREW_PACKAGE_NAME "nasm")
set(APT_PACKAGE_NAME "nasm")
set(URL
"https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win32/nasm-2.14.02-win32.zip"
"https://fossies.org/windows/misc/nasm-2.14.02-win32.zip"
"https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/win32/nasm-${NASM_VERSION}-win32.zip"
"https://fossies.org/windows/misc/nasm-${NASM_VERSION}-win32.zip"
)
set(ARCHIVE "nasm-2.14.02-win32.zip")
set(ARCHIVE "nasm-${NASM_VERSION}-win32.zip")
set(HASH a0f16a9f3b668b086e3c4e23a33ff725998e120f2e3ccac8c28293fd4faeae6fc59398919e1b89eed7461685d2730de02f2eb83e321f73609f35bf6b17a23d1e)
elseif(VAR MATCHES "YASM")
set(PROGNAME yasm)
set(YASM_VERSION 1.3.0.6.g1962)
set(SUBDIR 1.3.0.6)
set(PATHS ${DOWNLOADS}/tools/yasm/${SUBDIR})
set(BREW_PACKAGE_NAME "yasm")
set(APT_PACKAGE_NAME "yasm")
set(URL "https://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe")
set(ARCHIVE "yasm-1.3.0.6.g1962.exe")
set(URL "https://www.tortall.net/projects/yasm/snapshots/v${YASM_VERSION}/yasm-${YASM_VERSION}.exe")
set(ARCHIVE "yasm-${YASM_VERSION}.exe")
set(_vfa_RENAME "yasm.exe")
set(NOEXTRACT ON)
set(HASH c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b)
elseif(VAR MATCHES "GIT")
set(PROGNAME git)
if(CMAKE_HOST_WIN32)
set(SUBDIR "git-2.26.2-1-windows")
set(URL "https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe")
set(ARCHIVE "PortableGit-2.26.2-32-bit.7z.exe")
set(GIT_VERSION 2.26.2)
set(SUBDIR "git-${GIT_VERSION}-1-windows")
set(URL "https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/PortableGit-${GIT_VERSION}-32-bit.7z.exe")
set(ARCHIVE "PortableGit-${GIT_VERSION}-32-bit.7z.exe")
set(HASH d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36)
set(PATHS
"${DOWNLOADS}/tools/${SUBDIR}/mingw32/bin"
Expand Down Expand Up @@ -129,29 +129,30 @@ function(vcpkg_find_acquire_program VAR)
set(HASH "263e02bd79eee0cb7b664831b7898565c5656a046328d8f187ef7ae2a4d766991d477b190c9b425fcc960ab76f381cd3e396afb85cba7408ca9e74eb32c175db")
endif()
set(SUBDIR "${GN_VERSION}")
set(PATHS "${DOWNLOADS}/tools/gn/${SUBDIR}")
set(URL "${CIPD_DOWNLOAD_GN}/${GN_PLATFORM}/+/${GN_VERSION}")
set(ARCHIVE "gn-${GN_PLATFORM}.zip")
elseif(VAR MATCHES "GO")
set(PROGNAME go)
set(PATHS ${DOWNLOADS}/tools/go/go/bin)
set(SUBDIR 1.13.1.windows-386)
set(PATHS ${DOWNLOADS}/tools/go/${SUBDIR}/go/bin)
set(BREW_PACKAGE_NAME "go")
set(APT_PACKAGE_NAME "golang-go")
set(URL "https://dl.google.com/go/go1.13.1.windows-386.zip")
set(ARCHIVE "go1.13.1.windows-386.zip")
set(URL "https://dl.google.com/go/go${SUBDIR}.zip")
set(ARCHIVE "go${SUBDIR}.zip")
set(HASH 2ab0f07e876ad98d592351a8808c2de42351ab387217e088bc4c5fa51d6a835694c501e2350802323b55a27dc0157f8b70045597f789f9e50f5ceae50dea3027)
elseif(VAR MATCHES "PYTHON3")
if(CMAKE_HOST_WIN32)
set(PROGNAME python)
set(PYTHON_VERSION 3.8.3)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
set(SUBDIR "python-3.8.3-x86")
set(URL "https://www.python.org/ftp/python/3.8.3/python-3.8.3-embed-win32.zip")
set(ARCHIVE "python-3.8.3-embed-win32.zip")
set(SUBDIR "python-${PYTHON_VERSION}-x86")
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-win32.zip")
set(ARCHIVE "python-${PYTHON_VERSION}-embed-win32.zip")
set(HASH 8c9078f55b1b5d694e0e809eee6ccf8a6e15810dd4649e8ae1209bff30e102d49546ce970a5d519349ca7759d93146f459c316dc440737171f018600255dcd0a)
else()
set(SUBDIR "python-3.8.3-x64")
set(URL "https://www.python.org/ftp/python/3.8.3/python-3.8.3-embed-amd64.zip")
set(ARCHIVE "python-3.8.3-embed-amd64.zip")
set(SUBDIR "python-${PYTHON_VERSION}-x64")
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-amd64.zip")
set(ARCHIVE "python-${PYTHON_VERSION}-embed-amd64.zip")
set(HASH a322fc925167edb1897764297cf47e294ad3f52c109a05f8911412807eb83e104f780e9fe783b17fe0d9b18b7838797c15e9b0805dab759829f77a9bc0159424)
endif()
set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR})
Expand All @@ -164,15 +165,16 @@ function(vcpkg_find_acquire_program VAR)
elseif(VAR MATCHES "PYTHON2")
if(CMAKE_HOST_WIN32)
set(PROGNAME python)
set(PYTHON_VERSION 2.7.16)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
set(SUBDIR "python-2.7.16-x86")
set(URL "https://www.python.org/ftp/python/2.7.16/python-2.7.16.msi")
set(ARCHIVE "python-2.7.16.msi")
set(SUBDIR "python-${PYTHON_VERSION}-x86")
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.msi")
set(ARCHIVE "python-${PYTHON_VERSION}.msi")
set(HASH c34a6fa2438682104dccb53650a2bdb79eac7996deff075201a0f71bb835d60d3ed866652a1931f15a29510fe8e1009ac04e423b285122d2e5747fefc4c10254)
else()
set(SUBDIR "python-2.7.16-x64")
set(URL "https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi")
set(ARCHIVE "python-2.7.16.amd64.msi")
set(SUBDIR "python-${PYTHON_VERSION}-x64")
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.amd64.msi")
set(ARCHIVE "python-${PYTHON_VERSION}.amd64.msi")
set(HASH 47c1518d1da939e3ba6722c54747778b93a44c525bcb358b253c23b2510374a49a43739c8d0454cedade858f54efa6319763ba33316fdc721305bc457efe4ffb)
endif()
set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR})
Expand All @@ -199,40 +201,40 @@ function(vcpkg_find_acquire_program VAR)
set(HASH 5b158ead86be4eb3a6780928d9163f8562372f30bde051d8c281d81027b766119a6e9241166b91de0aa6146836cea77e5121290e62e31b7a959407840fc57b33)
elseif(VAR MATCHES "7Z")
set(PROGNAME 7z)
set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" "${DOWNLOADS}/tools/7z/Files/7-Zip")
set(PATHS "${DOWNLOADS}/tools/7z/Files/7-Zip")
set(URL "https://7-zip.org/a/7z1900.msi")
set(ARCHIVE "7z1900.msi")
set(HASH f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067)
elseif(VAR MATCHES "NINJA")
set(PROGNAME ninja)
set(NINJA_VERSION 1.10.0)
set(SUBDIR "ninja-${NINJA_VERSION}")
set(_vfa_SUPPORTED ON)
if(CMAKE_HOST_WIN32)
set(ARCHIVE "ninja-win-${NINJA_VERSION}.zip")
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-windows")
list(APPEND PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}")
set(SUBDIR "${NINJA_VERSION}-windows")
set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-win.zip")
set(HASH a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(ARCHIVE "ninja-mac-${NINJA_VERSION}.zip")
set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-mac.zip")
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx")
set(SUBDIR "${NINJA_VERSION}-osx")
set(PATHS "${DOWNLOADS}/tools/ninja-${NINJA_VERSION}-osx")
set(HASH 619a1924067a0b30fc5f8887f868d3ee5481838d2f0f158d031f7614a2a10b95a73d4a56b658d5d560283ebf809e2e536b968c6c01ff0108075c3f393f5780ba)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-freebsd")
set(_vfa_SUPPORTED OFF)
else()
set(ARCHIVE "ninja-linux-${NINJA_VERSION}.zip")
set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip")
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux")
set(SUBDIR "${NINJA_VERSION}-linux")
set(PATHS "${DOWNLOADS}/tools/ninja-${NINJA_VERSION}-linux")
set(HASH ffb179ab8ea315167fcc99a8f13286e1363590185b18cf819cc73e09f2a7553790e9dc45fd1ccd0bd1d2dbf543aee3f6c0951cf9ce453a7168ffd2ac873cdd29)
endif()
set(VERSION_CMD --version)
elseif(VAR MATCHES "NUGET")
set(PROGNAME nuget)
set(SUBDIR "5.5.1")
set(PATHS "${DOWNLOADS}/tools/nuget/${SUBDIR}")
set(PATHS "${DOWNLOADS}/tools/nuget-${SUBDIR}-windows")
set(BREW_PACKAGE_NAME "nuget")
set(URL "https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe")
set(_vfa_RENAME "nuget.exe")
Expand Down Expand Up @@ -284,9 +286,10 @@ function(vcpkg_find_acquire_program VAR)
endif()
elseif(VAR MATCHES "GPERF")
set(PROGNAME gperf)
set(GPERF_VERSION 3.0.1)
set(PATHS ${DOWNLOADS}/tools/gperf/bin)
set(URL "https://sourceforge.net/projects/gnuwin32/files/gperf/3.0.1/gperf-3.0.1-bin.zip/download")
set(ARCHIVE "gperf-3.0.1-bin.zip")
set(URL "https://sourceforge.net/projects/gnuwin32/files/gperf/${GPERF_VERSION}/gperf-${GPERF_VERSION}-bin.zip/download")
set(ARCHIVE "gperf-${GPERF_VERSION}-bin.zip")
set(HASH 3f2d3418304390ecd729b85f65240a9e4d204b218345f82ea466ca3d7467789f43d0d2129fcffc18eaad3513f49963e79775b10cc223979540fa2e502fe7d4d9)
elseif(VAR MATCHES "GASPREPROCESSOR")
set(NOEXTRACT true)
Expand All @@ -308,21 +311,23 @@ function(vcpkg_find_acquire_program VAR)
set(HASH 74f0fa29b5991ca655e34a9d1000d47d4272e071113fada86727ee943d913177ae96dc3d435eaf494d2158f37560cd4c2c5274176946ebdb17bf2354ced1c516)
elseif(VAR MATCHES "SCONS")
set(PROGNAME scons)
set(SCONS_VERSION 3.0.1)
set(SUBDIR ${SCONS_VERSION})
set(REQUIRED_INTERPRETER PYTHON2)
set(SCRIPTNAME "scons.py")
set(PATHS ${DOWNLOADS}/tools/scons)
set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download")
set(ARCHIVE "scons-local-3.0.1.zip")
set(URL "https://sourceforge.net/projects/scons/files/scons-local-${SCONS_VERSION}.zip/download")
set(ARCHIVE "scons-local-${SCONS_VERSION}.zip")
set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727)
elseif(VAR MATCHES "SWIG")
set(VERSION 4.0.2)
set(PROGNAME swig)
if(CMAKE_HOST_WIN32)
set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${VERSION}/swigwin-${VERSION}.zip/download")
#set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${VERSION}/swigwin-${VERSION}.zip/download")
set(ARCHIVE "swigwin-${VERSION}.zip")
set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d)
set(SUBDIR "swigwin-${VERSION}")
set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}")
set(SUBDIR b8f105f9b9-f0518bc3b7/swigwin-${VERSION})
#set(SUBDIR "swigwin-${VERSION}")
#set(PATHS "${DOWNLOADS}/tools/swig/swigwin-${VERSION}")
else()
#Not used
set(_vfa_SUPPORTED TRUE)
Expand All @@ -333,7 +338,8 @@ function(vcpkg_find_acquire_program VAR)
set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}")
endif()
set(SOURCEFORGE_ARGS
REPO swig
REPO swig/swigwin
REF swigwin-${VERSION}
FILENAME "${ARCHIVE}"
SHA512 "${HASH}"
NO_REMOVE_ONE_LEVEL
Expand All @@ -342,61 +348,67 @@ function(vcpkg_find_acquire_program VAR)
elseif(VAR MATCHES "DOXYGEN")
set(PROGNAME doxygen)
set(DOXYGEN_VERSION 1.8.17)
set(PATHS ${DOWNLOADS}/tools/doxygen)
set(URL
"https://doxygen.nl/files/doxygen-${DOXYGEN_VERSION}.windows.bin.zip"
"https://sourceforge.net/projects/doxygen/files/rel-${DOXYGEN_VERSION}/doxygen-${DOXYGEN_VERSION}.windows.bin.zip")
set(ARCHIVE "doxygen-${DOXYGEN_VERSION}.windows.bin.zip")
set(HASH 6bac47ec552486783a70cc73b44cf86b4ceda12aba6b52835c2221712bd0a6c845cecec178c9ddaa88237f5a781f797add528f47e4ed017c7888eb1dd2bc0b4b)
set(SOURCEFORGE_ARGS
REPO doxygen
REF rel-${DOXYGEN_VERSION}
FILENAME "doxygen-${DOXYGEN_VERSION}.windows.bin.zip"
SHA512 6bac47ec552486783a70cc73b44cf86b4ceda12aba6b52835c2221712bd0a6c845cecec178c9ddaa88237f5a781f797add528f47e4ed017c7888eb1dd2bc0b4b
NO_REMOVE_ONE_LEVEL
WORKING_DIRECTORY "${DOWNLOADS}/tools/doxygen"
)
set(SUBDIR 6bac47ec55-25c819fd77)
elseif(VAR MATCHES "BAZEL")
set(PROGNAME bazel)
set(BAZEL_VERSION 0.25.2)
set(SUBDIR ${BAZEL_VERSION})
set(PATHS ${DOWNLOADS}/tools/bazel/${SUBDIR})
set(_vfa_RENAME "bazel")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(_vfa_SUPPORTED ON)
set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64")
set(ARCHIVE "bazel-${BAZEL_VERSION}-linux-x86_64")
set(SUBDIR ${BAZEL_VERSION}-linux)
set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64")
set(ARCHIVE "bazel-${SUBDIR}-x86_64")
set(NOEXTRACT ON)
set(HASH db4a583cf2996aeb29fd008261b12fe39a4a5faf0fbf96f7124e6d3ffeccf6d9655d391378e68dd0915bc91c9e146a51fd9661963743857ca25179547feceab1)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(_vfa_SUPPORTED ON)
set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64")
set(ARCHIVE "bazel-${BAZEL_VERSION}-darwin-x86_64")
set(SUBDIR ${BAZEL_VERSION}-darwin)
set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64")
set(ARCHIVE "bazel-${SUBDIR}-x86_64")
set(NOEXTRACT ON)
set(HASH 420a37081e6ee76441b0d92ff26d1715ce647737ce888877980d0665197b5a619d6afe6102f2e7edfb5062c9b40630a10b2539585e35479b780074ada978d23c)
else()
set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip")
set(ARCHIVE "bazel-${BAZEL_VERSION}-windows-x86_64.zip")
set(SUBDIR ${BAZEL_VERSION}-windows)
set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64.zip")
set(ARCHIVE "bazel-${SUBDIR}-x86_64.zip")
set(HASH 6482f99a0896f55ef65739e7b53452fd9c0adf597b599d0022a5e0c5fa4374f4a958d46f98e8ba25af4b065adacc578bfedced483d8c169ea5cb1777a99eea53)
endif()
# Download Tools
elseif(VAR MATCHES "ARIA2")
set(PROGNAME aria2c)
set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-1.34.0-win-32bit-build1)
set(URL "https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0-win-32bit-build1.zip")
set(ARCHIVE "aria2-1.34.0-win-32bit-build1.zip")
set(ARIA2_VERSION 1.34.0)
set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-${ARIA2_VERSION}-win-32bit-build1)
set(URL "https://github.com/aria2/aria2/releases/download/release-${ARIA2_VERSION}/aria2-${ARIA2_VERSION}-win-32bit-build1.zip")
set(ARCHIVE "aria2-${ARIA2_VERSION}-win-32bit-build1.zip")
set(HASH 2a5480d503ac6e8203040c7e516a3395028520da05d0ebf3a2d56d5d24ba5d17630e8f318dd4e3cc2094cc4668b90108fb58e8b986b1ffebd429995058063c27)
elseif(VAR MATCHES "PKGCONFIG")
set(PROGNAME pkg-config)
set(VERSION 0.29.2-1)
set(LIBWINPTHREAD_VERSION git-8.0.0.5906.c9a21571-1)
if(ENV{PKG_CONFIG})
debug_message(STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}")
set(PKGCONFIG $ENV{PKG_CONFIG} PARENT_SCOPE)
return()
elseif(CMAKE_HOST_WIN32)
set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/0.29.2-1")
set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${VERSION}")
set(PKGCONFIG "${PROG_PATH_SUBDIR}/mingw32/bin/pkg-config.exe")
if(NOT EXISTS "${PKGCONFIG}")
vcpkg_download_distfile(PKGCONFIG_ARCHIVE
URLS "https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-0.29.2-1-any.pkg.tar.xz"
URLS "https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-${VERSION}-any.pkg.tar.xz"
SHA512 3b1b706a24d9aef7bbdf3ce4427aaa813ba6fbd292ed9dda181b4300e117c3d59a159ddcca8b013fd01ce76da2d95d590314ff9628c0d68a6966bac4842540f0
FILENAME mingw-w64-i686-pkg-config-0.29.2-1-any.pkg.tar.xz
FILENAME mingw-w64-i686-pkg-config-${VERSION}-any.pkg.tar.xz
)
vcpkg_download_distfile(LIBWINPTHREAD_ARCHIVE
URLS "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
URLS "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-${LIBWINPTHREAD_VERSION}-any.pkg.tar.zst"
SHA512 2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c
FILENAME mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst
FILENAME mingw-w64-i686-libwinpthread-${LIBWINPTHREAD_VERSION}-any.pkg.tar.zst
)
file(REMOVE_RECURSE ${PROG_PATH_SUBDIR} ${PROG_PATH_SUBDIR}.tmp)
file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}.tmp)
Expand Down Expand Up @@ -475,6 +487,13 @@ function(vcpkg_find_acquire_program VAR)
endif()
endmacro()

if(NOT DEFINED PROG_PATH_SUBDIR)
set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}")
endif()
if(DEFINED SUBDIR)
list(APPEND PATHS ${PROG_PATH_SUBDIR})
endif()

do_find()
if(NOT ${VAR})
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT _vfa_SUPPORTED)
Expand All @@ -499,7 +518,6 @@ function(vcpkg_find_acquire_program VAR)
FILENAME ${ARCHIVE}
)

set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}")
file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR})
if(DEFINED NOEXTRACT)
if(DEFINED _vfa_RENAME)
Expand Down
4 changes: 4 additions & 0 deletions scripts/test_ports/vcpkg-find-acquire-program/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Source: vcpkg-find-acquire-program
Version: 0
Description: Test port to exercise vcpkg_find_acquire_program
Supports: windows
Loading