Skip to content

Commit

Permalink
fix(appimage): Patch snore to enable notifications in AppImage
Browse files Browse the repository at this point in the history
Patch for other builds as well since the patch is harmless and it simplifies
the build script.

Fix qTox#6411
  • Loading branch information
anthonybilinski committed Feb 24, 2022
1 parent f81c9bc commit b05c069
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buildscripts/build_snore_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ else
INSTALL_PREFIX_ARGS=""
fi

patch -Np1 < "$(dirname "$0")"/patches/snore.patch

cmake -DCMAKE_BUILD_TYPE=Release $INSTALL_PREFIX_ARGS \
-DBUILD_daemon=OFF \
-DBUILD_settings=OFF \
Expand Down
3 changes: 3 additions & 0 deletions buildscripts/docker/Dockerfile.almalinux
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RUN dnf --nodocs -y install dnf-plugins-core && \
opus-devel \
libsodium-devel \
libasan \
patch \
ffmpeg-devel \
libexif-devel \
qrencode-devel \
Expand All @@ -47,8 +48,10 @@ RUN dnf --nodocs -y install dnf-plugins-core && \
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

COPY download/common.sh /build/download/common.sh

COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
COPY patches/snore.patch /build/patches/snore.patch
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
Expand Down
1 change: 1 addition & 0 deletions buildscripts/docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ COPY download/common.sh /build/download/common.sh

COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
COPY patches/snore.patch /build/patches/snore.patch
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
Expand Down
1 change: 1 addition & 0 deletions buildscripts/docker/Dockerfile.debian_old
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ COPY download/common.sh /build/download/common.sh

COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
COPY patches/snore.patch /build/patches/snore.patch
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
Expand Down
3 changes: 3 additions & 0 deletions buildscripts/docker/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@ RUN dnf --nodocs -y install dnf-plugins-core && \
kf5-sonnet-devel \
libXScrnSaver-devel \
msgpack-devel \
patch \
sqlite-devel \
sqlcipher-devel && \
dnf clean all

ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

COPY download/common.sh /build/download/common.sh

COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
COPY patches/snore.patch /build/patches/snore.patch
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh && \
Expand Down
1 change: 1 addition & 0 deletions buildscripts/docker/Dockerfile.ubuntu_lts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ COPY download/common.sh /build/download/common.sh

COPY download/download_snore.sh /build/download/download_snore.sh
COPY build_snore_linux.sh /build/build_snore_linux.sh
COPY patches/snore.patch /build/patches/snore.patch
RUN mkdir -p /src/snore && \
cd /src/snore && \
/build/build_snore_linux.sh --system-install && \
Expand Down
26 changes: 26 additions & 0 deletions buildscripts/patches/snore.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- src/libsnore/plugins/plugincontainer.cpp 2022-02-10 14:14:10.157272874 -0800
+++ patched/src/libsnore/plugins/plugincontainer.cpp 2022-02-10 14:14:53.371062246 -0800
@@ -27,6 +27,7 @@
#include <QDir>
#include <QGuiApplication>
#include <QTime>
+#include <QLibraryInfo>

using namespace Snore;

@@ -134,6 +135,7 @@
static QDir path;
if (!isLoaded) {
isLoaded = true;
+ QString pluginDir = QLibraryInfo::location(QLibraryInfo::PluginsPath);
QString appDir = qApp->applicationDirPath();
QStringList list;
#ifdef Q_OS_MAC
@@ -152,6 +154,7 @@
<< appDir + suffix
<< appDir + QStringLiteral("/../lib/plugins") + suffix
<< appDir + QStringLiteral("/../lib64/plugins") + suffix
+ << pluginDir + suffix
<< QStringLiteral(LIBSNORE_PLUGIN_PATH);
foreach(const QString & p, list) {
path = QDir(p);

0 comments on commit b05c069

Please sign in to comment.