@@ -7,8 +7,8 @@ if [ "$ARCH" == "" ]; then
77 exit 1
88fi
99
10- TARGET =" $1 "
11- if [ " $TARGET " == " " ]; then
10+ target =" $1 "
11+ if [ " $target " == " " ]; then
1212 echo ' Usage: $0 <target.AppImage>'
1313 exit 1
1414fi
2222 TEMP_BASE=/tmp
2323fi
2424
25- BUILD_DIR= $( mktemp -d -p " $TEMP_BASE " linuxdeploy-plugin-qt-build-XXXXXX)
25+ build_dir= " $( mktemp -d -p " $TEMP_BASE " linuxdeploy-plugin-qt-build-XXXXXX) "
2626
2727cleanup () {
28- if [ -d " $BUILD_DIR " ]; then
29- rm -rf " $BUILD_DIR "
28+ if [ -d " $build_dir " ]; then
29+ rm -rf " $build_dir "
3030 fi
3131}
3232
3333trap cleanup EXIT
3434
3535wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-" $ARCH " .AppImage
36- export LINUXDEPLOY_BIN=" $PWD " /linuxdeploy-" $ARCH " .AppImage
37- chmod +x " $LINUXDEPLOY_BIN "
3836
39- pushd " $BUILD_DIR "
37+ cp linuxdeploy- " $ARCH " .AppImage " $build_dir "
4038
41- git clone --depth=1 https://github.com/linuxdeploy/linuxdeploy-plugin-qt-examples.git
39+ linuxdeploy_bin=" $build_dir " /linuxdeploy-" $ARCH " .AppImage
40+ chmod +x " $linuxdeploy_bin "
4241
43- source /opt/qt5* /bin/qt5* -env.sh || echo " " # hack required, the script returns 1 for some reason
44- qt5_ver=$( echo " $QT_BASE_DIR " | cut -d/ -f3 | cut -d5 -f2-)
45- mkdir -p " $HOME " /.config/qtchooser
46- echo " ${QTDIR} /bin" > " $HOME " /.config/qtchooser/qt5." $qt5_ver " .conf
47- echo " ${QTDIR} /lib" >> " $HOME " /.config/qtchooser/qt5." $qt5_ver " .conf
42+ cp " $target " " $build_dir "
4843
49- export CMAKE_PREFIX_PATH=" $QTDIR " /lib/cmake
50- export QT_SELECT=qt5." $qt5_ver "
44+ pushd " $build_dir "
5145
46+ git clone --depth=1 https://github.com/linuxdeploy/linuxdeploy-plugin-qt-examples.git
5247
5348# # Build projects
5449pushd linuxdeploy-plugin-qt-examples/QtQuickControls2Application
@@ -61,8 +56,8 @@ pushd linuxdeploy-plugin-qt-examples/QtQuickControls2Application
6156 cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr || exit 1
6257 DESTDIR=" $PWD " /AppDir make install || exit 1
6358
64- " $LINUXDEPLOY_BIN " --appdir " $PWD " /AppDir --plugin qt --output appimage || exit 1
65- mv -v * AppImage " $BUILD_DIR " || exit 1
59+ " $linuxdeploy_bin " --appdir " $PWD " /AppDir --plugin qt --output appimage || exit 1
60+ mv -v * AppImage " $build_dir " || exit 1
6661 popd
6762popd
6863
@@ -76,10 +71,10 @@ pushd linuxdeploy-plugin-qt-examples/QtWebEngineApplication
7671
7772 # Include libnss related files
7873 mkdir -p " $PWD " /AppDir/usr/lib/
79- cp -r /usr/lib/x86_64 -linux-gnu/nss " $PWD " /AppDir/usr/lib/
74+ cp -r /usr/lib/" $ARCH " -linux-gnu/nss " $PWD " /AppDir/usr/lib/
8075
81- " $LINUXDEPLOY_BIN " --appdir " $PWD " /AppDir --plugin qt --output appimage || exit 1
82- mv -v * AppImage " $BUILD_DIR " || exit 1
76+ " $linuxdeploy_bin " --appdir " $PWD " /AppDir --plugin qt --output appimage || exit 1
77+ mv -v * AppImage " $build_dir " || exit 1
8378 popd
8479popd
8580
@@ -89,7 +84,7 @@ pushd linuxdeploy-plugin-qt-examples/QtWidgetsApplication
8984 qmake CONFIG+=release PREFIX=/usr ../QtWidgetsApplication.pro || exit 1
9085 INSTALL_ROOT=" $PWD " /AppDir make install || exit 1
9186
92- " $LINUXDEPLOY_BIN " --appdir " $PWD " /AppDir --plugin qt --output appimage || exit 1
93- mv -v * AppImage " $BUILD_DIR " || exit 1
87+ " $linuxdeploy_bin " --appdir " $PWD " /AppDir --plugin qt --output appimage || exit 1
88+ mv -v * AppImage " $build_dir " || exit 1
9489 popd
9590popd
0 commit comments