Debian Codegraph @

project/bundles/vcpkg/makeall.sh

raw
1 #!/bin/bash
2
3 # Script to run all VCPKG based sub-scripts to build Windows installer.
4 # Possible option : "-f" to force operations without to ask confirmation to user.
5 #
6 # SPDX-FileCopyrightText: 2013-2026 by Gilles Caulier <caulier dot gilles at gmail dot com>
7 #
8 # SPDX-License-Identifier: BSD-3-Clause
9 #
10
11 ########################################################################
12 # Function to upload host log files
13 HostUploadLogFiles()
14 {
15
16 if [[ $DK_UPLOAD = 1 ]] ; then
17
18 echo -e "---------- Cleanup older host logs from files.kde.org repository \n"
19
20 sftp -q $DK_UPLOADURL:$DK_UPLOADDIR/build.logs/win64-Qt6 <<< "rm build-vcpkg.full.log.gz"
21 sftp -q $DK_UPLOADURL:$DK_UPLOADDIR/build.logs/win64-Qt6 <<< "rm build-extralibs.full.log.gz"
22
23 echo -e "---------- Compress host log files \n"
24
25 gzip -k $ORIG_WD/logs/build-mxe.full.log $ORIG_WD/logs/build-vcpkg.full.log.gz || true
26 gzip -k $ORIG_WD/logs/build-extralibs.full.log $ORIG_WD/logs/build-extralibs.full.log.gz || true
27
28 echo -e "---------- Upload new host logs to files.kde.org repository \n"
29
30 UploadWithRetry $ORIG_WD/logs/build-vcpkg.full.log.gz $DK_UPLOADURL $DK_UPLOADDIR/build.logs/win64-Qt6 10
31 UploadWithRetry $ORIG_WD/logs/build-extralibs.full.log.gz $DK_UPLOADURL $DK_UPLOADDIR/build.logs/win64-Qt6 10
32
33 echo -e "---------- Cleanup local bundle log file archives \n"
34
35 rm -f $ORIG_WD/logs/build-vcpkg.full.log.gz || true
36 rm -f $ORIG_WD/logs/build-extralibs.full.log.gz || true
37
38 fi
39
40 }
41
42 # Halt and catch errors
43 set -eE
44 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
45 trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
46 trap HostUploadLogFiles ERR exit
47
48 ORIG_WD="`pwd`"
49
50 . ./config.sh
51 . ./common.sh
52 StartScript
53
54 echo "This script will build from scratch the digiKam installer for Windows using VCPKG."
55 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
56
57 if [ -d "$VCPKG_DIR" ] ; then
58
59 if [ "$1" != "-f" ] ; then
60
61 read -p "$VCPKG_DIR already exist. Do you want to remove it or to continue an aborted previous installation ? [(r)emove/(c)ontinue/(s)top] " answer
62
63 if echo "$answer" | grep -iq "^r" ;then
64
65 echo "---------- Removing existing $VCPKG_BUILDROOT"
66 rm -rf "$VCPKG_DIR"
67
68 elif echo "$answer" | grep -iq "^c" ;then
69
70 echo "---------- Continue aborted previous installation in $VCPKG_DIR"
71 CONTINUE_INSTALL=1
72
73 else
74
75 echo "---------- Aborting..."
76 exit;
77 fi
78
79 fi
80
81 fi
82
83 echo "++++++++++++++++ Build 64 bits Installer ++++++++++++++++++++++++++++++++++"
84 echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
85
86 ./01-build-vcpkg.sh
87 ./02-build-extralibs.sh
88 ./update.sh
89
90 echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
91
92 TerminateScript