File indexing completed on 2024-06-16 04:06:49

0001 #! /bin/bash
0002 
0003 # Script to build extra libraries using MacPorts env.
0004 # This script must be run as sudo
0005 #
0006 # SPDX-FileCopyrightText: 2015-2024 by Gilles Caulier  <caulier dot gilles at gmail dot com>
0007 #
0008 # SPDX-License-Identifier: BSD-3-Clause
0009 #
0010 
0011 # Ask to run as root
0012 (( EUID != 0 )) && exec sudo -- "$0" "$@"
0013 
0014 # Halt and catch errors
0015 set -eE
0016 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
0017 trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
0018 
0019 #################################################################################################
0020 # Manage script traces to log file
0021 
0022 mkdir -p ./logs
0023 exec > >(tee ./logs/build-extralibs.full.log) 2>&1
0024 
0025 #################################################################################################
0026 
0027 echo "02-build-extralibs.sh : build extra libraries using MacPorts."
0028 echo "-------------------------------------------------------------"
0029 
0030 #################################################################################################
0031 # Pre-processing checks
0032 
0033 . ./config.sh
0034 . ./common.sh
0035 StartScript
0036 ChecksRunAsRoot
0037 ChecksXCodeCLI
0038 ChecksCPUCores
0039 OsxCodeName
0040 #RegisterRemoteServers
0041 
0042 #################################################################################################
0043 
0044 # Paths rules
0045 ORIG_PATH="$PATH"
0046 ORIG_WD="`pwd`"
0047 
0048 export PATH=$INSTALL_PREFIX/bin:/$INSTALL_PREFIX/sbin:/$INSTALL_PREFIX/libexec/qt5/bin:$ORIG_PATH
0049 
0050 #################################################################################################
0051 
0052 # Create the build dir for the 3rdparty deps
0053 if [ ! -d $BUILDING_DIR ] ; then
0054     mkdir $BUILDING_DIR
0055 fi
0056 if [ ! -d $DOWNLOAD_DIR ] ; then
0057     mkdir $DOWNLOAD_DIR
0058 fi
0059 
0060 cd $BUILDING_DIR
0061 
0062 rm -rf $BUILDING_DIR/* || true
0063 
0064 cmake $ORIG_WD/../3rdparty \
0065        -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX \
0066        -DINSTALL_ROOT=$INSTALL_PREFIX \
0067        -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR \
0068        -DKA_VERSION=$DK_KA_VERSION \
0069        -DKP_VERSION=$DK_KP_VERSION \
0070        -DKDE_VERSION=$DK_KDE_VERSION \
0071        -DENABLE_QTVERSION=$DK_QTVERSION \
0072        -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \
0073        -Wno-dev
0074 
0075 # NOTE: The order to compile each component here is very important.
0076 
0077 # core KF5 frameworks dependencies
0078 cmake --build . --config RelWithDebInfo --target ext_extra-cmake-modules -- -j$CPU_CORES
0079 cmake --build . --config RelWithDebInfo --target ext_kconfig             -- -j$CPU_CORES
0080 cmake --build . --config RelWithDebInfo --target ext_breeze-icons        -- -j$CPU_CORES
0081 cmake --build . --config RelWithDebInfo --target ext_kcoreaddons         -- -j$CPU_CORES
0082 cmake --build . --config RelWithDebInfo --target ext_kwindowsystem       -- -j$CPU_CORES
0083 cmake --build . --config RelWithDebInfo --target ext_solid               -- -j$CPU_CORES
0084 cmake --build . --config RelWithDebInfo --target ext_threadweaver        -- -j$CPU_CORES
0085 cmake --build . --config RelWithDebInfo --target ext_karchive            -- -j$CPU_CORES
0086 cmake --build . --config RelWithDebInfo --target ext_kdbusaddons         -- -j$CPU_CORES
0087 cmake --build . --config RelWithDebInfo --target ext_ki18n               -- -j$CPU_CORES
0088 cmake --build . --config RelWithDebInfo --target ext_kcrash              -- -j$CPU_CORES
0089 cmake --build . --config RelWithDebInfo --target ext_kcodecs             -- -j$CPU_CORES
0090 cmake --build . --config RelWithDebInfo --target ext_kauth               -- -j$CPU_CORES
0091 cmake --build . --config RelWithDebInfo --target ext_kguiaddons          -- -j$CPU_CORES
0092 cmake --build . --config RelWithDebInfo --target ext_kwidgetsaddons      -- -j$CPU_CORES
0093 cmake --build . --config RelWithDebInfo --target ext_kitemviews          -- -j$CPU_CORES
0094 cmake --build . --config RelWithDebInfo --target ext_kcompletion         -- -j$CPU_CORES
0095 cmake --build . --config RelWithDebInfo --target ext_kconfigwidgets      -- -j$CPU_CORES
0096 cmake --build . --config RelWithDebInfo --target ext_kiconthemes         -- -j$CPU_CORES
0097 cmake --build . --config RelWithDebInfo --target ext_kservice            -- -j$CPU_CORES
0098 cmake --build . --config RelWithDebInfo --target ext_kglobalaccel        -- -j$CPU_CORES
0099 cmake --build . --config RelWithDebInfo --target ext_kxmlgui             -- -j$CPU_CORES
0100 cmake --build . --config RelWithDebInfo --target ext_kbookmarks          -- -j$CPU_CORES
0101 cmake --build . --config RelWithDebInfo --target ext_kimageformats       -- -j$CPU_CORES
0102 
0103 # Extra support for digiKam
0104 
0105 # libksane support
0106 #cmake --build . --config RelWithDebInfo --target ext_libksane            -- -j$CPU_CORES
0107 
0108 # Calendar support
0109 cmake --build . --config RelWithDebInfo --target ext_kcalendarcore       -- -j$CPU_CORES
0110 
0111 # Breeze style support
0112 cmake --build . --config RelWithDebInfo --target ext_breeze              -- -j$CPU_CORES
0113 
0114 #################################################################################################
0115 
0116 export PATH=$ORIG_PATH
0117 
0118 TerminateScript