Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kf5guiaddons] fix Wayland scanner not being found by transitive deps; fix static builds #19203

Merged
merged 23 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fdae73a
[kf5guiaddons] add QtWaylandScanner_EXECUTABLE variable to Config.cmake
wrobelda Jul 28, 2021
a147bdf
[kf5guiaddons] update versions
wrobelda Jul 28, 2021
2661260
[kf5guiaddons] remove extraneous options
wrobelda Jul 30, 2021
8e3bac0
[kf5guiaddons] update versions
wrobelda Jul 30, 2021
1d4b344
[kf5guiaddons] remove extraneous lines, bump version
wrobelda Aug 4, 2021
0105a39
[kf5guiaddons] update versions
wrobelda Aug 4, 2021
c51b14d
[kf5guiaddons] add QtWaylandScanner_EXECUTABLE to MAYBE_UNUSED_VARIABLES
wrobelda Aug 7, 2021
cec7217
[kf5guiaddons] update versions
wrobelda Aug 7, 2021
a7db4b2
[kf5guiaddons] replace CURRENT_INSTALLED_DIR without affecting other …
wrobelda Aug 9, 2021
bdcd714
[kf5guiaddons] update deprecated functions
wrobelda Aug 9, 2021
3172255
[kf5guiaddons] wrap paths in quotes
wrobelda Aug 9, 2021
69ed879
[kf5guiaddons] update versions
wrobelda Aug 9, 2021
c82701e
[kf5guiaddons] use PACKAGE_PREFIX relative path instead CURRENT_PACKA…
wrobelda Aug 9, 2021
f1536e5
[kf5guiaddons] update versions
wrobelda Aug 9, 2021
115400b
[kf5guiaddons] cache the QtWaylandScanner_EXECUTABLE variable
wrobelda Aug 28, 2021
e166558
[kf5guiaddons] update versions
wrobelda Aug 28, 2021
eb01d6c
[kf5guiaddons] update versions
wrobelda Aug 28, 2021
b3da805
[kf5guiaddons] Add missing static dependency
wrobelda Aug 28, 2021
0ffc0c9
[kf5guiaddons] update versions
wrobelda Aug 28, 2021
329f4b3
[kf5guiaddons] rename patch file
wrobelda Aug 30, 2021
a643d0b
[kf5guiaddons] update versions
wrobelda Aug 30, 2021
446ddb8
[kf5guiaddons] add PACKAGE_NAME to vcpkg_cmake_config_fixup
wrobelda Aug 30, 2021
8904d69
[kf5guiaddons] update versions
wrobelda Aug 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions ports/kf5guiaddons/add_missing_static_dependencies.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
From 7b0a5566acbdb6ff8e7eca3e5e75aacbf2abff9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dawid=20Wro=CC=81bel?= <me@dawidwrobel.com>
Date: Sat, 28 Aug 2021 17:08:46 +0200
Subject: [PATCH] Add missing static dependency to Config.cmake.in

- move find_package(Qt5X11Extras) to root CMakeLists.txt
---
CMakeLists.txt | 5 +++++
KF5GuiAddonsConfig.cmake.in | 5 ++++-
src/CMakeLists.txt | 24 ++++++++++--------------
3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 337122e..80633e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,11 @@ if (NOT APPLE AND NOT WIN32)
find_package(XCB MODULE COMPONENTS XCB)
endif()

+set(WITH_XCB)
+if (NOT APPLE AND X11_FOUND AND X11_Xkb_FOUND AND XCB_XCB_FOUND)
+ find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} NO_MODULE)
+endif()
+
if (WITH_WAYLAND)
find_package(Qt5WaylandClient ${REQUIRED_QT_VERSION} NO_MODULE)
find_package(QtWaylandScanner REQUIRED)
diff --git a/KF5GuiAddonsConfig.cmake.in b/KF5GuiAddonsConfig.cmake.in
index a3c3e58..ae17f6b 100644
--- a/KF5GuiAddonsConfig.cmake.in
+++ b/KF5GuiAddonsConfig.cmake.in
@@ -6,9 +6,12 @@ include(CMakeFindDependencyMacro)
find_dependency(Qt5Gui @REQUIRED_QT_VERSION@)

