On Sat, Jun 04, 2022 at 09:38:06AM +0200, Rafael Sadowski wrote:
> On Fri Jun 03, 2022 at 06:07:45PM +0200, Caspar Schutijser wrote:
> > Hi,
> >
> > On a snapshot of two weeks old, the below command sequence (to compile
> > trojita outside the ports tree) succeeds successfully. However, on a
> > machine updated to today's snapshot, this fails with the error message
> > shown below. I assume it has something to do with the update to
> > CMake 3.23 (and perhaps specifically with the
> > "Fix build with CMake 3.23" commit on 2022-05-28) but I don't know for
> > sure. Do you know what's going on?
> >
> > Thanks,
> > Caspar
> >
> >
> > $ cd /tmp
> > $ git clone https://invent.kde.org/pim/trojita
> > $ cd trojita
> > $ echo "set(CMAKE_PREFIX_PATH /usr/local/lib/qt5/cmake)" >new
> > $ cat CMakeLists.txt >>new
> > $ mv new CMakeLists.txt
> > $ mkdir _build
> > $ cd _build
> > $ cmake ..
> > [snip]
> > -- Configuring done
> > CMake Error at /usr/local/lib/qt5/cmake/Qt5WebKit/WebKitTargets.cmake:67
> > (set_target_properties):
> > The link interface of target "Qt5::WebCore" contains:
> >
> > Qt5::Sensors
> >
> > but the target was not found. Possible reasons include:
> >
> > * There is a typo in the target name.
> > * A find_package call is missing for an IMPORTED target.
> > * An ALIAS target is missing.
> >
> > Call Stack (most recent call first):
> > /usr/local/lib/qt5/cmake/Qt5WebKit/Qt5WebKitConfig.cmake:87 (include)
> > /usr/local/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47
> > (find_package)
> > /usr/local/lib/qt5/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsConfig.cmake:83
> > (find_dependency)
> > CMakeLists.txt:52 (find_package)
> >
> >
> > CMake Error at /usr/local/lib/qt5/cmake/Qt5WebKit/WebKitTargets.cmake:83
> > (set_target_properties):
> > The link interface of target "Qt5::WebKit2" contains:
> >
> > Qt5::Positioning
> >
> > but the target was not found. Possible reasons include:
> >
> > * There is a typo in the target name.
> > * A find_package call is missing for an IMPORTED target.
> > * An ALIAS target is missing.
> >
> > Call Stack (most recent call first):
> > /usr/local/lib/qt5/cmake/Qt5WebKit/Qt5WebKitConfig.cmake:87 (include)
> > /usr/local/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47
> > (find_package)
> > /usr/local/lib/qt5/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsConfig.cmake:83
> > (find_dependency)
> > CMakeLists.txt:52 (find_package)
> >
> >
> > -- Generating done
> > CMake Generate step failed. Build files cannot be regenerated correctly.
>
> I think I forgot about this patch.
>
> This is a nasty Qt5WebKit issue. Qt5::WebKit2 depends on Sensors,
> Positioning, Quick and WebChannel but it is not defined in the WebKit2
> cmake module as a dependency (/usr/local/lib/qt5/cmake/Qt5WebKit/*).
>
> I have also not found a solution to fix this in x11/qt5/qtwebkit (ugly
> deadbeef).
Your comment made me look at other port trees/package repositories. The
patch below, obtained via pkgsrc, seems to solve the problem in the
Qt5WebKit port itself. I have verified that I can now compile trojita
from git outside the ports tree, and the mail/trojita port also builds
successfully.
I have not verified yet that the modifications to the following patches
(from the "Fix build with CMake 3.23" commit) can be reverted with this
diff applied, but I think that will be possible. Once I have done that
(will take a couple of days) I'll extend the patch to revert those
changes together with this patch for Qt5WebKit.
databases/kexi/patches/patch-CMakeLists_txt
devel/kf5/kdewebkit/patches/patch-CMakeLists_txt
devel/kreport/patches/patch-CMakeLists_txt
devel/zeal/patches/patch-src_libs_core_CMakeLists_txt
devel/zeal/patches/patch-src_libs_ui_CMakeLists_txt
geo/qgis/patches/patch-CMakeLists_txt
net/qsyncthingtray/patches/patch-CMakeLists_txt
productivity/libalkimia/patches/patch-CMakeLists_txt
Thanks,
Caspar
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/qt5/qtwebkit/Makefile,v
retrieving revision 1.38
diff -u -p -r1.38 Makefile
--- Makefile 28 May 2022 06:20:03 -0000 1.38
+++ Makefile 4 Jun 2022 13:00:28 -0000
@@ -13,7 +13,7 @@ PKGNAME = qtwebkit-${VERSION}
PKGSPEC = qtwebkit->=${VERSION}v0
EPOCH = 0
-REVISION = 7
+REVISION = 8
SHARED_LIBS += Qt5WebKit 3.1 # 5.9
SHARED_LIBS += Qt5WebKitWidgets 3.1 # 5.9
Index: patches/patch-Source_Qt5WebKitConfig_cmake_in
===================================================================
RCS file: patches/patch-Source_Qt5WebKitConfig_cmake_in
diff -N patches/patch-Source_Qt5WebKitConfig_cmake_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_Qt5WebKitConfig_cmake_in 4 Jun 2022 13:00:28
-0000
@@ -0,0 +1,18 @@
+Index: Source/Qt5WebKitConfig.cmake.in
+
+Fix build of ports using cmake/QtWebKit with cmake >= 3.23. Borrowed from
+http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/x11/qt5-qtwebkit/patches/patch-Source_Qt5WebKitConfig.cmake.in?rev=1.1&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
+
+--- Source/Qt5WebKitConfig.cmake.in.orig
++++ Source/Qt5WebKitConfig.cmake.in
+@@ -4,6 +4,10 @@
+ find_dependency_with_major_and_minor(Qt5Core @Qt5_VERSION_MAJOR@
@Qt5_VERSION_MINOR@)
+ find_dependency_with_major_and_minor(Qt5Gui @Qt5_VERSION_MAJOR@
@Qt5_VERSION_MINOR@)
+ find_dependency_with_major_and_minor(Qt5Network @Qt5_VERSION_MAJOR@
@Qt5_VERSION_MINOR@)
++find_dependency_with_major_and_minor(Qt5Sensors @Qt5_VERSION_MAJOR@
@Qt5_VERSION_MINOR@)
++find_dependency_with_major_and_minor(Qt5Positioning @Qt5_VERSION_MAJOR@
@Qt5_VERSION_MINOR@)
++find_dependency_with_major_and_minor(Qt5Quick @Qt5_VERSION_MAJOR@
@Qt5_VERSION_MINOR@)
++find_dependency_with_major_and_minor(Qt5WebChannel @Qt5_VERSION_MAJOR@
@Qt5_VERSION_MINOR@)
+
+ include("${CMAKE_CURRENT_LIST_DIR}/WebKitTargets.cmake")
+