bootstrap.local 2.35 KB
Newer Older
1 2
#!/bin/bash

Gilles Caulier's avatar
Gilles Caulier committed
3
# Copyright (c) 2008-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
4 5 6 7 8 9
# Copyright (c) 2012-2016, Benjamin Girault <benjamin dot girault at gmail dot com>
# Copyright (c)      2015, Ulf Rompe <kde dot org at rompe dot org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
10
# See project's Doxygen documentation for more information.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#
# WARNING: Make sure you understand what this does before using it!

# Halt and catch errors
set -eE
trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR

########################## CONFIG ######################

# Replace this with the directory where you want your local digikam
DIGIKAM_INSTALL_PREFIX=$HOME/local/opt/digikam

# Set to 1 if you want to clean that directory (this script will delete and recreate it)
CLEANROOT=0

# Additional options for cmake.
#ADDITIONAL_CMAKE_FLAGS='-DCMAKE_CXX_FLAGS="-pedantic -Werror=return-type" -DCMAKE_C_FLAGS="-pedantic -Werror=return-type"'

###################### END CONFIG ######################

if [ "$CLEANROOT" == "1" ]; then
    if expr $DIGIKAM_INSTALL_PREFIX : $HOME'.*'; then
        rm -Rf $DIGIKAM_INSTALL_PREFIX
    else
        echo "Refusing to remove $DIGIKAM_INSTALL_PREFIX since it is outside your HOME."
    fi
fi
. `dirname $0`/bootstrap.linux $*
mkdir -p $DIGIKAM_INSTALL_PREFIX/var/tmp/kde-$USER

cat << EOF > finish_install.sh
#!/bin/bash
KCOCA=$DIGIKAM_INSTALL_PREFIX/var/tmp/kde-$USER/ksycoca5
XDG=$DIGIKAM_INSTALL_PREFIX/share:\$XDG_DATA_DIRS
46 47
QTPLUG=$DIGIKAM_INSTALL_PREFIX/plugins/digikam:$QT_PLUGIN_PATH
DKPLUG=$DIGIKAM_INSTALL_PREFIX/plugins/digikam
48 49 50

KDESYCOCA="\$KCOCA" XDG_DATA_DIRS="\$XDG" QT_PLUGIN_PATH="\$QTPLUG" kbuildsycoca5
echo "Use the following command line to start digiKam:"
51
echo "  KDESYCOCA="\$KCOCA" XDG_DATA_DIRS=\$XDG DK_PLUGIN_PATH=\$DKPLUG $DIGIKAM_INSTALL_PREFIX/bin/digikam"
52 53
echo
echo "or add an alias to your .bashrc file:"
54
echo "  alias digikam-dev=\"KDESYCOCA=\$KCOCA XDG_DATA_DIRS=\$XDG DK_PLUGIN_PATH=\$DKPLUG $DIGIKAM_INSTALL_PREFIX/bin/digikam\""
55 56 57 58 59 60
echo "and start digiKam using \"digikam-dev\""
EOF
chmod u+x finish_install.sh

echo
echo -e "\033[01;32m[Important]\033[00m After compiling and installing digiKam, run the script build/finish_install.sh to finalize the install."