diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-06-13 15:57:50 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-06-29 13:21:12 +1000 |
commit | bc00644e80a204e7578dc4f96a7fcb4316b77076 (patch) | |
tree | 98b3b8314e0c839df28881089b49b39d844f5883 /tools/depends | |
parent | 0e236d958ceba6f893612dd2a6ea881dcc42186c (diff) |
[cmake] create ENABLE_INTERNAL_PCRE
Diffstat (limited to 'tools/depends')
-rw-r--r-- | tools/depends/target/Makefile | 1 | ||||
-rw-r--r-- | tools/depends/target/pcre/001-all-cmakeconfig.patch | 43 | ||||
-rw-r--r-- | tools/depends/target/pcre/002-all-enable_docs_pc.patch | 21 | ||||
-rw-r--r-- | tools/depends/target/pcre/003-all-postfix.patch | 13 | ||||
-rw-r--r-- | tools/depends/target/pcre/004-win-pdb.patch | 21 | ||||
-rw-r--r-- | tools/depends/target/pcre/Makefile | 19 | ||||
-rw-r--r-- | tools/depends/target/pcre/PCRE-VERSION | 1 |
7 files changed, 115 insertions, 4 deletions
diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index d8b5ece2b3..efaa4e5c7e 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -42,7 +42,6 @@ DEPENDS = \ nghttp2 \ openssl \ p8-platform \ - pcre \ python3 \ pythonmodule-pil \ pythonmodule-pycryptodome \ diff --git a/tools/depends/target/pcre/001-all-cmakeconfig.patch b/tools/depends/target/pcre/001-all-cmakeconfig.patch new file mode 100644 index 0000000000..5babbdf597 --- /dev/null +++ b/tools/depends/target/pcre/001-all-cmakeconfig.patch @@ -0,0 +1,43 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -934,7 +934,7 @@ + # Installation + SET(CMAKE_INSTALL_ALWAYS 1) + +-INSTALL(TARGETS ${targets} ++INSTALL(TARGETS ${targets} EXPORT pcre + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +@@ -941,6 +941,27 @@ + + INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include) + ++include(CMakePackageConfigHelpers) ++write_basic_package_version_file( ++ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake ++ VERSION ${PACKAGE_VERSION} ++ COMPATIBILITY AnyNewerVersion ++) ++ ++install(EXPORT pcre ++ NAMESPACE ++ ${PROJECT_NAME}:: ++ DESTINATION ++ lib/cmake/${PROJECT_NAME} ++) ++ ++install(FILES ++ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake ++ DESTINATION ++ lib/cmake/${PROJECT_NAME} ++) ++ + FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html) + FILE(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1) + FILE(GLOB man3 ${PROJECT_SOURCE_DIR}/doc/*.3) +--- /dev/null ++++ b/cmake/PCRE-config.cmake +@@ -0,0 +1 @@ ++include(${CMAKE_CURRENT_LIST_DIR}/pcre.cmake) diff --git a/tools/depends/target/pcre/002-all-enable_docs_pc.patch b/tools/depends/target/pcre/002-all-enable_docs_pc.patch new file mode 100644 index 0000000000..4848e2c783 --- /dev/null +++ b/tools/depends/target/pcre/002-all-enable_docs_pc.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -980,14 +980,18 @@ + SET(man3 ${man3_new}) + ENDIF(PCRE_BUILD_PCRECPP) + ++if(ENABLE_DOCS) + INSTALL(FILES ${man1} DESTINATION man/man1) + INSTALL(FILES ${man3} DESTINATION man/man3) + INSTALL(FILES ${html} DESTINATION share/doc/pcre/html) ++endif() ++if(ENABLE_PKGCONFIG) + INSTALL(FILES ${pc} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/pcre-config" + DESTINATION bin + # Set 0755 permissions + PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) ++endif() + + IF(MSVC AND INSTALL_MSVC_PDB) + INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre.pdb diff --git a/tools/depends/target/pcre/003-all-postfix.patch b/tools/depends/target/pcre/003-all-postfix.patch new file mode 100644 index 0000000000..bfa8ce344d --- /dev/null +++ b/tools/depends/target/pcre/003-all-postfix.patch @@ -0,0 +1,13 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -661,9 +661,7 @@ + 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(CMAKE_DEBUG_POSTFIX "d") + + SET(targets) + diff --git a/tools/depends/target/pcre/004-win-pdb.patch b/tools/depends/target/pcre/004-win-pdb.patch new file mode 100644 index 0000000000..2815ca2559 --- /dev/null +++ b/tools/depends/target/pcre/004-win-pdb.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -969,12 +969,14 @@ + PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + + IF(MSVC AND INSTALL_MSVC_PDB) +- INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre.pdb +- ${PROJECT_BINARY_DIR}/pcreposix.pdb ++ INSTALL(FILES ${PROJECT_BINARY_DIR}/$<CONFIG>/pcre.pdb ++ ${PROJECT_BINARY_DIR}/$<CONFIG>/pcrecpp.pdb ++ ${PROJECT_BINARY_DIR}/$<CONFIG>/pcreposix.pdb + DESTINATION bin + CONFIGURATIONS RelWithDebInfo) +- INSTALL(FILES ${PROJECT_BINARY_DIR}/pcred.pdb +- ${PROJECT_BINARY_DIR}/pcreposixd.pdb ++ INSTALL(FILES ${PROJECT_BINARY_DIR}/$<CONFIG>/pcred.pdb ++ ${PROJECT_BINARY_DIR}/$<CONFIG>/pcrecppd.pdb ++ ${PROJECT_BINARY_DIR}/$<CONFIG>/pcreposixd.pdb + DESTINATION bin + CONFIGURATIONS Debug) + ENDIF(MSVC AND INSTALL_MSVC_PDB) diff --git a/tools/depends/target/pcre/Makefile b/tools/depends/target/pcre/Makefile index 48273b9fda..26fc932852 100644 --- a/tools/depends/target/pcre/Makefile +++ b/tools/depends/target/pcre/Makefile @@ -1,17 +1,26 @@ include ../../Makefile.include PCRE-VERSION ../../download-files.include -DEPS = ../../Makefile.include Makefile PCRE-VERSION tvos-bitcode-fix.patch jit_aarch64.patch ios-clear_cache.patch ../../download-files.include +DEPS = ../../Makefile.include Makefile PCRE-VERSION ../../download-files.include \ + 001-all-cmakeconfig.patch \ + 002-all-enable_docs_pc.patch \ + 003-all-postfix.patch \ + 004-win-pdb.patch \ + jit_aarch64.patch \ + ios-clear_cache.patch \ + tvos-bitcode-fix.patch # configuration settings CMAKE_OPTIONS=-DPCRE_NEWLINE=ANYCRLF \ -DPCRE_NO_RECURSE=ON \ + -DPCRE_MATCH_LIMIT_RECURSION=1500 \ -DPCRE_SUPPORT_JIT=ON \ -DPCRE_SUPPORT_PCREGREP_JIT=ON \ -DPCRE_SUPPORT_UTF=ON \ -DPCRE_SUPPORT_UNICODE_PROPERTIES=ON \ + -DPCRE_SUPPORT_LIBZ=OFF \ + -DPCRE_SUPPORT_LIBBZ2=OFF \ -DPCRE_BUILD_PCREGREP=OFF \ -DPCRE_BUILD_TESTS=OFF \ - -DPCRE_SUPPORT_LIBZ=OFF \ - -DPCRE_SUPPORT_LIBBZ2=OFF + -DCMAKE_BUILD_TYPE=Release ifeq ($(OS),android) # CMake CheckFunctionExists incorrectly detects strtoq for android @@ -26,6 +35,10 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) $(DEPS) rm -rf $(PLATFORM); mkdir -p $(PLATFORM) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); mkdir -p build + cd $(PLATFORM); patch -p1 -i ../001-all-cmakeconfig.patch + cd $(PLATFORM); patch -p1 -i ../002-all-enable_docs_pc.patch + cd $(PLATFORM); patch -p1 -i ../003-all-postfix.patch + cd $(PLATFORM); patch -p1 -i ../004-win-pdb.patch cd $(PLATFORM); patch -p1 -i ../tvos-bitcode-fix.patch cd $(PLATFORM); patch -p1 -i ../jit_aarch64.patch cd $(PLATFORM); patch -p1 -i ../ios-clear_cache.patch diff --git a/tools/depends/target/pcre/PCRE-VERSION b/tools/depends/target/pcre/PCRE-VERSION index a14dc5a583..af533d2bc2 100644 --- a/tools/depends/target/pcre/PCRE-VERSION +++ b/tools/depends/target/pcre/PCRE-VERSION @@ -3,3 +3,4 @@ VERSION=8.45 ARCHIVE=$(LIBNAME)-$(VERSION).tar.bz2 SHA512=91bff52eed4a2dfc3f3bfdc9c672b88e7e2ffcf3c4b121540af8a4ae8c1ce05178430aa6b8000658b9bb7b4252239357250890e20ceb84b79cdfcde05154061a BYPRODUCT=libpcre.a +BYPRODUCT_WIN=pcre.lib |