forked from linuxdeploy/linuxdeploy-plugin-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·100 lines (75 loc) · 2.87 KB
/
test.sh
File metadata and controls
executable file
·100 lines (75 loc) · 2.87 KB
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
94
95
96
97
98
99
100
#!/usr/bin/env bash
set -e
if [ "$ARCH" == "" ]; then
echo 'Error: $ARCH is not set'
exit 1
fi
target="$1"
if [ "$target" == "" ]; then
echo 'Usage: $0 <target.AppImage>'
exit 1
fi
set -x
# use RAM disk if possible
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
build_dir="$(mktemp -d -p "$TEMP_BASE" linuxdeploy-plugin-qt-build-XXXXXX)"
cleanup () {
if [ -d "$build_dir" ]; then
rm -rf "$build_dir"
fi
}
trap cleanup EXIT
wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
cp linuxdeploy-"$ARCH".AppImage "$build_dir"
linuxdeploy_bin="$build_dir"/linuxdeploy-"$ARCH".AppImage
chmod +x "$linuxdeploy_bin"
cp "$target" "$build_dir"
pushd "$build_dir"
git clone --depth=1 https://github.com/linuxdeploy/linuxdeploy-plugin-qt-examples.git
## Build projects
pushd linuxdeploy-plugin-qt-examples/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
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr || exit 1
DESTDIR="$PWD"/AppDir make install || exit 1
"$linuxdeploy_bin" --appdir "$PWD"/AppDir --plugin qt --output appimage || exit 1
mv -v *AppImage "$build_dir" || exit 1
popd
popd
pushd linuxdeploy-plugin-qt-examples/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/"$ARCH"-linux-gnu/nss "$PWD"/AppDir/usr/lib/
"$linuxdeploy_bin" --appdir "$PWD"/AppDir --plugin qt --output appimage || exit 1
mv -v *AppImage "$build_dir" || exit 1
popd
popd
pushd linuxdeploy-plugin-qt-examples/QtWidgetsApplication
mkdir build
pushd build
qmake CONFIG+=release PREFIX=/usr ../QtWidgetsApplication.pro || exit 1
INSTALL_ROOT="$PWD"/AppDir make install || exit 1
"$linuxdeploy_bin" --appdir "$PWD"/AppDir --plugin qt --output appimage || exit 1
mv -v *AppImage "$build_dir" || exit 1
popd
mkdir build-platforms
pushd build-platforms
export EXTRA_PLATFORM_PLUGINS="libqoffscreen.so;libqminimal.so"
qmake CONFIG+=release PREFIX=/usr ../QtWidgetsApplication.pro || exit 1
INSTALL_ROOT="$PWD"/AppDir make install || exit 1
env OUTPUT=platforms.AppImage "$linuxdeploy_bin" --appdir "$PWD"/AppDir --plugin qt --output appimage || exit 1
mv -v platforms.AppImage "$build_dir" || exit 1
popd
popd