Added a special desktop action (Run GoldenDict on X11).

Created PR to upstream:
https://github.com/goldendict/goldendict/pull/1238.
f39
Vitaly Zaitsev 5 years ago
parent 766926d4da
commit 863d90a2e7
No known key found for this signature in database
GPG Key ID: BF99FC6DD45AB90A

@ -0,0 +1,28 @@
From a1c7c5b3762c292c2620af41428c3c6c3f758f04 Mon Sep 17 00:00:00 2001
From: Vitaly Zaitsev <vitaly@easycoding.org>
Date: Sun, 15 Mar 2020 10:15:58 +0100
Subject: [PATCH] Added a desktop action as a workaround to crashes on Wayland.
Also removed deprecated Encoding directive from desktop file.
Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
---
redist/goldendict.desktop | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/redist/goldendict.desktop b/redist/goldendict.desktop
index e4cbd42b..13a5fe8f 100755
--- a/redist/goldendict.desktop
+++ b/redist/goldendict.desktop
@@ -5,6 +5,10 @@ Categories=Office;Dictionary;Education;Qt;
Name=GoldenDict
GenericName=Multiformat Dictionary
Comment=GoldenDict
-Encoding=UTF-8
Icon=goldendict
Exec=goldendict
+Actions=X11;
+
+[Desktop Action X11]
+Name=GoldenDict (X11)
+Exec=env QT_QPA_PLATFORM=xcb goldendict

@ -9,6 +9,9 @@ License: GPLv3+
URL: http://goldendict.org URL: http://goldendict.org
Source0: https://github.com/%{owner}/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz Source0: https://github.com/%{owner}/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
# https://github.com/goldendict/goldendict/pull/1238
Patch100: %{name}-add-x11-action.patch
BuildRequires: cmake(Qt5LinguistTools) BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: cmake(Qt5XmlPatterns) BuildRequires: cmake(Qt5XmlPatterns)
BuildRequires: cmake(Qt5Multimedia) BuildRequires: cmake(Qt5Multimedia)
@ -56,7 +59,6 @@ Contain doc files of %{name}.
%autosetup -n %{name}-%{commit} -p1 %autosetup -n %{name}-%{commit} -p1
rm -r qtsingleapplication rm -r qtsingleapplication
sed -e '/qtsingleapplication.pri/d' -i %{name}.pro sed -e '/qtsingleapplication.pri/d' -i %{name}.pro
cp redist/%{name}.desktop redist/%{name}-x11.desktop
%build %build
%qmake_qt5 PREFIX=%{_prefix} CONFIG+=qtsingleapplication CONFIG+=no_ffmpeg_player %{name}.pro %qmake_qt5 PREFIX=%{_prefix} CONFIG+=qtsingleapplication CONFIG+=no_ffmpeg_player %{name}.pro
@ -65,11 +67,10 @@ cp redist/%{name}.desktop redist/%{name}-x11.desktop
%install %install
%make_install INSTALL_ROOT=%{buildroot} %make_install INSTALL_ROOT=%{buildroot}
rm -rf %{buildroot}%{_datadir}/app-install rm -rf %{buildroot}%{_datadir}/app-install
desktop-file-install --set-key=Exec --set-value="env QT_QPA_PLATFORM=xcb %{name}" --set-name="GoldenDict (X11)" --add-only-show-in="GNOME;" --dir=%{buildroot}%{_datadir}/applications redist/%{name}-x11.desktop
%check %check
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
%files %files
%license LICENSE.txt %license LICENSE.txt
@ -78,7 +79,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%{_datadir}/%{name}/locale %{_datadir}/%{name}/locale
%{_metainfodir}/%{name}.appdata.xml %{_metainfodir}/%{name}.appdata.xml
%{_datadir}/applications/*.desktop %{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png %{_datadir}/pixmaps/%{name}.png
%files docs %files docs

Loading…
Cancel
Save