File: travis_install_linux_coverage

package info (click to toggle)
gpsbabel 1.7.0%2Bds-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 100,408 kB
  • sloc: cpp: 104,725; xml: 14,055; sh: 4,699; ansic: 2,062; makefile: 960; perl: 681; tcl: 138; javascript: 9
file content (47 lines) | stat: -rwxr-xr-x 1,303 bytes parent folder | download | duplicates (2)
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
#!/bin/bash -ex
#
# This script is run on travis for the install stage of mac builds.
#

#debug failed install
function debug() {
  cat ${CACHEDIR}/qt-${QT_VERSION}.env
  find ${CACHEDIR}/Qt -maxdepth 3 -ls
  cat ${CACHEDIR}/Qt/InstallationLog.txt
  cat ${CACHEDIR}/Qt/components.xml
  echo "$1" >&2
  exit 1
}

# validate install
function validate() {
  (
    set +e
    source ${CACHEDIR}/qt-${QT_VERSION}.env
    if [ "$(qmake -query QT_INSTALL_BINS)" != "${QTDIR}/bin" ]; then
      debug "ERROR: unexpected Qt location."
    fi
    if [ "$(qmake -query QT_VERSION)" != "${QT_VERSION}" ]; then
      debug "ERROR: wrong Qt version."
    fi
  )
}

QT_VERSION=${1:-5.12.2}
QT_VERSION_SHORT=${QT_VERSION//./}

# our expectation is that install-qt creates $QTDIR, $QTDIR/bin.
CACHEDIR=${HOME}/Cache
QTDIR=${CACHEDIR}/Qt/${QT_VERSION}/gcc_64

if [ -d "${QTDIR}/bin" ]; then
  echo "Using cached Qt."
  echo "If you need to clear the cache see"
  echo "https://docs.travis-ci.com/user/caching/#Fetching-and-storing-caches."
else
  rm -fr ${CACHEDIR}
  mkdir -p ${CACHEDIR}
  QT_CI_DOWNLOADER="wget -nv -c" PATH=${TRAVIS_BUILD_DIR}/tools/qtci:${PATH} install-qt-online "qt.qt5.${QT_VERSION_SHORT}.gcc_64" ${CACHEDIR}
  echo "export PATH=${QTDIR}/bin:$PATH" > ${CACHEDIR}/qt-${QT_VERSION}.env
  validate
fi