SHA256
1
0
forked from pool/kapidox

- Add 0001-Look-first-for-qhelpgenerator-qt5-for-help-generatio.patch:

* 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
This commit is contained in:
Luca Beltrame
2018-03-14 13:43:25 +00:00
committed by Git OBS Bridge
parent 51680739a1
commit 24e7309aae
4 changed files with 126 additions and 12 deletions

View File

@@ -0,0 +1,55 @@
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

View File

@@ -0,0 +1,43 @@
From b9d46fec4437ababe8a77e197059733633977c89 Mon Sep 17 00:00:00 2001
From: Luca Beltrame <lbeltrame@kde.org>
Date: Wed, 14 Mar 2018 14:34:15 +0100
Subject: [PATCH] Remove shebangs from non-executable files
Summary:
These files are meant to be used as part of the import, not directly.
Therefore it makes no sense to have /usr/bin/env python calls on top.
(Other files correctly don't have shebangs)
Reviewers: #frameworks, ochurlaud
Subscribers: #documentation
Tags: #frameworks, #documentation
Differential Revision: https://phabricator.kde.org/D11330
---
src/kapidox/depdiagram/generate.py | 1 -
src/kapidox/hlfunctions.py | 1 -
2 files changed, 2 deletions(-)
diff --git a/src/kapidox/depdiagram/generate.py b/src/kapidox/depdiagram/generate.py
index 20fae6f..af80d51 100644
--- a/src/kapidox/depdiagram/generate.py
+++ b/src/kapidox/depdiagram/generate.py
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Aurélien Gâteau <agateau@kde.org>
diff --git a/src/kapidox/hlfunctions.py b/src/kapidox/hlfunctions.py
index 26571b8..ed1dd68 100644
--- a/src/kapidox/hlfunctions.py
+++ b/src/kapidox/hlfunctions.py
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Alex Merry <alex.merry@kdemail.net>
--
2.16.2

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Mar 14 13:37:16 UTC 2018 - lbeltrame@kde.org
- Add 0001-Look-first-for-qhelpgenerator-qt5-for-help-generatio.patch:
* 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)
-------------------------------------------------------------------
Mon Mar 12 23:29:40 CET 2018 - lbeltrame@kde.org

View File

@@ -27,33 +27,39 @@ Release: 0
Requires: doxygen
BuildRequires: fdupes
BuildRequires: kf5-filesystem
BuildRequires: python
Requires: python-Jinja2
Recommends: python-PyYAML
BuildRequires: python3
Requires: python3-Jinja2
Recommends: python3-PyYAML
Requires: doxygen
Requires: graphviz
Requires: graphviz-gd
Requires: python-xml
Summary: KDE Base Libraries
Requires: libqt5-qttools
Requires: python3-xml
Summary: Scripts and data for building API documentation
License: BSD-2-Clause
Group: System/GUI/KDE
Url: http://www.kde.org
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM
Patch0: 0001-Remove-shebangs-from-non-executable-files.patch
# PATCH-FIX-UPSTREAM
Patch1: 0001-Look-first-for-qhelpgenerator-qt5-for-help-generatio.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This package contains the core libraries of the K Desktop Environment.
This package is absolutely necessary for using KDE applications.
The kapidox framework enables the generation of API documentation from
Doxygen-formatted codde comments in a standard format and style.
%prep
%setup -q
%autopatch -p1
%build
python setup.py build
python3 setup.py build
%install
python setup.py install --prefix=%{_kf5_prefix} --root=%{buildroot}
python3 setup.py install --prefix=%{_kf5_prefix} --root=%{buildroot}
%fdupes %{buildroot}
%files
@@ -66,7 +72,7 @@ This package is absolutely necessary for using KDE applications.
%{_kf5_mandir}/man1/depdiagram-generate-all.1*
%{_kf5_mandir}/man1/depdiagram-generate.1*
%{_kf5_mandir}/man1/depdiagram-prepare.1*
%{python_sitelib}/kapidox/
%{python_sitelib}/kapidox-*.egg-info
%{python3_sitelib}/kapidox/
%{python3_sitelib}/kapidox-*.egg-info
%changelog