app-editors/kile: Assorted fixes while upstream fails to release

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2018-12-19 14:00:17 +01:00
parent ff053e71df
commit fa657ca5f6
7 changed files with 324 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
From 2ec4c207d380bf3b97435fdf66cdb00975a1aff3 Mon Sep 17 00:00:00 2001
From: Michel Ludwig <michel.ludwig@kdemail.net>
Date: Sun, 13 May 2018 11:59:06 +0200
Subject: Silence CMake's CMP0071 policy warning
---
src/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e1fdeb3..1398384 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -188,6 +188,9 @@ set(kile_KCFG_SRCS kileconfig.kcfgc)
kconfig_add_kcfg_files(kile_SRCS ${kile_KCFG_SRCS})
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/kileconfig.h" PROPERTIES SKIP_AUTOMOC ON) # otherwise we get a warning about
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/kileconfig.cpp" PROPERTIES SKIP_AUTOMOC ON) # the CMP0071 policy (with CMake 3.11)
+
# add icon to executable on windows and mac;
# workaround: as ecm_add_app_icon and kf5_add_kdeinit_executable don't work well together,
# we use a variable named 'kile' at this point
--
cgit v1.1

View File

@@ -0,0 +1,24 @@
From 166f57db638dd6bd06363bc207939cabb1df9c81 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Mon, 14 May 2018 09:51:24 +0200
Subject: Remove X-DBUS-StartupType from desktop file
Fixes "KInit could not launch /usr/bin/kile" error when trying to open a tex file when kile is already running
Differential Revision: https://phabricator.kde.org/D8080
---
src/org.kde.kile.desktop | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/org.kde.kile.desktop b/src/org.kde.kile.desktop
index 790bb5e..6d4fe9c 100644
--- a/src/org.kde.kile.desktop
+++ b/src/org.kde.kile.desktop
@@ -177,5 +177,4 @@ GenericName[zh_CN]=LaTeX 前端
GenericName[zh_TW]=LaTeX 前端介面
MimeType=text/x-tex;text/x-kilepr;
Categories=Qt;KDE;Office;Publishing;
-X-DBUS-StartupType=Multi
X-DBUS-ServiceName=net.sourceforge.kile
--
cgit v1.1

View File

@@ -0,0 +1,49 @@
From 21d62face41ffd9e858108f2d45a9abe50ba0db3 Mon Sep 17 00:00:00 2001
From: Harald Sitter <sitter@kde.org>
Date: Mon, 19 Nov 2018 14:00:56 +0100
Subject: actually initialize kcrash properly
Summary:
to successfully use kcrash when linking with as-needed (which is a default
flag on many linux distros) one also needs to call KCrash::initialize.
without this kcrash handling is not available for most users.
https://markmail.org/thread/zv5pheijaze72bzs
Reviewers: mludwig
Reviewed By: mludwig
Subscribers: #kile
Tags: #kile
Differential Revision: https://phabricator.kde.org/D17011
---
src/main.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/main.cpp b/src/main.cpp
index 3b02716..bd7fef6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -25,6 +25,7 @@
#include <QUrl>
#include <KAboutData>
+#include <KCrash>
#include <KDBusService>
#include <KEncodingProber>
#include <KLocalizedString>
@@ -128,6 +129,8 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
KAboutData::setApplicationData(aboutData);
+ KCrash::initialize();
+
app.setApplicationDisplayName(aboutData.displayName());
app.setOrganizationDomain(aboutData.organizationDomain());
app.setApplicationVersion(aboutData.version());
--
cgit v1.1

View File

