File fix-build-with-rpm-4.20.patch of Package libQtWebKit4
Fix build with rpm 4.20
QtWebKit's qmake files do some "clever" processing of the current directory
using qmake's replace() function to determine some (sub)paths.
However, the build dir was changed in 4.20 and now includes the package
name/version in the path.
In our case, the version "4.8.7+2.3.4" in particular breaks the build, as '+'
has a special meaning in a regexp (but of course this would happen with other
special characters as well).
These strings need to be escaped before passing them as pattern to replace().
diff -ur qtwebkit-2.3.4.orig/Tools/qmake/mkspecs/features/default_post.prf qtwebkit-2.3.4/Tools/qmake/mkspecs/features/default_post.prf
--- qtwebkit-2.3.4.orig/Tools/qmake/mkspecs/features/default_post.prf 2014-09-24 13:42:05.000000000 +0200
+++ qtwebkit-2.3.4/Tools/qmake/mkspecs/features/default_post.prf 2025-03-08 13:03:52.846604086 +0100
@@ -329,7 +329,7 @@
# desination dir is absolute and contains a static path component
# that also contains either of those two words, so we make DESTDIR
# relative.
-DESTDIR = $$replace(DESTDIR, ^$${ROOT_BUILD_DIR}, $${BUILD_ROOT_RELATIVE_TO_OUT_PWD})
+DESTDIR = $$replace(DESTDIR, ^$$re_escape($${ROOT_BUILD_DIR}), $${BUILD_ROOT_RELATIVE_TO_OUT_PWD})
# Since we loaded our own rules for depending on QtWebKit, and we
# have no more logic that checks contains(QT, webkit), we unset it
diff -ur qtwebkit-2.3.4.orig/Tools/qmake/mkspecs/features/default_pre.prf qtwebkit-2.3.4/Tools/qmake/mkspecs/features/default_pre.prf
--- qtwebkit-2.3.4.orig/Tools/qmake/mkspecs/features/default_pre.prf 2014-09-24 13:42:05.000000000 +0200
+++ qtwebkit-2.3.4/Tools/qmake/mkspecs/features/default_pre.prf 2025-03-08 13:03:52.806604087 +0100
@@ -18,7 +18,7 @@
# Resolve root directories for source and build
ROOT_WEBKIT_DIR = $$replace(PWD, /Tools/qmake/mkspecs/features$,)
-WEBKIT_SUBDIR = $$replace(_PRO_FILE_PWD_, $${ROOT_WEBKIT_DIR},)
+WEBKIT_SUBDIR = $$replace(_PRO_FILE_PWD_, $$re_escape($${ROOT_WEBKIT_DIR}),)
ROOT_BUILD_DIR = $$toSystemPath($$replace(OUT_PWD, $${WEBKIT_SUBDIR}$,))
# We want the QtWebKit API forwarding includes to live in the root build dir.
@@ -38,7 +38,7 @@
!recursive_include:CONFIG += root_project_file
BUILD_ROOT_RELATIVE_TO_OUT_PWD = .
} else {
- subdir_parts = $$replace(OUT_PWD, ^$${ROOT_BUILD_DIR}/,)
+ subdir_parts = $$replace(OUT_PWD, ^$$re_escape($${ROOT_BUILD_DIR})/,)
subdir_parts = $$split(subdir_parts, /)
for(subdir, subdir_parts) {
BUILD_ROOT_RELATIVE_TO_OUT_PWD += ..
diff -ur qtwebkit-2.3.4.orig/Tools/qmake/mkspecs/features/functions.prf qtwebkit-2.3.4/Tools/qmake/mkspecs/features/functions.prf
--- qtwebkit-2.3.4.orig/Tools/qmake/mkspecs/features/functions.prf 2014-09-24 13:42:05.000000000 +0200
+++ qtwebkit-2.3.4/Tools/qmake/mkspecs/features/functions.prf 2025-03-08 13:03:52.906604084 +0100
@@ -53,7 +53,7 @@
}
# Make directory relative
- !isEmpty(subdirectory):subdirectory = $$replace(subdirectory, ^$${_PRO_FILE_PWD_}/,)
+ !isEmpty(subdirectory):subdirectory = $$replace(subdirectory, ^$$re_escape($${_PRO_FILE_PWD_})/,)
!isEmpty(subdirectory) {
subdir_command = cd $$toSystemPath($${subdirectory}$${QMAKE_DIR_SEP}) &&
@@ -246,7 +246,7 @@
target = $$resolveFinalLibraryName($$target)
- path = $$replace(source_dir, $${ROOT_WEBKIT_DIR}, $${ROOT_BUILD_DIR})/$$activeBuildConfig()
+ path = $$replace(source_dir, $$re_escape($${ROOT_WEBKIT_DIR}), $${ROOT_BUILD_DIR})/$$activeBuildConfig()
force_static_libs_as_shared {
LIBS += -L$${ROOT_BUILD_DIR}/lib -l$$target