File: build-app

package info (click to toggle)
sfxr-qt 1.5.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,988 kB
  • sloc: cpp: 48,737; python: 1,885; sh: 385; makefile: 4
file content (56 lines) | stat: -rwxr-xr-x 1,194 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
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -euo pipefail

pushd $PWD > /dev/null
cd $(dirname $0)/..
SRC_DIR=$PWD
popd > /dev/null

. $SRC_DIR/ci/lib/common.sh

BUILD_DIR=$SRC_DIR/build
INSTALL_DIR=$SRC_DIR/inst

BUILD_TYPE=Release

BUILD_CMD="cmake --build . --config $BUILD_TYPE"

echo_title Checking coding style
if has_command clang-format ; then
    $SRC_DIR/ci/check-codingstyle
else
    echo "Skipped, clang-format is not installed"
fi

echo_title Configuring
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR $SRC_DIR

# Disabled for now
# echo_title Updating translations
# $BUILD_CMD --target lupdate

echo_title Building
$BUILD_CMD --parallel $NPROC

echo_title Running tests
test_cmd="$BUILD_CMD --target check"
if is_linux && [ -z "${DISPLAY:-}" ] ; then
    xvfb-run $SRC_DIR/ci/headless-test-helper $test_cmd
else
    $test_cmd
fi

echo_title Installing
$BUILD_CMD --target install

echo_title "Creating binary packages"
$BUILD_CMD --target package

if is_linux ; then
    # No need to build the source package everywhere, arbitrarily decide to
    # build it on Linux
    echo_title "Creating source package"
    $BUILD_CMD --target package_source
fi