forked from c-koi/gmic-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.macports
executable file
·93 lines (74 loc) · 2.77 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
#!/bin/bash
# SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Arguments : $1 : install path '/opt/digikam.org.x86_64' (default).
# $2 : build type 'Debug' to hack (default), 'Release' for production.
# $3 : target type 'x86_64' for macOS Lion Intel and later (default), 'universal' for macOS BigSur Silicon and latter.
# $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.org.arm64"
BUNDLE_INSTALL_DIR="/Applications/digiKam.org"
BUNDLE_DATA_INSTALL_DIR="/Library/Application Support"
else
BUNDLE_INSTALL_DIR="${INSTALL_PREFIX}/Applications/digiKam.org"
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=arm64
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/qt6:$INSTALL_PREFIX/libexec/qt5
export QT_INCLUDE_DIR=$QTDIR/include
export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
# Paths 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_WITH_CCACHE=OFF \
-DBUILD_WITH_QT6=ON \
-DENABLE_ASAN=OFF \
-DENABLE_SYSTEM_GMIC=OFF \
-DENABLE_CURL=OFF \
-DGMIC_QT_HOST=digikam \
-DBUILD_WITH_QT6=ON \
-DBUILD_TESTING=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