Skip to content

Commit

Permalink
[pcre] Use vcpkg_from_sourceforge as a fallback (#12252)
Browse files Browse the repository at this point in the history
* [pcre] Use vcpkg_from_sourceforge as a fallback

* Update ports/pcre/CONTROL

Co-authored-by: Jack·Boos·Yu <[email protected]>
  • Loading branch information
BillyONeal and JackBoosY authored Jul 6, 2020
1 parent e82e56f commit 2a233a2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
3 changes: 2 additions & 1 deletion ports/pcre/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: pcre
Version: 8.44-4
Version: 8.44
Port-Version: 5
Homepage: https://www.pcre.org/
Description: Perl Compatible Regular Expressions
35 changes: 24 additions & 11 deletions ports/pcre/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
set(PCRE_VERSION 8.44)
set(EXPECTED_SHA adddec1236b25ff1c90e73835c2ba25d60a5839cbde2d6be7838a8ec099f7443dede931dc39002943243e21afea572eda71ee8739058e72235a192e4324398f0)
set(PATCHES
# Fix CMake Deprecation Warning concerning OLD behavior for policy CMP0026
# Suppress MSVC compiler warnings C4703, C4146, C4308, which fixes errors
# under x64-uwp and arm-uwp
pcre-8.44_suppress_cmake_and_compiler_warnings-errors.patch)

vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.pcre.org/pub/pcre/pcre-${PCRE_VERSION}.zip"
"https://downloads.sourceforge.net/project/pcre/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.zip"
FILENAME "pcre-${PCRE_VERSION}.zip"
SHA512 adddec1236b25ff1c90e73835c2ba25d60a5839cbde2d6be7838a8ec099f7443dede931dc39002943243e21afea572eda71ee8739058e72235a192e4324398f0
SHA512 ${EXPECTED_SHA}
SILENT_EXIT
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
# Fix CMake Deprecation Warning concerning OLD behavior for policy CMP0026
# Suppress MSVC compiler warnings C4703, C4146, C4308, which fixes errors
# under x64-uwp and arm-uwp
pcre-8.44_suppress_cmake_and_compiler_warnings-errors.patch
)
if (EXISTS "${ARCHIVE}")
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES ${PATCHES}
)
else()
vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO pcre/pcre
REF ${PCRE_VERSION}
FILENAME "pcre-${PCRE_VERSION}.zip"
SHA512 ${EXPECTED_SHA}
PATCHES ${PATCHES}
)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
Expand Down

0 comments on commit 2a233a2

Please sign in to comment.