| 1 |
#! /bin/bash |
| 2 |
|
| 3 |
# Script to build extra libraries using MacPorts env. |
| 4 |
# This script must be run as sudo |
| 5 |
# |
| 6 |
# SPDX-FileCopyrightText: 2015-2026 by Gilles Caulier <caulier dot gilles at gmail dot com> |
| 7 |
# |
| 8 |
# SPDX-License-Identifier: BSD-3-Clause |
| 9 |
# |
| 10 |
|
| 11 |
# Ask to run as root |
| 12 |
(( EUID != 0 )) && exec sudo -- "$0" "$@" |
| 13 |
|
| 14 |
# Halt and catch errors |
| 15 |
set -eE |
| 16 |
trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG |
| 17 |
trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR |
| 18 |
|
| 19 |
################################################################################################# |
| 20 |
# Manage script traces to log file |
| 21 |
|
| 22 |
mkdir -p ./logs |
| 23 |
exec > >(tee ./logs/build-extralibs.full.log) 2>&1 |
| 24 |
|
| 25 |
################################################################################################# |
| 26 |
|
| 27 |
echo "02-build-extralibs.sh : build extra libraries using MacPorts." |
| 28 |
echo "-------------------------------------------------------------" |
| 29 |
|
| 30 |
################################################################################################# |
| 31 |
# Pre-processing checks |
| 32 |
|
| 33 |
. ./config.sh |
| 34 |
. ./common.sh |
| 35 |
StartScript |
| 36 |
ChecksRunAsRoot |
| 37 |
ChecksXCodeCLI |
| 38 |
ChecksCPUCores |
| 39 |
OsxCodeName |
| 40 |
#RegisterRemoteServers |
| 41 |
|
| 42 |
################################################################################################# |
| 43 |
|
| 44 |
# Paths rules |
| 45 |
ORIG_PATH="$PATH" |
| 46 |
ORIG_WD="`pwd`" |
| 47 |
|
| 48 |
export PATH="$INSTALL_PREFIX/bin:$INSTALL_PREFIX/sbin:$INSTALL_PREFIX/libexec/qt$DK_QTVERSION/bin:$ORIG_PATH" |
| 49 |
|
| 50 |
# Typically, for the Breeze-icons python3 generation icons script (do not work yet with macports). |
| 51 |
port select --set python3 python312 |
| 52 |
export PYTHONPATH="$INSTALL_PREFIX/bin:$PYTHONPATH" |
| 53 |
|
| 54 |
################################################################################################# |
| 55 |
|
| 56 |
# Create the build dir for the 3rdparty deps |
| 57 |
if [ ! -d $BUILDING_DIR ] ; then |
| 58 |
mkdir $BUILDING_DIR |
| 59 |
fi |
| 60 |
if [ ! -d $DOWNLOAD_DIR ] ; then |
| 61 |
mkdir $DOWNLOAD_DIR |
| 62 |
fi |
| 63 |
|
| 64 |
cd $BUILDING_DIR |
| 65 |
|
| 66 |
rm -rf $BUILDING_DIR/* || true |
| 67 |
|
| 68 |
cmake $ORIG_WD/../3rdparty \ |
| 69 |
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX \ |
| 70 |
-DINSTALL_ROOT=$INSTALL_PREFIX \ |
| 71 |
-DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR \ |
| 72 |
-DKA_VERSION=$DK_KA_VERSION \ |
| 73 |
-DKP_VERSION=$DK_KP_VERSION \ |
| 74 |
-DKDE_VERSION=$DK_KDE_VERSION \ |
| 75 |
-DENABLE_QTVERSION=$DK_QTVERSION \ |
| 76 |
-DDK_APPLE_PACKAGE_MANAGER=$DK_APPLE_PACKAGE_MANAGER \ |
| 77 |
-DARCH_TARGET=$TARGET_ARCH \ |
| 78 |
-Wno-dev |
| 79 |
|
| 80 |
# NOTE: The order to compile each component here is very important. |
| 81 |
|
| 82 |
# core KF frameworks dependencies |
| 83 |
cmake --build . --config RelWithDebInfo --target ext_extra-cmake-modules -- -j$CPU_CORES |
| 84 |
cmake --build . --config RelWithDebInfo --target ext_kconfig -- -j$CPU_CORES |
| 85 |
cmake --build . --config RelWithDebInfo --target ext_breeze-icons -- -j$CPU_CORES |
| 86 |
cmake --build . --config RelWithDebInfo --target ext_kcoreaddons -- -j$CPU_CORES |
| 87 |
cmake --build . --config RelWithDebInfo --target ext_kwindowsystem -- -j$CPU_CORES |
| 88 |
cmake --build . --config RelWithDebInfo --target ext_solid -- -j$CPU_CORES |
| 89 |
cmake --build . --config RelWithDebInfo --target ext_threadweaver -- -j$CPU_CORES |
| 90 |
cmake --build . --config RelWithDebInfo --target ext_karchive -- -j$CPU_CORES |
| 91 |
cmake --build . --config RelWithDebInfo --target ext_kdbusaddons -- -j$CPU_CORES |
| 92 |
cmake --build . --config RelWithDebInfo --target ext_ki18n -- -j$CPU_CORES |
| 93 |
cmake --build . --config RelWithDebInfo --target ext_kcrash -- -j$CPU_CORES |
| 94 |
cmake --build . --config RelWithDebInfo --target ext_kcodecs -- -j$CPU_CORES |
| 95 |
cmake --build . --config RelWithDebInfo --target ext_kauth -- -j$CPU_CORES |
| 96 |
cmake --build . --config RelWithDebInfo --target ext_kguiaddons -- -j$CPU_CORES |
| 97 |
cmake --build . --config RelWithDebInfo --target ext_kwidgetsaddons -- -j$CPU_CORES |
| 98 |
cmake --build . --config RelWithDebInfo --target ext_kitemviews -- -j$CPU_CORES |
| 99 |
cmake --build . --config RelWithDebInfo --target ext_kcompletion -- -j$CPU_CORES |
| 100 |
|
| 101 |
if [[ $DK_QTVERSION == 6 ]] ; then |
| 102 |
|
| 103 |
cmake --build . --config RelWithDebInfo --target ext_kcolorscheme -- -j$CPU_CORES |
| 104 |
|
| 105 |
fi |
| 106 |
|
| 107 |
cmake --build . --config RelWithDebInfo --target ext_kconfigwidgets -- -j$CPU_CORES |
| 108 |
cmake --build . --config RelWithDebInfo --target ext_kiconthemes -- -j$CPU_CORES |
| 109 |
cmake --build . --config RelWithDebInfo --target ext_kservice -- -j$CPU_CORES |
| 110 |
cmake --build . --config RelWithDebInfo --target ext_kxmlgui -- -j$CPU_CORES |
| 111 |
cmake --build . --config RelWithDebInfo --target ext_kbookmarks -- -j$CPU_CORES |
| 112 |
cmake --build . --config RelWithDebInfo --target ext_kimageformats -- -j$CPU_CORES |
| 113 |
|
| 114 |
# Extra support for digiKam |
| 115 |
|
| 116 |
# Desktop integration support |
| 117 |
cmake --build . --config RelWithDebInfo --target ext_knotifications -- -j$CPU_CORES |
| 118 |
cmake --build . --config RelWithDebInfo --target ext_kjobwidgets -- -j$CPU_CORES |
| 119 |
|
| 120 |
cmake --build . --config RelWithDebInfo --target ext_kio -- -j$CPU_CORES |
| 121 |
cmake --build . --config RelWithDebInfo --target ext_knotifyconfig -- -j$CPU_CORES |
| 122 |
|
| 123 |
if [[ $DK_QTVERSION == 6 ]] ; then |
| 124 |
|
| 125 |
cmake --build . --config RelWithDebInfo --target ext_sonnet -- -j$CPU_CORES |
| 126 |
cmake --build . --config RelWithDebInfo --target ext_ktextwidgets -- -j$CPU_CORES |
| 127 |
|
| 128 |
fi |
| 129 |
|
| 130 |
# libksane support |
| 131 |
#cmake --build . --config RelWithDebInfo --target ext_libksane -- -j$CPU_CORES |
| 132 |
|
| 133 |
# Calendar support |
| 134 |
cmake --build . --config RelWithDebInfo --target ext_kcalendarcore -- -j$CPU_CORES |
| 135 |
|
| 136 |
# Breeze style support |
| 137 |
cmake --build . --config RelWithDebInfo --target ext_breeze -- -j$CPU_CORES |
| 138 |
|
| 139 |
################################################################################################# |
| 140 |
|
| 141 |
export PATH=$ORIG_PATH |
| 142 |
|
| 143 |
TerminateScript |