"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/project/bundles/mxe/03-build-digikam.sh" (4 Sep 2019, 5294 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 latest Fossies "Diffs" side-by-side code changes report for "03-build-digikam.sh": 6.2.0_vs_6.3.0.

    1 #! /bin/bash
    2 
    3 # Script to build digiKam using MXE
    4 # This script must be run as sudo
    5 #
    6 # Copyright (c) 2015-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
    7 #
    8 # Redistribution and use is allowed according to the terms of the BSD license.
    9 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
   10 #
   11 
   12 # Halt and catch errors
   13 set -eE
   14 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
   15 trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
   16 
   17 #################################################################################################
   18 # Manage script traces to log file
   19 
   20 mkdir -p ./logs
   21 exec > >(tee ./logs/build-digikam.full.log) 2>&1
   22 
   23 #################################################################################################
   24 
   25 echo "03-build-digikam.sh : build digiKam using MEX."
   26 echo "---------------------------------------------------"
   27 
   28 #################################################################################################
   29 # Pre-processing checks
   30 
   31 . ./config.sh
   32 . ./common.sh
   33 StartScript
   34 ChecksCPUCores
   35 RegisterRemoteServers
   36 
   37 #################################################################################################
   38 
   39 # Pathes rules
   40 ORIG_PATH="$PATH"
   41 ORIG_WD="`pwd`"
   42 
   43 export PATH=$MXE_BUILDROOT/usr/bin:$MXE_INSTALL_PREFIX/qt5/bin:$PATH
   44 cd $MXE_BUILDROOT
   45 
   46 #################################################################################################
   47 # Build digiKam in temporary directory and installation
   48 
   49 if [ -d "$DK_BUILDTEMP/digikam-$DK_VERSION" ] ; then
   50 
   51     echo "---------- Updating existing $DK_BUILDTEMP"
   52 
   53     cd "$DK_BUILDTEMP"
   54     cd digikam-$DK_VERSION
   55 
   56     git reset --hard
   57     git pull
   58 
   59     mkdir -p build.mxe
   60 
   61 else
   62 
   63     echo "---------- Creating $DK_BUILDTEMP"
   64     mkdir -p "$DK_BUILDTEMP"
   65 
   66     if [ $? -ne 0 ] ; then
   67         echo "---------- Cannot create $DK_BUILDTEMP directory."
   68         echo "---------- Aborting..."
   69         exit;
   70     fi
   71 
   72     cd "$DK_BUILDTEMP"
   73     echo -e "\n\n"
   74     echo "---------- Downloading digiKam $DK_VERSION"
   75 
   76     git clone --progress --verbose $DK_GITURL digikam-$DK_VERSION
   77     cd digikam-$DK_VERSION
   78 
   79     if [ $? -ne 0 ] ; then
   80         echo "---------- Cannot clone repositories."
   81         echo "---------- Aborting..."
   82         exit;
   83     fi
   84 
   85     git checkout $DK_VERSION
   86 
   87     mkdir build.mxe
   88 
   89 fi
   90 
   91 echo -e "\n\n"
   92 echo "---------- Configure digiKam $DK_VERSION"
   93 
   94 sed -e "s/DIGIKAMSC_CHECKOUT_PO=OFF/DIGIKAMSC_CHECKOUT_PO=ON/g" ./bootstrap.mxe > ./tmp.mxe ; mv -f ./tmp.mxe ./bootstrap.mxe
   95 sed -e "s/DIGIKAMSC_COMPILE_PO=OFF/DIGIKAMSC_COMPILE_PO=ON/g"   ./bootstrap.mxe > ./tmp.mxe ; mv -f ./tmp.mxe ./bootstrap.mxe
   96 sed -e "s/DBUILD_TESTING=ON/DBUILD_TESTING=OFF/g"               ./bootstrap.mxe > ./tmp.mxe ; mv -f ./tmp.mxe ./bootstrap.mxe
   97 sed -e "s/DENABLE_DBUS=ON/DENABLE_DBUS=OFF/g"                   ./bootstrap.mxe > ./tmp.mxe ; mv -f ./tmp.mxe ./bootstrap.mxe
   98 sed -e "s/DENABLE_DRMINGW=OFF/DENABLE_DRMINGW=ON/g"             ./bootstrap.mxe > ./tmp.mxe ; mv -f ./tmp.mxe ./bootstrap.mxe
   99 
  100 chmod +x ./bootstrap.mxe
  101 
  102 ./bootstrap.mxe $MXE_BUILDROOT RelWithDebInfo -DPng2Ico_EXECUTABLE=${ORIG_WD}/png2ico/png2ico
  103 
  104 if [ $? -ne 0 ]; then
  105     echo "---------- Cannot configure digiKam $DK_VERSION."
  106     echo "---------- Aborting..."
  107     exit;
  108 fi
  109 
  110 cat ./build.mxe/core/app/utils/digikam_version.h | grep "digikam_version\[\]" | awk '{print $6}' | tr -d '";' > $ORIG_WD/data/RELEASEID.txt
  111 
  112 echo -e "\n\n"
  113 echo "---------- Building digiKam $DK_VERSION"
  114 
  115 cd build.mxe
  116 make -j$CPU_CORES
  117 
  118 if [ $? -ne 0 ]; then
  119     echo "---------- Cannot compile digiKam $DK_VERSION."
  120     echo "---------- Aborting..."
  121     exit;
  122 fi
  123 
  124 echo -e "\n\n"
  125 echo "---------- Installing digiKam $DK_VERSION"
  126 echo -e "\n\n"
  127 
  128 make install/fast && cd "$ORIG_WD" && rm -rf "$DK_BUILDTEMP"
  129 
  130 if [ $? -ne 0 ]; then
  131     echo "---------- Cannot install digiKam $DK_VERSION."
  132     echo "---------- Aborting..."
  133     exit;
  134 fi
  135 
  136 #################################################################################################
  137 # Install Extra Plugins
  138 
  139 cd $BUILDING_DIR
  140 rm -rf $BUILDING_DIR/* || true
  141 
  142 ${MXE_BUILD_TARGETS}-cmake $ORIG_WD/../3rdparty \
  143                            -DMXE_TOOLCHAIN=${MXE_TOOLCHAIN} \
  144                            -DMXE_BUILDROOT=${MXE_BUILDROOT} \
  145                            -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  146                            -DCMAKE_COLOR_MAKEFILE=ON \
  147                            -DCMAKE_INSTALL_PREFIX=${MXE_INSTALL_PREFIX} \
  148                            -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
  149                            -DCMAKE_TOOLCHAIN_FILE=${MXE_TOOLCHAIN} \
  150                            -DCMAKE_FIND_PREFIX_PATH=${CMAKE_PREFIX_PATH} \
  151                            -DCMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include \
  152                            -DCMAKE_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include \
  153                            -DCMAKE_LIBRARY_PATH=${CMAKE_PREFIX_PATH}/lib \
  154                            -DZLIB_ROOT=${CMAKE_PREFIX_PATH} \
  155                            -DINSTALL_ROOT=${MXE_INSTALL_PREFIX} \
  156                            -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR
  157 
  158 cmake --build . --config RelWithDebInfo --target ext_gmic_qt -- -j$CPU_CORES
  159 
  160 #################################################################################################
  161 
  162 export PATH=$ORIG_PATH
  163 
  164 TerminateScript