This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
bootstrap.macports
executable file
·102 lines (83 loc) · 3.06 KB
/
bootstrap.macports
1
2
3
4
5
6
7
8
9
10
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Copyright (c) 2008-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# Arguments : $1 : install path '/opt/digikam' (default).
# $2 : build type 'debug' to hack (default), 'release' for production.
# $3 : target type 'x86_64' for OSX Lion (default), 'i386' for Snow Leopard.
# $4 : Cmake extra configure options.
# Halt and catch errors
set -eE
trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
INSTALL_PREFIX=$1
if [ "$INSTALL_PREFIX" = "" ]; then
INSTALL_PREFIX="/opt/digikam"
BUNDLE_INSTALL_DIR="/Applications/KF5"
BUNDLE_DATA_INSTALL_DIR="/Library/Application Support"
else
BUNDLE_INSTALL_DIR="${INSTALL_PREFIX}/Applications/KF5"
BUNDLE_DATA_INSTALL_DIR="${INSTALL_PREFIX}/Library/Application Support"
fi
BUILD_TYPE=$2
if [ "$BUILD_TYPE" = "" ]; then
BUILD_TYPE=debug
fi
TARGET_TYPE=$3
if [ "$TARGET_TYPE" = "" ]; then
TARGET_TYPE=x86_64
fi
OPTIONS=$4
echo "Installing to $INSTALL_PREFIX for target $TARGET_TYPE with build mode $BUILD_TYPE and compilation options $OPTIONS"
# set devel env from MacOS-X through MacPorts
export QTDIR=$INSTALL_PREFIX/libexec/qt5
export QT_INCLUDE_DIR=$QTDIR/include
export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
# Pathes rules
ORIG_PATH="$PATH"
export PATH=$INSTALL_PREFIX/bin:$QTDIR/bin:$PATH
# We will work on command line using GNU make
export MAKEFILES_TYPE='Unix Makefiles'
if [ ! -d "build" ]; then
mkdir build
fi
cd build
cmake -G "$MAKEFILES_TYPE" . \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}/ \
-DCMAKE_OSX_ARCHITECTURES=${TARGET_TYPE} \
-DBUILD_TESTING=ON \
-DDIGIKAMSC_CHECKOUT_PO=OFF \
-DDIGIKAMSC_CHECKOUT_DOC=OFF \
-DDIGIKAMSC_COMPILE_PO=OFF \
-DDIGIKAMSC_COMPILE_DOC=OFF \
-DDIGIKAMSC_COMPILE_DIGIKAM=ON \
-DENABLE_KFILEMETADATASUPPORT=OFF \
-DENABLE_AKONADICONTACTSUPPORT=OFF \
-DENABLE_INTERNALMYSQL=ON \
-DENABLE_MYSQLSUPPORT=ON \
-DENABLE_MEDIAPLAYER=ON \
-DENABLE_DBUS=OFF \
-DENABLE_KIO=OFF \
-DENABLE_APPSTYLES=OFF \
-DENABLE_QWEBENGINE=OFF \
-DENABLE_FACESENGINE_DNN=ON \
-DAPPLE_SUPPRESS_X11_WARNING=ON \
-DCMAKE_COLOR_MAKEFILE=ON \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_INSTALL_NAME_DIR=${INSTALL_PREFIX}/lib \
-DCMAKE_SYSTEM_PREFIX_PATH="${INSTALL_PREFIX};/usr" \
-DCMAKE_MODULE_PATH="${INSTALL_PREFIX}/share/cmake/Modules;${INSTALL_PREFIX}/share/cmake-3.7/Modules" \
-DKDE_INSTALL_BUNDLEDIR=${BUNDLE_INSTALL_DIR} \
-DKDE_INSTALL_DATADIR=${BUNDLE_DATA_INSTALL_DIR} \
-DQT_QT_INCLUDE_DIR=${QT_INCLUDE_DIR} \
-DQT_LIBRARY_DIR=${QTDIR}/lib \
-DQT_QMAKE_EXECUTABLE=${QTDIR}/bin/qmake \
-Wno-dev \
${OPTIONS} \
..
CMAKE_VAL_RET=$?
export PATH=$ORIG_PATH
exit $CMAKE_VAL_RET