diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2024-06-22 13:12:58 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-22 13:12:58 +1000 |
commit | dd5e45a881e5582c0a10db1072a215b69772e41e (patch) | |
tree | 779d2ae1f55b577dcd65606007e0e3f371dd13d6 /tools | |
parent | 2a5b3508e31c95a06b1b77af0490d8b0313dbd9e (diff) | |
parent | 8e0c4fd22a0b1f9c54b0536960752263f0d5a04f (diff) |
Merge pull request #25296 from fuzzard/pcre2
Migrate from PCRE to PCRE2
Diffstat (limited to 'tools')
-rw-r--r-- | tools/buildsteps/freebsd/configure-xbmc | 2 | ||||
-rw-r--r-- | tools/buildsteps/windows/download-dependencies.bat | 6 | ||||
-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 | 19 | ||||
-rw-r--r-- | tools/depends/target/pcre/Makefile | 60 | ||||
-rw-r--r-- | tools/depends/target/pcre/PCRE-VERSION | 6 | ||||
-rw-r--r-- | tools/depends/target/pcre/ios-clear_cache.patch | 20 | ||||
-rw-r--r-- | tools/depends/target/pcre/jit_aarch64.patch | 11 | ||||
-rw-r--r-- | tools/depends/target/pcre/tvos-bitcode-fix.patch | 19 | ||||
-rw-r--r-- | tools/depends/target/pcre2/001-all-enable_docs_pc.patch | 18 | ||||
-rw-r--r-- | tools/depends/target/pcre2/002-all-cmake-config-installdir.patch | 11 | ||||
-rw-r--r-- | tools/depends/target/pcre2/Makefile | 46 | ||||
-rw-r--r-- | tools/depends/target/pcre2/PCRE2-VERSION | 7 |
15 files changed, 88 insertions, 214 deletions
diff --git a/tools/buildsteps/freebsd/configure-xbmc b/tools/buildsteps/freebsd/configure-xbmc index 1044b688a6..b6c2260902 100644 --- a/tools/buildsteps/freebsd/configure-xbmc +++ b/tools/buildsteps/freebsd/configure-xbmc @@ -4,4 +4,4 @@ XBMC_PLATFORM_DIR=freebsd mkdir -p $WORKSPACE/build cd $WORKSPACE/build -cmake -DCMAKE_BUILD_TYPE=$Configuration -DENABLE_INTERNAL_PCRE=ON -DAPP_RENDER_SYSTEM=gl .. +cmake -DCMAKE_BUILD_TYPE=$Configuration -DAPP_RENDER_SYSTEM=gl .. diff --git a/tools/buildsteps/windows/download-dependencies.bat b/tools/buildsteps/windows/download-dependencies.bat index 697c616751..6a509c3eee 100644 --- a/tools/buildsteps/windows/download-dependencies.bat +++ b/tools/buildsteps/windows/download-dependencies.bat @@ -9,6 +9,10 @@ POPD SET TARGETPLATFORM=%1 SET NATIVEPLATFORM=%2 +REM Build tools location. We may want to add an extra folder for HOST ARCH +REM if we want end up having build tools other than win32 arch +SET HOST_BUILDTOOLS=tools + IF "%TARGETPLATFORM%" == "" SET TARGETPLATFORM=win32 IF "%NATIVEPLATFORM%" == "" SET NATIVEPLATFORM=win32 @@ -22,7 +26,7 @@ echo Downloading from mirror %KODI_MIRROR% REM Locate the BuildDependencies directory, based on the path of this script SET BUILD_DEPS_PATH=%WORKSPACE%\project\BuildDependencies SET APP_PATH=%WORKSPACE%\project\BuildDependencies\%TARGETPLATFORM% -SET NATIVE_PATH=%WORKSPACE%\project\BuildDependencies\%NATIVEPLATFORM% +SET NATIVE_PATH=%WORKSPACE%\project\BuildDependencies\%HOST_BUILDTOOLS% SET TMP_PATH=%BUILD_DEPS_PATH%\scripts\tmp REM Change to the BuildDependencies directory, if we're not there already diff --git a/tools/depends/target/pcre/001-all-cmakeconfig.patch b/tools/depends/target/pcre/001-all-cmakeconfig.patch deleted file mode 100644 index 5babbdf597..0000000000 --- a/tools/depends/target/pcre/001-all-cmakeconfig.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- 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 deleted file mode 100644 index 4848e2c783..0000000000 --- a/tools/depends/target/pcre/002-all-enable_docs_pc.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- 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 deleted file mode 100644 index bfa8ce344d..0000000000 --- a/tools/depends/target/pcre/003-all-postfix.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- 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 deleted file mode 100644 index 7c1fb26c74..0000000000 --- a/tools/depends/target/pcre/004-win-pdb.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -969,12 +969,12 @@ - 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>/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>/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 deleted file mode 100644 index 679a6c058b..0000000000 --- a/tools/depends/target/pcre/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -include ../../Makefile.include PCRE-VERSION ../../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_PCRECPP=OFF \ - -DPCRE_BUILD_PCREGREP=OFF \ - -DPCRE_BUILD_TESTS=OFF \ - -DCMAKE_BUILD_TYPE=Release - -ifeq ($(OS),android) - # CMake CheckFunctionExists incorrectly detects strtoq for android - CMAKE_OPTIONS+= -DHAVE_STRTOQ=0 -endif - -LIBDYLIB=$(PLATFORM)/build/$(BYPRODUCT) - -all: .installed-$(PLATFORM) - -$(PLATFORM): $(DEPS) | $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) - 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 - cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. - -$(LIBDYLIB): $(PLATFORM) - $(MAKE) -C $(PLATFORM)/build - -.installed-$(PLATFORM): $(LIBDYLIB) - $(MAKE) -C $(PLATFORM)/build install - touch $@ - -clean: - $(MAKE) -C $(PLATFORM)/build clean - rm -f .installed-$(PLATFORM) - -distclean:: - rm -rf $(PLATFORM) .installed-$(PLATFORM) diff --git a/tools/depends/target/pcre/PCRE-VERSION b/tools/depends/target/pcre/PCRE-VERSION deleted file mode 100644 index af533d2bc2..0000000000 --- a/tools/depends/target/pcre/PCRE-VERSION +++ /dev/null @@ -1,6 +0,0 @@ -LIBNAME=pcre -VERSION=8.45 -ARCHIVE=$(LIBNAME)-$(VERSION).tar.bz2 -SHA512=91bff52eed4a2dfc3f3bfdc9c672b88e7e2ffcf3c4b121540af8a4ae8c1ce05178430aa6b8000658b9bb7b4252239357250890e20ceb84b79cdfcde05154061a -BYPRODUCT=libpcre.a -BYPRODUCT_WIN=pcre.lib diff --git a/tools/depends/target/pcre/ios-clear_cache.patch b/tools/depends/target/pcre/ios-clear_cache.patch deleted file mode 100644 index 53d83c0990..0000000000 --- a/tools/depends/target/pcre/ios-clear_cache.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/sljit/sljitConfigInternal.h -+++ b/sljit/sljitConfigInternal.h -@@ -279,12 +279,16 @@ - #define SLJIT_API_FUNC_ATTRIBUTE - #endif /* (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC) */ - -+#if defined(__APPLE__) -+#include <libkern/OSCacheControl.h> -+#endif -+ - /****************************/ - /* Instruction cache flush. */ - /****************************/ - - #if (!defined SLJIT_CACHE_FLUSH && defined __has_builtin) --#if __has_builtin(__builtin___clear_cache) -+#if __has_builtin(__builtin___clear_cache) && !defined(__APPLE__) - - #define SLJIT_CACHE_FLUSH(from, to) \ - __builtin___clear_cache((char*)from, (char*)to) diff --git a/tools/depends/target/pcre/jit_aarch64.patch b/tools/depends/target/pcre/jit_aarch64.patch deleted file mode 100644 index ce7a90504c..0000000000 --- a/tools/depends/target/pcre/jit_aarch64.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/sljit/sljitConfigInternal.h -+++ b/sljit/sljitConfigInternal.h -@@ -320,7 +320,7 @@ - #define SLJIT_CACHE_FLUSH(from, to) \ - __builtin___clear_cache((char*)from, (char*)to) - --#elif defined __ANDROID__ -+#elif (defined __ANDROID__ && !defined SLJIT_CONFIG_ARM_64) - - /* Android lacks __clear_cache; instead, cacheflush should be used. */ - diff --git a/tools/depends/target/pcre/tvos-bitcode-fix.patch b/tools/depends/target/pcre/tvos-bitcode-fix.patch deleted file mode 100644 index 8b217fb45c..0000000000 --- a/tools/depends/target/pcre/tvos-bitcode-fix.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/ltmain.sh -+++ b/ltmain.sh -@@ -10427,16 +10427,6 @@ - - case $host in - *-*-darwin*) -- # Don't allow lazy linking, it breaks C++ global constructors -- # But is supposedly fixed on 10.4 or later (yay!). -- if test CXX = "$tagname"; then -- case ${MACOSX_DEPLOYMENT_TARGET-10.0} in -- 10.[0123]) -- func_append compile_command " $wl-bind_at_load" -- func_append finalize_command " $wl-bind_at_load" -- ;; -- esac -- fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` diff --git a/tools/depends/target/pcre2/001-all-enable_docs_pc.patch b/tools/depends/target/pcre2/001-all-enable_docs_pc.patch new file mode 100644 index 0000000000..ad6fc0cb7c --- /dev/null +++ b/tools/depends/target/pcre2/001-all-enable_docs_pc.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1095,6 +1095,7 @@ + configure_file(${PCRE2_CONFIG_VERSION_IN} ${PCRE2_CONFIG_VERSION_OUT} @ONLY) + install(FILES ${PCRE2_CONFIG_OUT} ${PCRE2_CONFIG_VERSION_OUT} DESTINATION cmake) + ++if(ENABLE_DOCS) + 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) +@@ -1102,6 +1103,7 @@ + INSTALL(FILES ${man1} DESTINATION man/man1) + INSTALL(FILES ${man3} DESTINATION man/man3) + INSTALL(FILES ${html} DESTINATION share/doc/pcre2/html) ++endif() + + IF(MSVC AND INSTALL_MSVC_PDB) + INSTALL(FILES ${dll_pdb_files} DESTINATION bin CONFIGURATIONS RelWithDebInfo) diff --git a/tools/depends/target/pcre2/002-all-cmake-config-installdir.patch b/tools/depends/target/pcre2/002-all-cmake-config-installdir.patch new file mode 100644 index 0000000000..21fb412681 --- /dev/null +++ b/tools/depends/target/pcre2/002-all-cmake-config-installdir.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1093,7 +1093,7 @@ + set(PCRE2_CONFIG_VERSION_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/pcre2-config-version.cmake.in) + set(PCRE2_CONFIG_VERSION_OUT ${CMAKE_CURRENT_BINARY_DIR}/cmake/pcre2-config-version.cmake) + configure_file(${PCRE2_CONFIG_VERSION_IN} ${PCRE2_CONFIG_VERSION_OUT} @ONLY) +-install(FILES ${PCRE2_CONFIG_OUT} ${PCRE2_CONFIG_VERSION_OUT} DESTINATION cmake) ++install(FILES ${PCRE2_CONFIG_OUT} ${PCRE2_CONFIG_VERSION_OUT} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) + + if(ENABLE_DOCS) + FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html) diff --git a/tools/depends/target/pcre2/Makefile b/tools/depends/target/pcre2/Makefile new file mode 100644 index 0000000000..936deef691 --- /dev/null +++ b/tools/depends/target/pcre2/Makefile @@ -0,0 +1,46 @@ +include ../../Makefile.include PCRE2-VERSION ../../download-files.include +DEPS = ../../Makefile.include Makefile PCRE2-VERSION ../../download-files.include \ + 001-all-enable_docs_pc.patch \ + 002-all-cmake-config-installdir.patch + +# configuration settings +CMAKE_OPTIONS=-DBUILD_STATIC_LIBS=ON \ + -DPCRE2_BUILD_PCRE2_8=ON \ + -DPCRE2_BUILD_PCRE2_16=OFF \ + -DPCRE2_BUILD_PCRE2_32=OFF \ + -DPCRE2_SUPPORT_JIT=ON \ + -DPCRE2_SUPPORT_UNICODE=ON \ + -DPCRE2_BUILD_PCRE2GREP=OFF \ + -DPCRE2_BUILD_TESTS=OFF \ + -DENABLE_DOCS=OFF + +ifeq ($(OS),darwin_embedded) + # build default is off, look to see if we want to enable this for non darwin_embedded platforms + CMAKE_OPTIONS+= -DPCRE2_SUPPORT_JIT=OFF +endif + +LIBDYLIB=$(PLATFORM)/build/$(BYPRODUCT) + +all: .installed-$(PLATFORM) + +$(PLATFORM): $(DEPS) | $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) + 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-enable_docs_pc.patch + cd $(PLATFORM); patch -p1 -i ../002-all-cmake-config-installdir.patch + cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) .. + +$(LIBDYLIB): $(PLATFORM) + $(MAKE) -C $(PLATFORM)/build + +.installed-$(PLATFORM): $(LIBDYLIB) + $(MAKE) -C $(PLATFORM)/build install + touch $@ + +clean: + $(MAKE) -C $(PLATFORM)/build clean + rm -f .installed-$(PLATFORM) + +distclean:: + rm -rf $(PLATFORM) .installed-$(PLATFORM) diff --git a/tools/depends/target/pcre2/PCRE2-VERSION b/tools/depends/target/pcre2/PCRE2-VERSION new file mode 100644 index 0000000000..800eebf0b9 --- /dev/null +++ b/tools/depends/target/pcre2/PCRE2-VERSION @@ -0,0 +1,7 @@ +LIBNAME=pcre2 +VERSION=10.42 +ARCHIVE=$(LIBNAME)-$(VERSION).tar.bz2 +SHA512=72fbde87fecec3aa4b47225dd919ea1d55e97f2cbcf02aba26e5a0d3b1ffb58c25a80a9ef069eb99f9cf4e41ba9604ad06a7ec159870e1e875d86820e12256d3 +BYPRODUCT=libpcre2-8.a +BYPRODUCT_WIN=pcre2-8-static.lib + |