From ce94b44997826839f2c0dd2c1137e9735e01046e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Sat, 16 Jul 2022 22:03:33 +0200 Subject: [PATCH] almost working --- scripts/Dockerfile | 2 +- scripts/build-appimage.sh | 12 +++++++++--- scripts/prepare-container.sh | 20 ++++++++++++-------- src/mainwindow.cpp | 2 +- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index ec3c4ba..49cbd0e 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:jammy +FROM debian:11 ADD ./prepare-container.sh /tmp/prepare-container.sh RUN /tmp/prepare-container.sh WORKDIR /work diff --git a/scripts/build-appimage.sh b/scripts/build-appimage.sh index 275c0d0..62fb625 100755 --- a/scripts/build-appimage.sh +++ b/scripts/build-appimage.sh @@ -16,10 +16,16 @@ fi tmpdir="$(mktemp -d)" builddir="$tmpdir/build" appdir="$tmpdir/AppDir" +export CMAKE_GENERATOR="Ninja" cmake -B "$builddir" -S "$PWD" cmake --build "$builddir" --config Release DESTDIR="$appdir" cmake --install "$builddir" --prefix "/usr" -mkdir -p "$appdir/usr/share/doc/libc6" -touch "$appdir/usr/share/doc/libc6/copyright" -VERSION="$(cat version)" linuxdeployqt "$appdir/usr/share/applications/discord-screenaudio.desktop" -appimage -extra-plugins=iconengines,platformthemes/libqgtk3.so -unsupported-allow-new-glibc +VERSION="$(cat version)" linuxdeploy \ + --appdir "$appdir" \ + --icon-file "assets/discord.png" \ + --plugin qt \ + --library "/usr/lib/x86_64-linux-gnu/nss/libsoftokn3.so" \ + --library "/usr/lib/x86_64-linux-gnu/nss/libnssckbi.so" \ + --exclude-library "libpipewire-0.3.so.0" \ + --output appimage diff --git a/scripts/prepare-container.sh b/scripts/prepare-container.sh index 98bb63a..1c7b6e2 100755 --- a/scripts/prepare-container.sh +++ b/scripts/prepare-container.sh @@ -16,16 +16,20 @@ fi echo "-> Installing dependencies with apt..." export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y curl build-essential qtbase5-dev qtwebengine5-dev qt5-qmake cmake pkg-config git libpipewire-0.3-dev file +apt-get install -y curl build-essential qtbase5-dev qtwebengine5-dev qt5-qmake cmake ninja-build pkg-config git libpipewire-0.3-dev file -echo "-> Installing linuxdeployqt..." +echo "-> Installing linuxdeploy..." tmpdir="$(mktemp -d)" -curl -Lo "$tmpdir/linuxdeployqt.AppImage" "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -chmod +x "$tmpdir/linuxdeployqt.AppImage" -sed '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' -i -i "$tmpdir/linuxdeployqt.AppImage" -(cd "$tmpdir" && ./linuxdeployqt.AppImage --appimage-extract) -mv -v "$tmpdir/squashfs-root" "/opt/linuxdeployqt" -ln -sv "/opt/linuxdeployqt/AppRun" "/usr/local/bin/linuxdeployqt" +install_appimage() { + curl -Lo "$tmpdir/$1.AppImage" "$2" + chmod +x "$tmpdir/$1.AppImage" + sed '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' -i -i "$tmpdir/$1.AppImage" + (cd "$tmpdir" && ./$1.AppImage --appimage-extract) + mv -v "$tmpdir/squashfs-root" "/opt/$1" + ln -sv "/opt/$1/AppRun" "/usr/local/bin/$1" +} +install_appimage "linuxdeploy" "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" +install_appimage "linuxdeploy-plugin-qt" "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" echo "-> Cleaning up..." rm -rf "$tmpdir" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1a263ed..533fbbf 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -24,7 +24,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { void MainWindow::setupWebView() { m_webView = new QWebEngineView(this); - auto page = new DiscordPage; + auto page = new DiscordPage(this); m_webView->setPage(page); setCentralWidget(m_webView); }