Control: tags -1 + patch
Please find attached a patch; I did my best to test it.
I believe the changes to the CRegExp class (xbmc/utils/RegExp.*) are
sane; they are tested in xbmc/utils/test/TestRegexp.cpp and some other
test programs that use CRegExp. I added three more test cases:
invalid pattern, UTF-8 compilation/matching, and JIT. The latter two
should pass on all the buildds since PCRE2 is built everywhere with
Unicode support, and on those architectures where JIT support is not
available, m_JitSupported will be false so the related functions in
the methods RegComp and PrivateRegFind will not be invoked.
Furthermore, according to the PCRE2 documentation, an application
doesn't need to check explicitly for JIT support because all of the
PCRE2 JIT-related functions have dummy placeholders and silently do
nothing if JIT support is not available.
The changes to CFTPParse (xbmc/filesystem/FTPParse.cpp) are clumsy,
overly verbose code; I'm not proud of it at all. I tried to minimize
casting as much as possible. AFAICS it's used only to obtain an ftp
directory contents. I tried adding some directories from
ftp.gnustep.org as source, but of course there are no media files
there. Then I installed an FTP server and populated /srv/ftp/ with
some video files. Kodi displays their properties and plays them, but
I cannot be sure that CFTPParse methods are actually used. I can't
put breakpoints in gdb as the app runs in fullscreen mode and I don't
know how to switch to normal mode. (In hindsight, I guess I could
have added some printf statements but it's too late now and the beast
takes nearly 4 hours to build on my machine.) An unpleasant obstacle
was that Kodi frequently crashes my videocard driver (nouveau) which
made testing very frustrating.
I guess the patch needs more testing and a closer look by someone
familiar with this package (ideally both as a user and maintainer), on
a machine that is capable of running Kodi.
Please let me know if there are problems that require correction.
Description: Port to PCRE2.
Bug-Debian:
https://bugs.debian.org/1000113
Author: Yavor Doganov <
yavor@gnu.org>
Forwarded: no
Last-Update: 2024-01-07
---
--- kodi-20.2+dfsg.orig/cmake/modules/FindPCRE.cmake
+++ kodi-20.2+dfsg/cmake/modules/FindPCRE.cmake
@@ -77,45 +77,34 @@
else()
# Populate paths for find_package_handle_standard_args
- find_path(PCRE_INCLUDE_DIR pcre.h)
+ find_path(PCRE_INCLUDE_DIR pcre2.h)
- find_library(PCRECPP_LIBRARY_RELEASE NAMES pcrecpp)
- find_library(PCRECPP_LIBRARY_DEBUG NAMES pcrecppd)
-
- find_library(PCRE_LIBRARY_RELEASE NAMES pcre)
- find_library(PCRE_LIBRARY_DEBUG NAMES pcred)
+ find_library(PCRE_LIBRARY_RELEASE NAMES pcre2-8)
endif()
else()
if(PKG_CONFIG_FOUND)
- pkg_check_modules(PC_PCRE libpcrecpp QUIET)
+ pkg_check_modules(PC_PCRE libpcre2-8 QUIET)
endif()
- find_path(PCRE_INCLUDE_DIR pcrecpp.h
+ find_path(PCRE_INCLUDE_DIR pcre2.h
PATHS ${PC_PCRE_INCLUDEDIR})
- find_library(PCRECPP_LIBRARY_RELEASE NAMES pcrecpp
- PATHS ${PC_PCRE_LIBDI