Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions ports/kf5coreaddons/fix_cmake_config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 4588b0052c11189aa6872e3c3c13f05dbae0c26e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dawid=20Wro=CC=81bel?= <me@dawidwrobel.com>
Date: Fri, 27 Aug 2021 02:02:08 +0200
Subject: [PATCH] Add support for static builds

---
KF5CoreAddonsConfig.cmake.in | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/KF5CoreAddonsConfig.cmake.in b/KF5CoreAddonsConfig.cmake.in
index f86b69ff..f9e0d31f 100644
--- a/KF5CoreAddonsConfig.cmake.in
+++ b/KF5CoreAddonsConfig.cmake.in
@@ -18,6 +18,21 @@ else()
set_target_properties(KF5::desktoptojson PROPERTIES IMPORTED_LOCATION ${DESKTOPTOJSON_EXECUTABLE})
endif()
endif()
+
+if(NOT @BUILD_SHARED_LIBS@)
+ if(NOT WIN32)
+ find_dependency(Threads)
+ endif()
+
+ if(@Inotify_FOUND@)
+ find_package(Inotify) # https://bugs.kde.org/show_bug.cgi?id=441604
+ endif()
+
+ if(@Procstat_FOUND@)
+ find_dependency(Procstat)
+ endif()
+endif()
+
include("${CMAKE_CURRENT_LIST_DIR}/KF5CoreAddonsTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/KF5CoreAddonsMacros.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@
--
GitLab

51 changes: 51 additions & 0 deletions ports/kf5coreaddons/fix_static_build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From de4e22fe644d5df9066ba78f778032a42c2f19b9 Mon Sep 17 00:00:00 2001
From: Nicolas Fella <nicolas.fella@gmx.de>
Date: Sat, 7 Aug 2021 17:24:44 +0200
Subject: [PATCH] Fix issue when building KCrash static

KCoreAddons forward declares a function from KCrash.

It contains a Q_DECL_IMPORT but that breaks when doing a static build.

Only add the Q_DECL_IMPORT when we are doing a dynamic build.

BUG: 440416
---
src/lib/CMakeLists.txt | 4 ++++
src/lib/kaboutdata.h | 4 ++++
2 files changed, 8 insertions(+)

diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 8e9006fd..b3ea957f 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -16,6 +16,10 @@ configure_file(util/config-accountsservice.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/c
add_library(KF5CoreAddons)
add_library(KF5::CoreAddons ALIAS KF5CoreAddons)

+if(NOT BUILD_SHARED_LIBS)
+ target_compile_definitions(KF5CoreAddons PUBLIC -DKCOREADDONS_STATIC)
+endif()
+
ecm_create_qm_loader(KF5CoreAddons kcoreaddons5_qt)

if (FAM_FOUND)
diff --git a/src/lib/kaboutdata.h b/src/lib/kaboutdata.h
index 4309b145..a0222861 100644
--- a/src/lib/kaboutdata.h
+++ b/src/lib/kaboutdata.h
@@ -27,7 +27,11 @@ class KAboutData;
class KPluginMetaData;
namespace KCrash
{
+#ifdef KCOREADDONS_STATIC
+void defaultCrashHandler(int sig);
+#else
Q_DECL_IMPORT void defaultCrashHandler(int sig);
+#endif
}

/**
--
GitLab

27 changes: 10 additions & 17 deletions ports/kf5coreaddons/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,34 @@ vcpkg_from_github(
REPO KDE/kcoreaddons
REF v5.84.0
SHA512 58a802d03bea135c192265651540f9f87066b20ee4af620a94a874ec3992c5e734d1ab1e4ccb082de97389fa3479fd3672ec586c3dd36c9b4a5422c7be98d119
PATCHES
fix_static_build.patch # https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/122
fix_cmake_config.patch # https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/129
)

vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
DISABLE_PARALLEL_CONFIGURE
PREFER_NINJA
OPTIONS
-DBUILD_HTML_DOCS=OFF
-DBUILD_MAN_DOCS=OFF
-DBUILD_QTHELP_DOCS=OFF
-DBUILD_TESTING=OFF
-DKDE_INSTALL_DATAROOTDIR=data
)

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

vcpkg_copy_tools(
TOOL_NAMES desktoptojson
AUTO_CLEAN
)

file(APPEND ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "Data = ../../data")
file(APPEND "${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf" "Data = ../../share")

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/desktoptojson${EXECUTABLE_SUFFIX})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

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

file(INSTALL ${SOURCE_PATH}/LICENSES/ DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
file(INSTALL "${SOURCE_PATH}/LICENSES/" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright")
13 changes: 11 additions & 2 deletions ports/kf5coreaddons/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"name": "kf5coreaddons",
"version": "5.84.0",
"version-semver": "5.84.0",
"port-version": 1,
"description": "Addons to QtCore",
"homepage": "https://api.kde.org/frameworks/kcoreaddons/html/index.html",
"dependencies": [
"ecm",
"qt5-base",
"qt5-tools"
"qt5-tools",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,7 @@
},
"kf5coreaddons": {
"baseline": "5.84.0",
"port-version": 0
"port-version": 1
},
"kf5crash": {
"baseline": "5.84.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/k-/kf5coreaddons.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "001ac94bfbadcc7b05c30448bff3adc9e2dc08dd",
"version-semver": "5.84.0",
"port-version": 1
},
{
"git-tree": "0afc60c5f0db7847953d1082a96b5a4844047f02",
"version": "5.84.0",
Expand Down