Changeset View
Changeset View
Standalone View
Standalone View
packaging/GNU-Linux/appimage/build.sh
| #!/bin/bash | #!/bin/bash | ||||
| set -x | set -x | ||||
| set -e | set -e | ||||
| # Collect deps | # Collect deps | ||||
| wget https://raw.githubusercontent.com/KDE/docker-neon/Neon/stable/public.key && \ | wget https://raw.githubusercontent.com/KDE/docker-neon/Neon/stable/public.key && \ | ||||
| apt-key add public.key && \ | apt-key add public.key && \ | ||||
| rm public.key | rm public.key | ||||
| cp -v packaging/GNU-Linux/appimage/kde-neon.list /etc/apt/sources.list.d/ | DEP_PACKAGES=( | ||||
| extra-cmake-modules | |||||
| wget | |||||
| weston | |||||
| dbus-x11 | |||||
| libcmark-dev | |||||
| ) | |||||
| if [[ $KF_VER == 5 ]]; then | |||||
| DEP_PACKAGES+=( | |||||
| qtbase5-dev | |||||
| qtdeclarative5-dev | |||||
| qtmultimedia5-dev | |||||
| qml-module-qtmultimedia | |||||
| libqt5concurrent5 | |||||
| libqt5gui5 | |||||
| libqt5svg5-dev | |||||
| qtquickcontrols2-5-dev | |||||
| qml-module-qtquick-layouts | |||||
| qml-module-qtquick-controls2 | |||||
| qml-module-qtquick-controls | |||||
| qml-module-qt-labs-qmlmodels | |||||
| kirigami2-dev | |||||
| libkf5config-dev | |||||
| libqt5multimedia5-plugins | |||||
| qt5-gtk-platformtheme | |||||
| plasma-integration | |||||
| libkf5kio-dev | |||||
| qml-module-qttest | |||||
| qml-module-qt-labs-platform | |||||
| libkf5notifications-dev | |||||
| qml-module-qtquick-dialogs | |||||
| qml-module-org-kde-notification | |||||
| ) | |||||
| cp -v packaging/GNU-Linux/appimage/kde-neon-focal.list /etc/apt/sources.list.d/ | |||||
| else | |||||
| DEP_PACKAGES+=( | |||||
| qt6-base-dev | |||||
| qt6-declarative-dev | |||||
| qt6-multimedia-dev | |||||
| qml6-module-qtmultimedia | |||||
| libqt6concurrent6 | |||||
| libqt6gui6 | |||||
| libqt6svg6-dev | |||||
| libqt6quickcontrols2-6 | |||||
| qml6-module-qtquick-controls | |||||
| qml6-module-qtquick-layouts | |||||
| qml6-module-qt-labs-qmlmodels | |||||
| kf6-kirigami2-dev | |||||
| libkf6config-dev | |||||
| qt6-gtk-platformtheme | |||||
| plasma-integration | |||||
| libkf6kio-dev | |||||
| qml6-module-qttest | |||||
| qml6-module-qt-labs-platform | |||||
| libkf6notifications-dev | |||||
| qml6-module-qtquick-dialogs | |||||
| qml6-module-org-kde-notification | |||||
| kf6-kirigami-addons-dev | |||||
| cmark | |||||
| ) | |||||
| export QMAKE=qmake6 | |||||
| cp -v packaging/GNU-Linux/appimage/kde-neon-jammy.list /etc/apt/sources.list.d/ | |||||
| fi | |||||
| apt-get update && \ | apt-get update && \ | ||||
| apt-get -y upgrade && \ | apt-get -y upgrade && \ | ||||
| DEBIAN_FRONTEND="noninteractive" \ | DEBIAN_FRONTEND="noninteractive" \ | ||||
| apt-get -y install aptitude && \ | apt-get -y install aptitude && \ | ||||
| aptitude -y install extra-cmake-modules \ | aptitude -y install "${DEP_PACKAGES[@]}" | ||||
| qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qml-module-qtmultimedia libqt5concurrent5 libqt5gui5 \ | |||||
| libqt5svg5-dev qtquickcontrols2-5-dev qml-module-qtquick-layouts qml-module-qtquick-controls2 \ | |||||
| qml-module-qtquick-controls qml-module-qt-labs-qmlmodels kirigami2-dev libkf5config-dev wget libqt5multimedia5-plugins \ | |||||
| qt5-gtk-platformtheme plasma-integration libkf5kio-dev g++-10 weston dbus-x11 qml-module-qttest qml-module-qt-labs-platform \ | |||||
| libkf5notifications-dev qml-module-qtquick-dialogs qml-module-org-kde-notification libcmark-dev | |||||
| # Actual build | # Actual build | ||||
| mkdir -pv /run/user/test | mkdir -pv /run/user/test | ||||
| export XDG_RUNTIME_DIR=/run/user/test | export XDG_RUNTIME_DIR=/run/user/test | ||||
| thisDir="$(readlink -f "$(dirname "$(realpath "$0")")")" | thisDir="$(readlink -f "$(dirname "$(realpath "$0")")")" | ||||
| BUILD_TYPE="$1" | BUILD_TYPE="$1" | ||||
| if [[ ! "$BUILD_TYPE" ]]; then | if [[ ! "$BUILD_TYPE" ]]; then | ||||
| export BUILD_TYPE=Debug | export BUILD_TYPE=Debug | ||||
| fi | fi | ||||
| export JOBS=${JOBS:-$(( $(nproc) / 2))} DEPS_INSTALL_DIR=/opt/libkazv-deps LIBKAZV_INSTALL_DIR=/opt/libkazv KAZV_INSTALL_DIR=/usr | export JOBS=${JOBS:-$(( $(nproc) / 2))} DEPS_INSTALL_DIR=/opt/libkazv-deps LIBKAZV_INSTALL_DIR=/opt/libkazv KAZV_INSTALL_DIR=/usr | ||||
| export LD_LIBRARY_PATH="$LIBKAZV_INSTALL_DIR/lib:$DEPS_INSTALL_DIR/lib" | export LD_LIBRARY_PATH="$LIBKAZV_INSTALL_DIR/lib:$DEPS_INSTALL_DIR/lib" | ||||
| mkdir build && cd build && \ | mkdir build && cd build && \ | ||||
| cmake .. -DCMAKE_INSTALL_PREFIX="$KAZV_INSTALL_DIR" \ | cmake .. -DCMAKE_INSTALL_PREFIX="$KAZV_INSTALL_DIR" \ | ||||
| -DCMAKE_PREFIX_PATH="$LIBKAZV_INSTALL_DIR;$DEPS_INSTALL_DIR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE && \ | -DCMAKE_PREFIX_PATH="$LIBKAZV_INSTALL_DIR;$DEPS_INSTALL_DIR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Dkazv_KF_QT_MAJOR_VERSION=$KF_VER && \ | ||||
| make -j$JOBS && \ | make -j$JOBS && \ | ||||
| make -j$JOBS DESTDIR=AppDir install && \ | make -j$JOBS DESTDIR=AppDir install && \ | ||||
| dbus-launch --exit-with-session -- bash "$thisDir"/test.sh | dbus-launch --exit-with-session -- bash "$thisDir"/test.sh | ||||
| wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | ||||
| wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | ||||
| chmod +x linuxdeploy*.AppImage | chmod +x linuxdeploy*.AppImage | ||||
| export QML_SOURCES_PATHS=../src | export QML_SOURCES_PATHS=../src | ||||
| ./linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract | ./linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract | ||||
| ./linuxdeploy-x86_64.AppImage --appimage-extract | ./linuxdeploy-x86_64.AppImage --appimage-extract | ||||
| # https://github.com/linuxdeploy/linuxdeploy/issues/154 | # https://github.com/linuxdeploy/linuxdeploy/issues/154 | ||||
| mv -v ./linuxdeploy-plugin-qt-x86_64.AppImage ./linuxdeploy-notplugin-qt-x86_64.AppImage | mv -v ./linuxdeploy-plugin-qt-x86_64.AppImage ./linuxdeploy-notplugin-qt-x86_64.AppImage | ||||
| # Enable the appimage to use Plasma themes, linuxdeploy-plugin-qt will only copy the gtk3 plugin -(( | # Enable the appimage to use Plasma themes, linuxdeploy-plugin-qt will only copy the gtk3 plugin -(( | ||||
| mkdir -pv AppDir/usr/plugins/platformthemes/ | mkdir -pv AppDir/usr/plugins/platformthemes/ | ||||
| cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so AppDir/usr/plugins/platformthemes/ | cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/KDEPlasmaPlatformTheme.so AppDir/usr/plugins/platformthemes/ || true | ||||
| cp /usr/lib/x86_64-linux-gnu/qt6/plugins/platformthemes/KDEPlasmaPlatformTheme6.so AppDir/usr/plugins/platformthemes/ || true | |||||
| # Workaround "cannot mix incompatible qt versions" problem | # Workaround "cannot mix incompatible qt versions" problem | ||||
| mkdir -pv AppDir/apprun-hooks/ | mkdir -pv AppDir/apprun-hooks/ | ||||
| cp -v "$thisDir"/hooks/patch-ld-library-path.sh AppDir/apprun-hooks/ | cp -v "$thisDir"/hooks/patch-ld-library-path.sh AppDir/apprun-hooks/ | ||||
| ./squashfs-root/AppRun --appdir AppDir -i ../icons/kazvlogo-256.png --plugin qt --output appimage # -l /lib/x86_64-linux-gnu/libstdc++.so.6 | ./squashfs-root/AppRun --appdir AppDir -i ../icons/kazvlogo-256.png --plugin qt --output appimage # -l /lib/x86_64-linux-gnu/libstdc++.so.6 | ||||
| cp kazv*.AppImage ../kazv-"$BUILD_TYPE".AppImage | cp kazv*.AppImage ../kazv-"$BUILD_TYPE".AppImage | ||||