@@ -0,0 +1,26 @@
From 7cfc3f74f00d13cfb1a43f01a7dbc0be486c0d47 Mon Sep 17 00:00:00 2001
From: Pino Toscano <pino@kde.org>
Date: Mon, 8 Oct 2018 07:42:41 +0200
Subject: User menu: do not attempt to load an empty file name
Do not try to install m_currentXmlFile in case it is empty, otherwise
QFile will (rightfully) warn that an empty file was passed.
---
src/usermenu/usermenu.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/usermenu/usermenu.cpp b/src/usermenu/usermenu.cpp
index 7d1d5f5..f9e3d3c 100644
--- a/src/usermenu/usermenu.cpp
+++ b/src/usermenu/usermenu.cpp
@@ -190,7 +190,7 @@ void UserMenu::updateGUI()
clear();
// then install
- if(installXml(m_currentXmlFile)) {
+ if(!m_currentXmlFile.isEmpty() && installXml(m_currentXmlFile)) {
// add changed context menu to all existing views
KileView::Manager* viewManager = m_ki->viewManager();
int views = viewManager->textViewCount();
--
cgit v1.1

View File

@@ -0,0 +1,29 @@
From 03e7b00321c5474330c97812b4e6a6550e54931c Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Wed, 19 Dec 2018 13:36:12 +0100
Subject: [PATCH] Disable install misc files by cmake
AUTHORS, README, Changelog etc. are handled by distribution packages.
---
CMakeLists.txt | 8 --------
1 file changed, 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f4a278e1..bb78d839 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,11 +117,4 @@ install(
DESTINATION ${KDE_INSTALL_DATAROOTDIR}/kconf_update)
-install(FILES
- AUTHORS
- ChangeLog
- README
- README.cwl
- kile-remote-control.txt
- DESTINATION ${KDE_INSTALL_DATAROOTDIR}/doc/kile)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
--
2.20.1

View File

@@ -0,0 +1,98 @@
From f9de688e223be3b77268d36e237a838555d0f533 Mon Sep 17 00:00:00 2001
From: Michel Ludwig <michel.ludwig@kdemail.net>
Date: Sun, 28 Oct 2018 19:58:22 +0100
Subject: Search for the 'file_save_copy_as' action inside 'KTextEditor::View'
now
In that way, Kile doesn't crash after right-clicking on a view tab
BUG: 400191
---
src/kileviewmanager.cpp | 47 +++++++++++++++++++++++++++++------------------
1 file changed, 29 insertions(+), 18 deletions(-)
diff --git a/src/kileviewmanager.cpp b/src/kileviewmanager.cpp
index c0b8254..34f8439 100644
--- a/src/kileviewmanager.cpp
+++ b/src/kileviewmanager.cpp
@@ -506,39 +506,52 @@ void Manager::tabContext(const QPoint &pos)
// 'action1' can become null if it belongs to a view that has been closed, for example
QPointer<QAction> action1 = m_ki->mainWindow()->action("move_view_tab_left");
- action1->setData(qVariantFromValue(view));
- tabMenu.addAction(action1);
+ if(action1) {
+ action1->setData(qVariantFromValue(view));
+ tabMenu.addAction(action1);
+ }
QPointer<QAction> action2 = m_ki->mainWindow()->action("move_view_tab_right");
- action2->setData(qVariantFromValue(view));
- tabMenu.addAction(action2);
+ if(action2) {
+ action2->setData(qVariantFromValue(view));
+ tabMenu.addAction(action2);
+ }
tabMenu.addSeparator();
QPointer<QAction> action3;
if(view->document()->isModified()) {
action3 = view->actionCollection()->action(KStandardAction::name(KStandardAction::Save));
- action3->setData(qVariantFromValue(view));
- tabMenu.addAction(action3);
+ if(action3) {
+ action3->setData(qVariantFromValue(view));
+ tabMenu.addAction(action3);
+ }
}
QPointer<QAction> action4 = view->actionCollection()->action(KStandardAction::name(KStandardAction::SaveAs));
- action4->setData(qVariantFromValue(view));
- tabMenu.addAction(action4);
+ if(action4) {
+ action4->setData(qVariantFromValue(view));
+ tabMenu.addAction(action4);
+ }
- QPointer<QAction> action5 = m_ki->mainWindow()->action("file_save_copy_as");
- action5->setData(qVariantFromValue(view));
- tabMenu.addAction(action5);
+ QPointer<QAction> action5 = view->action("file_save_copy_as");
+ if(action5) {
+ tabMenu.addAction(action5);
+ }
tabMenu.addSeparator();
QPointer<QAction> action6 = m_ki->mainWindow()->action("file_close");
- action6->setData(qVariantFromValue(view));
- tabMenu.addAction(action6);
+ if(action6) {
+ action6->setData(qVariantFromValue(view));
+ tabMenu.addAction(action6);
+ }
QPointer<QAction> action7 = m_ki->mainWindow()->action("file_close_all_others");
- action7->setData(qVariantFromValue(view));
- tabMenu.addAction(action7);
+ if(action7) {
+ action7->setData(qVariantFromValue(view));
+ tabMenu.addAction(action7);
+ }
/*
FIXME create proper actions which delete/add the current file without asking stupidly
QAction* removeAction = m_ki->mainWindow()->action("project_remove");
@@ -562,9 +575,7 @@ void Manager::tabContext(const QPoint &pos)
if(action4) {
action4->setData(QVariant());
}
- if(action5) {
- action5->setData(QVariant());
- }
+ // action5 doesn't need to be given extra data
if(action6) {
action6->setData(QVariant());
}
--
cgit v1.1

View File

@@ -0,0 +1,73 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
KDE_HANDBOOK="forceoptional"
inherit kde5
DESCRIPTION="Latex Editor and TeX shell based on KDE Frameworks"
HOMEPAGE="https://kile.sourceforge.io/"
[[ ${PV} != *9999* ]] && SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
LICENSE="FDL-1.2 GPL-2"
KEYWORDS="~amd64 ~x86"
IUSE="+pdf +png"
DEPEND="
$(add_frameworks_dep kconfig)
$(add_frameworks_dep kcoreaddons)
$(add_frameworks_dep kcrash)
$(add_frameworks_dep kdbusaddons)
$(add_frameworks_dep kdoctools)
$(add_frameworks_dep kguiaddons)
$(add_frameworks_dep khtml)
$(add_frameworks_dep ki18n)
$(add_frameworks_dep kiconthemes)
$(add_frameworks_dep kinit)
$(add_frameworks_dep kio)
$(add_frameworks_dep kparts)
$(add_frameworks_dep ktexteditor)
$(add_frameworks_dep kwindowsystem)
$(add_frameworks_dep kxmlgui)
$(add_kdeapps_dep okular)
$(add_qt_dep qtdbus)
$(add_qt_dep qtscript)
$(add_qt_dep qttest)
$(add_qt_dep qtwidgets)
pdf? ( app-text/poppler[qt5] )
"
RDEPEND="${DEPEND}
!app-editors/kile:4
$(add_kdeapps_dep konsole)
$(add_kdeapps_dep okular 'pdf?')
virtual/latex-base
virtual/tex-base
pdf? (
>=app-text/texlive-core-2014
app-text/ghostscript-gpl
)
png? (
app-text/dvipng
virtual/imagemagick-tools[png?]
)
"
DOCS=( AUTHORS ChangeLog kile-remote-control.txt README README.cwl )
PATCHES=(
"${FILESDIR}/${P}-cmake.patch"
"${FILESDIR}/${P}-desktopfile.patch"
"${FILESDIR}/${P}-no-empty-filename.patch"
"${FILESDIR}/${P}-viewtab-crash.patch"
"${FILESDIR}/${P}-kcrash.patch"
"${FILESDIR}/${P}-nodocfiles.patch"
)
src_configure() {
local mycmakeargs=(
$(cmake-utils_use_find_package pdf Poppler)
)
kde5_src_configure
}