"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/project/bundles/mxe/02-build-extralibs.sh" (4 Sep 2019, 6293 Bytes) of package /linux/misc/digikam-6.3.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "02-build-extralibs.sh": 6.0.0_vs_6.1.0.

    1 #! /bin/bash
    2 
    3 # Script to build extra libraries using MEX.
    4 #
    5 # Copyright (c) 2015-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
    6 #
    7 # Redistribution and use is allowed according to the terms of the BSD license.
    8 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
    9 #
   10 
   11 # Halt and catch errors
   12 set -eE
   13 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
   14 trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
   15 
   16 #################################################################################################
   17 # Manage script traces to log file
   18 
   19 mkdir -p ./logs
   20 exec > >(tee ./logs/build-extralibs.full.log) 2>&1
   21 
   22 #################################################################################################
   23 
   24 echo "02-build-extralibs.sh : build extra libraries using MEX."
   25 echo "--------------------------------------------------------"
   26 
   27 #################################################################################################
   28 # Pre-processing checks
   29 
   30 . ./config.sh
   31 . ./common.sh
   32 StartScript
   33 ChecksCPUCores
   34 RegisterRemoteServers
   35 
   36 #################################################################################################
   37 
   38 # Pathes rules
   39 ORIG_PATH="$PATH"
   40 ORIG_WD="`pwd`"
   41 
   42 export PATH=$MXE_BUILDROOT/usr/bin:$MXE_INSTALL_PREFIX/qt5/bin:$PATH
   43 
   44 #################################################################################################
   45 
   46 # Create the build dir for the 3rdparty deps
   47 if [ ! -d $BUILDING_DIR ] ; then
   48     mkdir $BUILDING_DIR
   49 fi
   50 
   51 if [ ! -d $DOWNLOAD_DIR ] ; then
   52     mkdir $DOWNLOAD_DIR
   53 fi
   54 
   55 cd $BUILDING_DIR
   56 rm -rf $BUILDING_DIR/* || true
   57 
   58 ${MXE_BUILD_TARGETS}-cmake $ORIG_WD/../3rdparty \
   59                            -DMXE_TOOLCHAIN=${MXE_TOOLCHAIN} \
   60                            -DMXE_BUILDROOT=${MXE_BUILDROOT} \
   61                            -DCMAKE_BUILD_TYPE=RelWithDebInfo \
   62                            -DCMAKE_COLOR_MAKEFILE=ON \
   63                            -DCMAKE_INSTALL_PREFIX=${MXE_INSTALL_PREFIX} \
   64                            -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
   65                            -DCMAKE_TOOLCHAIN_FILE=${MXE_TOOLCHAIN} \
   66                            -DCMAKE_FIND_PREFIX_PATH=${CMAKE_PREFIX_PATH} \
   67                            -DCMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include \
   68                            -DCMAKE_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include \
   69                            -DCMAKE_LIBRARY_PATH=${CMAKE_PREFIX_PATH}/lib \
   70                            -DZLIB_ROOT=${CMAKE_PREFIX_PATH} \
   71                            -DINSTALL_ROOT=${MXE_INSTALL_PREFIX} \
   72                            -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR
   73 
   74 # NOTE: The order to compile each component here is very important.
   75 
   76 # core KF5 frameworks dependencies
   77 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_extra-cmake-modules -- -j$CPU_CORES
   78 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kconfig             -- -j$CPU_CORES
   79 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_breeze-icons        -- -j$CPU_CORES
   80 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kcoreaddons         -- -j$CPU_CORES
   81 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kwindowsystem       -- -j$CPU_CORES
   82 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_solid               -- -j$CPU_CORES
   83 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_threadweaver        -- -j$CPU_CORES
   84 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_karchive            -- -j$CPU_CORES
   85 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kdbusaddons         -- -j$CPU_CORES
   86 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_ki18n               -- -j$CPU_CORES
   87 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kcrash              -- -j$CPU_CORES
   88 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kcodecs             -- -j$CPU_CORES
   89 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kauth               -- -j$CPU_CORES
   90 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kguiaddons          -- -j$CPU_CORES
   91 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kwidgetsaddons      -- -j$CPU_CORES
   92 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kitemviews          -- -j$CPU_CORES
   93 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kcompletion         -- -j$CPU_CORES
   94 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kconfigwidgets      -- -j$CPU_CORES
   95 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kiconthemes         -- -j$CPU_CORES
   96 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kservice            -- -j$CPU_CORES
   97 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kglobalaccel        -- -j$CPU_CORES
   98 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kxmlgui             -- -j$CPU_CORES
   99 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kbookmarks          -- -j$CPU_CORES
  100 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kimageformats       -- -j$CPU_CORES
  101 
  102 # Geolocation support
  103 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_marble              -- -j$CPU_CORES
  104 
  105 # Calendar support
  106 ${MXE_BUILD_TARGETS}-cmake --build . --config RelWithDebInfo --target ext_kcalcore            -- -j$CPU_CORES
  107 
  108 # Marble install shared lib at wrong place.
  109 mv $MXE_INSTALL_PREFIX/libastro* $MXE_INSTALL_PREFIX/bin
  110 mv $MXE_INSTALL_PREFIX/libmarble* $MXE_INSTALL_PREFIX/bin
  111 
  112 #################################################################################################
  113 
  114 export PATH=$ORIG_PATH
  115 
  116 # Build PNG2Ico CLI tool used by ECM for host OS.
  117 
  118 cd $ORIG_WD/png2ico
  119 
  120 rm -f CMakeCache.txt > /dev/null
  121 
  122 cmake . \
  123       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  124       -DCMAKE_COLOR_MAKEFILE=ON \
  125       -Wno-dev
  126 
  127 make -j$CPU_CORES
  128 
  129 #################################################################################################
  130 
  131 cd "$ORIG_WD"
  132 
  133 export PATH=$ORIG_PATH
  134 
  135 TerminateScript