if (NOT @BUILD_SHARED_LIBS@)
+ if (@Qt5X11Extras_FOUND@)
+ find_dependency(Qt5X11Extras @REQUIRED_QT_VERSION@)
+ endif()
if (@WITH_WAYLAND@)
find_dependency(Wayland REQUIRED Client)
- find_dependency(Qt5WaylandClient)
+ find_dependency(Qt5WaylandClient @REQUIRED_QT_VERSION@)
find_dependency(QtWaylandScanner)
endif()
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1dd66e8..ae0e0aa 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -58,20 +58,16 @@ target_include_directories(KF5GuiAddons INTERFACE "$<INSTALL_INTERFACE:${KDE_INS
target_compile_definitions(KF5GuiAddons INTERFACE "$<INSTALL_INTERFACE:KGUIADDONS_LIB>")
target_link_libraries(KF5GuiAddons PUBLIC Qt5::Gui)

-set(WITH_XCB)
-if (NOT APPLE AND X11_FOUND AND X11_Xkb_FOUND AND XCB_XCB_FOUND)
- find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} NO_MODULE)
- if (Qt5X11Extras_FOUND)
- add_library(kmodifierkey_xcb MODULE util/kmodifierkeyinfoprovider_xcb.cpp)
- target_include_directories (kmodifierkey_xcb PRIVATE
- ${X11_Xkb_INCLUDE_PATH}
- ${X11_Xlib_INCLUDE_PATH}
- ${XCB_XCB_INCLUDE_DIR}
- )
- target_link_libraries(kmodifierkey_xcb PRIVATE ${X11_LIBRARIES} ${XCB_XCB_LIBRARY} Qt5::X11Extras KF5::GuiAddons)
- install( TARGETS kmodifierkey_xcb DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kguiaddons/kmodifierkey/)
- endif()
-endif ()
+if (Qt5X11Extras_FOUND)
+ add_library(kmodifierkey_xcb MODULE util/kmodifierkeyinfoprovider_xcb.cpp)
+ target_include_directories (kmodifierkey_xcb PRIVATE
+ ${X11_Xkb_INCLUDE_PATH}
+ ${X11_Xlib_INCLUDE_PATH}
+ ${XCB_XCB_INCLUDE_DIR}
+ )
+ target_link_libraries(kmodifierkey_xcb PRIVATE ${X11_LIBRARIES} ${XCB_XCB_LIBRARY} Qt5::X11Extras KF5::GuiAddons)
+ install( TARGETS kmodifierkey_xcb DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kguiaddons/kmodifierkey/)
+endif()

ecm_generate_headers(KGuiAddons_HEADERS
HEADER_NAMES
--
GitLab

12 changes: 12 additions & 0 deletions ports/kf5guiaddons/fix_cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/KF5GuiAddonsConfig.cmake.in b/KF5GuiAddonsConfig.cmake.in
index ae17f6b..34e41bd 100644
--- a/KF5GuiAddonsConfig.cmake.in
+++ b/KF5GuiAddonsConfig.cmake.in
@@ -10,6 +10,7 @@ if (NOT @BUILD_SHARED_LIBS@)
find_dependency(Qt5X11Extras @REQUIRED_QT_VERSION@)
endif()
if (@WITH_WAYLAND@)
+ set(QtWaylandScanner_EXECUTABLE "${PACKAGE_PREFIX}/tools/qt5-wayland/bin/qtwaylandscanner" CACHE STRING "QtWaylandScanner workaround")
find_dependency(Wayland REQUIRED Client)
find_dependency(Qt5WaylandClient @REQUIRED_QT_VERSION@)
find_dependency(QtWaylandScanner)
24 changes: 12 additions & 12 deletions ports/kf5guiaddons/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ vcpkg_from_github(
REF v5.84.0
SHA512 e5905c0aa5343ce3d4cd3765cb81390fc89fb78aec3c8de8b31d1dada8074d04f549ff785f3988498d2e274d7cb08a35a83ba031d18562049e6ca41d18ea52ee
HEAD_REF master
PATCHES
add_missing_static_dependencies.patch # https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/25
fix_cmake.patch # https://github.com/microsoft/vcpkg/issues/17607#issuecomment-831518812
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand All @@ -15,29 +18,26 @@ if("wayland" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_LINUX)
message(FATAL_ERROR "Feature wayland is only supported on Linux.")
endif()

vcpkg_configure_cmake(
vcpkg_cmake_configure(
DISABLE_PARALLEL_CONFIGURE
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DQtWaylandScanner_EXECUTABLE=${CURRENT_INSTALLED_DIR}/tools/qt5-wayland/bin/qtwaylandscanner
${FEATURE_OPTIONS}
MAYBE_UNUSED_VARIABLES
QtWaylandScanner_EXECUTABLE
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5GuiAddons)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME KF5GuiAddons CONFIG_PATH lib/cmake/KF5GuiAddons)
vcpkg_copy_pdbs()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc)
NancyLi1013 marked this conversation as resolved.
Show resolved Hide resolved
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL ${SOURCE_PATH}/LICENSES/ DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
file(INSTALL "${SOURCE_PATH}/LICENSES/" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright")
12 changes: 10 additions & 2 deletions ports/kf5guiaddons/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kf5guiaddons",
"version": "5.84.0",
"port-version": 1,
"version-semver": "5.84.0",
"port-version": 2,
"description": "Addons to QtGui",
"homepage": "https://api.kde.org/frameworks/kguiaddons/html/index.html",
"dependencies": [
Expand All @@ -14,6 +14,14 @@
{
"name": "qt5-x11extras",
"platform": "linux"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2918,7 +2918,7 @@
},
"kf5guiaddons": {
"baseline": "5.84.0",
"port-version": 1
"port-version": 2
},
"kf5holidays": {
"baseline": "5.84.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/k-/kf5guiaddons.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3ecd4e54210c93a999c1cf4ddc24aded8c0d7437",
"version-semver": "5.84.0",
"port-version": 2
},
{
"git-tree": "7413c9e8bfa4e7db669271b3c13fe5cf7c52567a",
"version": "5.84.0",
Expand Down