diff options
Diffstat (limited to 'vcpkg/ports/pcre')
7 files changed, 332 insertions, 0 deletions
diff --git a/vcpkg/ports/pcre/export-cmake-targets.patch b/vcpkg/ports/pcre/export-cmake-targets.patch new file mode 100644 index 0000000..bdbd807 --- /dev/null +++ b/vcpkg/ports/pcre/export-cmake-targets.patch @@ -0,0 +1,23 @@ +--- a/CMakeLists.txt 2021-06-14 10:33:38.000000000 +0200
++++ b/CMakeLists.txt 2021-06-18 18:08:24.162881000 +0200
+@@ -934,10 +934,19 @@
+ # Installation
+ SET(CMAKE_INSTALL_ALWAYS 1)
+
+-INSTALL(TARGETS ${targets}
++foreach(target ${targets})
++ INSTALL(TARGETS ${target}
++ EXPORT pcre-targets
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ target_include_directories(${target} PUBLIC $<INSTALL_INTERFACE:include>)
++endforeach()
++
++INSTALL(EXPORT pcre-targets
++ NAMESPACE unofficial::pcre::
++ FILE unofficial-pcre-targets.cmake
++ DESTINATION "share/unofficial-pcre")
+
+ INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)
+
diff --git a/vcpkg/ports/pcre/pcre-8.4.5_fix_check_function_exists_for_arm-androi_builds.patch b/vcpkg/ports/pcre/pcre-8.4.5_fix_check_function_exists_for_arm-androi_builds.patch new file mode 100644 index 0000000..d854d63 --- /dev/null +++ b/vcpkg/ports/pcre/pcre-8.4.5_fix_check_function_exists_for_arm-androi_builds.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c3a309..cdd480f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -94,7 +94,7 @@ FIND_PACKAGE( Editline ) + + INCLUDE(CheckIncludeFile) + INCLUDE(CheckIncludeFileCXX) +-INCLUDE(CheckFunctionExists) ++INCLUDE(CheckSymbolExists) + INCLUDE(CheckTypeSize) + INCLUDE(GNUInstallDirs) # for CMAKE_INSTALL_LIBDIR + +@@ -109,12 +109,12 @@ CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H) + CHECK_INCLUDE_FILE_CXX(type_traits.h HAVE_TYPE_TRAITS_H) + CHECK_INCLUDE_FILE_CXX(bits/type_traits.h HAVE_BITS_TYPE_TRAITS_H) + +-CHECK_FUNCTION_EXISTS(bcopy HAVE_BCOPY) +-CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE) +-CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR) +-CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL) +-CHECK_FUNCTION_EXISTS(strtoq HAVE_STRTOQ) +-CHECK_FUNCTION_EXISTS(_strtoi64 HAVE__STRTOI64) ++CHECK_SYMBOL_EXISTS(bcopy strings.h HAVE_BCOPY) ++CHECK_SYMBOL_EXISTS(memmove string.h HAVE_MEMMOVE) ++CHECK_SYMBOL_EXISTS(strerror string.h HAVE_STRERROR) ++CHECK_SYMBOL_EXISTS(strtoll stdlib.h HAVE_STRTOLL) ++CHECK_SYMBOL_EXISTS(strtoq stdlib.h HAVE_STRTOQ) ++CHECK_SYMBOL_EXISTS(_strtoi64 stdlib.h HAVE__STRTOI64) + + CHECK_TYPE_SIZE("long long" LONG_LONG) + CHECK_TYPE_SIZE("unsigned long long" UNSIGNED_LONG_LONG) diff --git a/vcpkg/ports/pcre/pcre-8.45_fix_postfix_for_debug_Windows_builds.patch b/vcpkg/ports/pcre/pcre-8.45_fix_postfix_for_debug_Windows_builds.patch new file mode 100644 index 0000000..bd9c9b4 --- /dev/null +++ b/vcpkg/ports/pcre/pcre-8.45_fix_postfix_for_debug_Windows_builds.patch @@ -0,0 +1,161 @@ +Index: CMakeLists.txt +=================================================================== +--- CMakeLists.txt (revision 1767) ++++ CMakeLists.txt (working copy) +@@ -436,6 +436,12 @@ + @ONLY) + ENDIF(PCRE_BUILD_PCRECPP) + ++# Make sure to not link debug libs ++# against release libs and vice versa ++IF(WIN32) ++ SET(CMAKE_DEBUG_POSTFIX "d") ++ENDIF(WIN32) ++ + # Generate pkg-config files + SET(PACKAGE_VERSION "${PCRE_MAJOR}.${PCRE_MINOR}") + SET(prefix "${CMAKE_INSTALL_PREFIX}") +@@ -442,6 +448,9 @@ + SET(exec_prefix "\${prefix}") + SET(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") + SET(includedir "\${prefix}/include") ++IF(WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug)) ++ SET(LIB_POSTFIX ${CMAKE_DEBUG_POSTFIX}) ++ENDIF() + IF(NOT BUILD_SHARED_LIBS) + SET(PCRE_STATIC_CFLAG "-DPCRE_STATIC") + ENDIF(NOT BUILD_SHARED_LIBS) +@@ -659,11 +668,6 @@ + ENDIF(MSVC) + + SET(CMAKE_INCLUDE_CURRENT_DIR 1) +-# needed to make sure to not link debug libs +-# against release libs and vice versa +-IF(WIN32) +- SET(CMAKE_DEBUG_POSTFIX "d") +-ENDIF(WIN32) + + SET(targets) + +Index: configure.ac +=================================================================== +--- configure.ac (revision 1767) ++++ configure.ac (working copy) +@@ -1044,6 +1044,9 @@ + AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"]) + + # Produce these files, in addition to config.h. ++# LIB_POSTFIX is used by CMakeLists.txt for Windows debug builds. ++# Pass empty LIB_POSTFIX to *.pc files and pcre-config here. ++AC_SUBST(LIB_POSTFIX) + AC_CONFIG_FILES( + Makefile + libpcre.pc +Index: libpcre.pc.in +=================================================================== +--- libpcre.pc.in (revision 1767) ++++ libpcre.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcre + Description: PCRE - Perl compatible regular expressions C library with 8 bit character support + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre ++Libs: -L${libdir} -lpcre@LIB_POSTFIX@ + Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ + Cflags: -I${includedir} @PCRE_STATIC_CFLAG@ +Index: libpcre16.pc.in +=================================================================== +--- libpcre16.pc.in (revision 1767) ++++ libpcre16.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcre16 + Description: PCRE - Perl compatible regular expressions C library with 16 bit character support + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre16 ++Libs: -L${libdir} -lpcre16@LIB_POSTFIX@ + Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ + Cflags: -I${includedir} @PCRE_STATIC_CFLAG@ +Index: libpcre32.pc.in +=================================================================== +--- libpcre32.pc.in (revision 1767) ++++ libpcre32.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcre32 + Description: PCRE - Perl compatible regular expressions C library with 32 bit character support + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre32 ++Libs: -L${libdir} -lpcre32@LIB_POSTFIX@ + Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ + Cflags: -I${includedir} @PCRE_STATIC_CFLAG@ +Index: libpcrecpp.pc.in +=================================================================== +--- libpcrecpp.pc.in (revision 1767) ++++ libpcrecpp.pc.in (working copy) +@@ -8,5 +8,5 @@ + Name: libpcrecpp + Description: PCRECPP - C++ wrapper for PCRE + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcre -lpcrecpp ++Libs: -L${libdir} -lpcre@LIB_POSTFIX@ -lpcrecpp@LIB_POSTFIX@ + Cflags: -I${includedir} @PCRE_STATIC_CFLAG@ +Index: libpcreposix.pc.in +=================================================================== +--- libpcreposix.pc.in (revision 1767) ++++ libpcreposix.pc.in (working copy) +@@ -8,6 +8,6 @@ + Name: libpcreposix + Description: PCREPosix - Posix compatible interface to libpcre + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lpcreposix ++Libs: -L${libdir} -lpcreposix@LIB_POSTFIX@ + Cflags: -I${includedir} @PCRE_STATIC_CFLAG@ + Requires.private: libpcre +Index: pcre-config.in +=================================================================== +--- pcre-config.in (revision 1767) ++++ pcre-config.in (working copy) +@@ -91,7 +91,7 @@ + ;; + --libs-posix) + if test @enable_pcre8@ = yes ; then +- echo $libS$libR -lpcreposix -lpcre ++ echo $libS$libR -lpcreposix@LIB_POSTFIX@ -lpcre@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi +@@ -98,7 +98,7 @@ + ;; + --libs) + if test @enable_pcre8@ = yes ; then +- echo $libS$libR -lpcre ++ echo $libS$libR -lpcre@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi +@@ -105,7 +105,7 @@ + ;; + --libs16) + if test @enable_pcre16@ = yes ; then +- echo $libS$libR -lpcre16 ++ echo $libS$libR -lpcre16@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi +@@ -112,7 +112,7 @@ + ;; + --libs32) + if test @enable_pcre32@ = yes ; then +- echo $libS$libR -lpcre32 ++ echo $libS$libR -lpcre32@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi +@@ -119,7 +119,7 @@ + ;; + --libs-cpp) + if test @enable_cpp@ = yes ; then +- echo $libS$libR -lpcrecpp -lpcre ++ echo $libS$libR -lpcrecpp@LIB_POSTFIX@ -lpcre@LIB_POSTFIX@ + else + echo "${usage}" 1>&2 + fi diff --git a/vcpkg/ports/pcre/pcre-8.45_suppress_cmake_and_compiler_warnings-errors.patch b/vcpkg/ports/pcre/pcre-8.45_suppress_cmake_and_compiler_warnings-errors.patch new file mode 100644 index 0000000..59dbc8b --- /dev/null +++ b/vcpkg/ports/pcre/pcre-8.45_suppress_cmake_and_compiler_warnings-errors.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt 2021-06-14 10:33:38.000000000 +0200 ++++ b/CMakeLists.txt 2021-06-18 17:59:59.155148900 +0200 +@@ -77,7 +77,6 @@ + # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. + + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) +-CMAKE_POLICY(SET CMP0026 OLD) + + # For FindReadline.cmake. This was changed to allow setting CMAKE_MODULE_PATH + # on the command line. +@@ -199,6 +198,7 @@ + ENDIF(MINGW) + + IF(MSVC) ++ add_definitions(/wd4703 /wd4146 /wd4308) + OPTION(PCRE_STATIC_RUNTIME + "ON=Compile against the static runtime (/MT)." + OFF) diff --git a/vcpkg/ports/pcre/portfile.cmake b/vcpkg/ports/pcre/portfile.cmake new file mode 100644 index 0000000..2e66096 --- /dev/null +++ b/vcpkg/ports/pcre/portfile.cmake @@ -0,0 +1,79 @@ +set(PCRE_VERSION 8.45) +set(EXPECTED_SHA 71f246c0abbf356222933ad1604cab87a1a2a3cd8054a0b9d6deb25e0735ce9f40f923d14cbd21f32fdac7283794270afcb0f221ad24662ac35934fcb73675cd) +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.45_suppress_cmake_and_compiler_warnings-errors.patch + # Modified for 8.45 from https://bugs.exim.org/show_bug.cgi?id=2600 + pcre-8.45_fix_postfix_for_debug_Windows_builds.patch + export-cmake-targets.patch + pcre-8.4.5_fix_check_function_exists_for_arm-androi_builds.patch) + +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO pcre/pcre + REF ${PCRE_VERSION} + FILENAME "pcre-${PCRE_VERSION}.zip" + SHA512 ${EXPECTED_SHA} + PATCHES ${PATCHES} +) + +set(IS_PCRE_SUPPORT_JIT YES) +if(VCPKG_TARGET_ARCHITECTURE MATCHES "(loongarch|^s390)") + set(IS_PCRE_SUPPORT_JIT NO) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DPCRE_BUILD_TESTS=NO + -DPCRE_BUILD_PCREGREP=NO + -DPCRE_BUILD_PCRE32=YES + -DPCRE_BUILD_PCRE16=YES + -DPCRE_BUILD_PCRE8=YES + -DPCRE_SUPPORT_JIT=${IS_PCRE_SUPPORT_JIT} + -DPCRE_SUPPORT_UTF=YES + -DPCRE_SUPPORT_UNICODE_PROPERTIES=YES + # optional dependencies for PCREGREP + -DPCRE_SUPPORT_LIBBZ2=OFF + -DPCRE_SUPPORT_LIBZ=OFF + -DPCRE_SUPPORT_LIBEDIT=OFF + -DPCRE_SUPPORT_LIBREADLINE=OFF + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME "unofficial-${PORT}" CONFIG_PATH "share/unofficial-${PORT}") + +foreach(FILE "${CURRENT_PACKAGES_DIR}/include/pcre.h" "${CURRENT_PACKAGES_DIR}/include/pcreposix.h") + file(READ ${FILE} PCRE_H) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(PCRE_STATIC)" "1" PCRE_H "${PCRE_H}") + else() + string(REPLACE "defined(PCRE_STATIC)" "0" PCRE_H "${PCRE_H}") + endif() + file(WRITE ${FILE} "${PCRE_H}") +endforeach() + +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/man") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/man") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc") + +file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/pcre-config" "${CURRENT_PACKAGES_DIR}/debug/bin/pcre-config") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +vcpkg_copy_pdbs() +configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-pcre-config.cmake" "${CURRENT_PACKAGES_DIR}/share/unofficial-pcre/unofficial-pcre-config.cmake" @ONLY) + +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/pcre/unofficial-pcre-config.cmake b/vcpkg/ports/pcre/unofficial-pcre-config.cmake new file mode 100644 index 0000000..edf30b9 --- /dev/null +++ b/vcpkg/ports/pcre/unofficial-pcre-config.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/unofficial-pcre-targets.cmake")
diff --git a/vcpkg/ports/pcre/vcpkg.json b/vcpkg/ports/pcre/vcpkg.json new file mode 100644 index 0000000..060ae49 --- /dev/null +++ b/vcpkg/ports/pcre/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "pcre", + "version": "8.45", + "port-version": 7, + "description": "Perl Compatible Regular Expressions", + "homepage": "https://www.pcre.org/", + "license": null, + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |