| 1 |
# Script to build KDE Frameworks for digiKam bundle. |
| 2 |
# |
| 3 |
# SPDX-FileCopyrightText: 2015-2026 by Gilles Caulier <caulier dot gilles at gmail dot com> |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: BSD-3-Clause |
| 6 |
# |
| 7 |
|
| 8 |
set(EXTPREFIX_frameworks "${EXTPREFIX}") |
| 9 |
|
| 10 |
function(InstallKDEComponent |
| 11 |
name |
| 12 |
version |
| 13 |
argoptions |
| 14 |
patch) |
| 15 |
|
| 16 |
if(APPLE) |
| 17 |
|
| 18 |
# Extract MD5 sums of each KDE components directly from server. |
| 19 |
execute_process(COMMAND |
| 20 |
wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5 |
| 21 |
COMMAND |
| 22 |
grep "tar.xz" |
| 23 |
COMMAND |
| 24 |
cut -d " " -f1 |
| 25 |
RESULT_VARIABLE |
| 26 |
wgetresult |
| 27 |
OUTPUT_VARIABLE |
| 28 |
md5sm |
| 29 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
| 30 |
) |
| 31 |
|
| 32 |
message(STATUS "--------------------------------") |
| 33 |
message(STATUS "KDE component : ${name}") |
| 34 |
message(STATUS "Component version: ${version}") |
| 35 |
message(STATUS "Component MD5 : ${md5sm}") |
| 36 |
message(STATUS "Configure options: ${argoptions}") |
| 37 |
message(STATUS "Patch to apply : ${patch}") |
| 38 |
|
| 39 |
if(NOT "${patch}" STREQUAL "") |
| 40 |
set(patch "${PATCH_COMMAND};-p1;-i;${CMAKE_CURRENT_SOURCE_DIR}/${patch};&&") |
| 41 |
endif() |
| 42 |
|
| 43 |
ExternalProject_Add(ext_${name} |
| 44 |
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} |
| 45 |
URL https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz |
| 46 |
URL_MD5 ${md5sm} |
| 47 |
|
| 48 |
PATCH_COMMAND ${patch} |
| 49 |
cp ${CMAKE_CURRENT_SOURCE_DIR}/../../macports/fixbundledatapath.sh <SOURCE_DIR>/. && |
| 50 |
<SOURCE_DIR>/fixbundledatapath.sh |
| 51 |
|
| 52 |
CONFIGURE_COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.${DK_APPLE_PACKAGE_MANAGER} <SOURCE_DIR>/. && |
| 53 |
sed -i '' -e "s/DBUILD_TESTING=ON/DBUILD_TESTING=OFF/g" <SOURCE_DIR>/bootstrap.${DK_APPLE_PACKAGE_MANAGER} && |
| 54 |
<SOURCE_DIR>/bootstrap.${DK_APPLE_PACKAGE_MANAGER} ${EXTPREFIX_frameworks} debug ${ARCH_TARGET} "${argoptions}" |
| 55 |
|
| 56 |
BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE) |
| 57 |
|
| 58 |
INSTALL_COMMAND cd <SOURCE_DIR>/build && make install/fast |
| 59 |
|
| 60 |
BUILD_IN_SOURCE 1 |
| 61 |
|
| 62 |
UPDATE_COMMAND "" |
| 63 |
ALWAYS 0 |
| 64 |
) |
| 65 |
|
| 66 |
else() # Linux and Windows |
| 67 |
|
| 68 |
# Extract MD5 sums of each KDE components directly from server. |
| 69 |
execute_process(COMMAND |
| 70 |
wget -q -O - -o /dev/null https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz.md5 |
| 71 |
COMMAND |
| 72 |
grep "tar.xz" |
| 73 |
COMMAND |
| 74 |
cut -d " " -f1 |
| 75 |
RESULT_VARIABLE |
| 76 |
wgetresult |
| 77 |
OUTPUT_VARIABLE |
| 78 |
md5sm |
| 79 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
| 80 |
) |
| 81 |
|
| 82 |
message(STATUS "--------------------------------") |
| 83 |
message(STATUS "KDE component : ${name}") |
| 84 |
message(STATUS "Component version: ${version}") |
| 85 |
message(STATUS "Component MD5 : ${md5sm}") |
| 86 |
message(STATUS "Configure options: ${argoptions}") |
| 87 |
message(STATUS "Patch to apply : ${patch}") |
| 88 |
|
| 89 |
if(NOT "${patch}" STREQUAL "") |
| 90 |
set(patch "${PATCH_COMMAND};-p1;-i;${CMAKE_CURRENT_SOURCE_DIR}/${patch}") |
| 91 |
endif() |
| 92 |
|
| 93 |
ExternalProject_Add(ext_${name} |
| 94 |
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} |
| 95 |
URL https://download.kde.org/stable/frameworks/${version}/${name}-${version}.0.tar.xz |
| 96 |
URL_MD5 ${md5sm} |
| 97 |
|
| 98 |
PATCH_COMMAND ${patch} |
| 99 |
|
| 100 |
INSTALL_DIR ${EXTPREFIX_frameworks} |
| 101 |
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks} |
| 102 |
-DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} |
| 103 |
${GLOBAL_PROFILE} |
| 104 |
-DCMAKE_SYSTEM_PREFIX_PATH=${EXTPREFIX} |
| 105 |
-DBUILD_TESTING=OFF |
| 106 |
"${argoptions}" |
| 107 |
-Wno-dev |
| 108 |
UPDATE_COMMAND "" |
| 109 |
ALWAYS 0 |
| 110 |
) |
| 111 |
|
| 112 |
endif() |
| 113 |
|
| 114 |
endfunction() |
| 115 |
|
| 116 |
if(APPLE) |
| 117 |
set(MacosThreadWeaverPatch threadweaver-macports.patch) |
| 118 |
set(MacosKauthBackend -DKAUTH_BACKEND_NAME=Apple) |
| 119 |
else() |
| 120 |
set(KCalendarCorePatch kcalendarcore-libical.patch) |
| 121 |
endif() |
| 122 |
|
| 123 |
if(WIN32) |
| 124 |
set(WindowsConfigPatch kconfig-fix-header.patch) |
| 125 |
endif() |
| 126 |
|
| 127 |
if (${ENABLE_QTVERSION} MATCHES "5.*") |
| 128 |
set(Qt5CommonOptions -DQT_MAJOR_VERSION=5 -DBUILD_WITH_QT5=ON -DEXCLUDE_DEPRECATED_BEFORE_AND_AT=5.94.0 -DCMAKE_POLICY_VERSION_MINIMUM=3.5) |
| 129 |
endif() |
| 130 |
|
| 131 |
InstallKDEComponent(extra-cmake-modules ${KDE_VERSION} "${Qt5CommonOptions}" "extracmakemodules-compiler-options.patch") |
| 132 |
InstallKDEComponent(kconfig ${KDE_VERSION} "${Qt5CommonOptions}" "${WindowsConfigPatch}") |
| 133 |
InstallKDEComponent(breeze-icons ${KDE_VERSION} "${Qt5CommonOptions};${BreezeIconsOptions}" "breeze-dropsvg-rccprefix.patch") |
| 134 |
InstallKDEComponent(solid ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 135 |
InstallKDEComponent(kcoreaddons ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 136 |
InstallKDEComponent(threadweaver ${KDE_VERSION} "${Qt5CommonOptions}" "${MacosThreadWeaverPatch}") |
| 137 |
InstallKDEComponent(kwindowsystem ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 138 |
InstallKDEComponent(karchive ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 139 |
InstallKDEComponent(kdbusaddons ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 140 |
InstallKDEComponent(ki18n ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 141 |
InstallKDEComponent(kcrash ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 142 |
InstallKDEComponent(kcodecs ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 143 |
InstallKDEComponent(kauth ${KDE_VERSION} "${Qt5CommonOptions};${MacosKauthBackend}" "") |
| 144 |
InstallKDEComponent(kguiaddons ${KDE_VERSION} "${Qt5CommonOptions};-DWITH_WAYLAND=OFF" "") |
| 145 |
InstallKDEComponent(kwidgetsaddons ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 146 |
InstallKDEComponent(kitemviews ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 147 |
InstallKDEComponent(kcompletion ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 148 |
InstallKDEComponent(kconfigwidgets ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 149 |
InstallKDEComponent(kiconthemes ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 150 |
InstallKDEComponent(kservice ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 151 |
InstallKDEComponent(kglobalaccel ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 152 |
InstallKDEComponent(kcalendarcore ${KDE_VERSION} "${Qt5CommonOptions}" "${KCalendarCorePatch}") |
| 153 |
InstallKDEComponent(kxmlgui ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 154 |
InstallKDEComponent(kbookmarks ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 155 |
InstallKDEComponent(kimageformats ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 156 |
InstallKDEComponent(knotifyconfig ${KDE_VERSION} "${Qt5CommonOptions}" "knotifyconfig-drop-phonon.patch") |
| 157 |
InstallKDEComponent(knotifications ${KDE_VERSION} "${Qt5CommonOptions}" "knotifications-drop-phonon.patch") |
| 158 |
InstallKDEComponent(kjobwidgets ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 159 |
InstallKDEComponent(sonnet ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 160 |
InstallKDEComponent(ktextwidgets ${KDE_VERSION} "${Qt5CommonOptions}" "") |
| 161 |
InstallKDEComponent(kio ${KDE_VERSION} "${Qt5CommonOptions}" "kio-drop-ktextwidgets.patch") |
| 162 |
InstallKDEComponent(kinit ${KDE_VERSION} "${Qt5CommonOptions}" "") |