forked from pool/kapidox
* Look for qhelpgenerator-qt5 first (as it's named in openSUSE) - Add 0001-Remove-shebangs-from-non-executable-files.patch: * Remove shebangs from non-executable files - Add an explicit dependency on libqt5-qttools (needed for QCH generation) OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kapidox?expand=0&rev=134
56 lines
1.8 KiB
Diff
56 lines
1.8 KiB
Diff
From 64dac1ad3c8db765dd269ee6ec8a4549bb93d598 Mon Sep 17 00:00:00 2001
|
|
From: Luca Beltrame <lbeltrame@kde.org>
|
|
Date: Wed, 14 Mar 2018 09:25:02 +0100
|
|
Subject: [PATCH] Look first for qhelpgenerator-qt5 for help generation
|
|
|
|
Summary:
|
|
A number of distributions uses the -qt5 suffix for Qt command line
|
|
tools, to make sure they can coexist with the Qt4 equivalents.
|
|
|
|
This change uses `distutils`'s `find_executable` to look for the -qt5
|
|
suffix of `qhelpgenerator`. If it is not found, it falls back to the
|
|
un-suffixed version.
|
|
|
|
Reviewers: #frameworks, ochurlaud
|
|
|
|
Subscribers: #documentation
|
|
|
|
Tags: #frameworks, #documentation
|
|
|
|
Differential Revision: https://phabricator.kde.org/D11315
|
|
---
|
|
src/kapidox/generator.py | 12 +++++++++++-
|
|
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/kapidox/generator.py b/src/kapidox/generator.py
|
|
index 3fdf5e7..3346a47 100644
|
|
--- a/src/kapidox/generator.py
|
|
+++ b/src/kapidox/generator.py
|
|
@@ -30,6 +30,7 @@
|
|
from __future__ import division, absolute_import, print_function, unicode_literals
|
|
|
|
import codecs
|
|
+from distutils.spawn import find_executable
|
|
import datetime
|
|
import os
|
|
import logging
|
|
@@ -928,5 +929,14 @@ def create_qch(products, tagfiles):
|
|
name = product.name+".qhp"
|
|
outname = product.name+".qch"
|
|
tree_out.write(name, encoding="utf-8", xml_declaration=True)
|
|
- subprocess.call(["qhelpgenerator", name, '-o', 'qch/'+outname])
|
|
+
|
|
+ # On many distributions, qhelpgenerator from Qt5 is suffixed with
|
|
+ # "-qt5". Look for it first, and fall back to unsuffixed one if
|
|
+ # not found.
|
|
+ qhelpgenerator = find_executable("qhelpgenerator-qt5")
|
|
+
|
|
+ if qhelpgenerator is None:
|
|
+ qhelpgenerator = "qhelpgenerator"
|
|
+
|
|
+ subprocess.call([qhelpgenerator, name, '-o', 'qch/'+outname])
|
|
os.remove(name)
|
|
--
|
|
2.16.2
|
|
|