-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_appimages.sh
executable file
·72 lines (53 loc) · 2.21 KB
/
build_appimages.sh
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
#! /bin/bash
ARCH="x86_64"
BASE_DIR=${PWD}
mkdir -p ${BASE_DIR}/out
# Download tools
wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
chmod +x linuxdeploy-"$ARCH".AppImage
wget -N https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-"$ARCH".AppImage
chmod +x linuxdeploy-plugin-qt-"$ARCH".AppImage
LINUXDEPLOY_BIN=${PWD}/linuxdeploy-"$ARCH".AppImage
LINUXDEPLOY_PLUGIN_QT_BIN=${PWD}/linuxdeploy-plugin-qt-"$ARCH".AppImage
build_appimage() {
APP_NAME=$1
APP_DIR=$2
echo "Building AppImage for ${APP_NAME}"
${LINUXDEPLOY_BIN} --appdir ${APP_DIR} --plugin qt --output appimage || return 1
mv -v *AppImage ${BASE_DIR}/out || return 1
}
### Build projects
pushd QtQuickControls2Application
# This env variable is used by the qt plugin to search the qml sources in other paths than the AppDir
# it's mandatory to use when your qml files are embed as Qt resources into the main binary.
export QML_SOURCES_PATHS="${PWD}/src"
# This env variable is used by the qt plugin to search the qml modules in other paths than the default
# Qt qml dir.
export QML_MODULES_PATHS="${QML_MODULES_PATHS}"
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr || exit 1
DESTDIR=AppDir make install || exit 1
build_appimage QtQuickControls2Application ${PWD}/AppDir || exit 1
popd
popd
pushd QtWebEngineApplication
export QML_SOURCES_PATHS="${PWD}"
mkdir build
pushd build
qmake CONFIG+=release PREFIX=/usr ../QtWebEngineApplication.pro || exit 1
INSTALL_ROOT=${PWD}/AppDir make install || exit 1
# Include libnss related files
mkdir -p ${PWD}/AppDir/usr/lib/
cp -r /usr/lib/x86_64-linux-gnu/nss ${PWD}/AppDir/usr/lib/
build_appimage QtWebEngineApplication ${PWD}/AppDir || exit 1
popd
popd
pushd QtWidgetsApplication
mkdir build
pushd build
qmake CONFIG+=release PREFIX=/usr ../QtWidgetsApplication.pro || exit 1
INSTALL_ROOT=${PWD}/AppDir make install || exit 1
build_appimage QtWidgetsApplication ${PWD}/AppDir || exit 1
popd
popd