1 |
commit: ee9e38d91f1b2b4a225df9e4e8bc1d83391d4ba7 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 27 06:48:06 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 27 06:50:41 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee9e38d9 |
7 |
|
8 |
app-editors/qhexedit2: add SIP 5 patch |
9 |
|
10 |
Good enough for Fedora. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/815133 |
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
.../files/qhexedit2-0.8.6_p20190316-sip5.patch | 82 +++++++++++++++++++++ |
16 |
.../qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild | 86 ++++++++++++++++++++++ |
17 |
2 files changed, 168 insertions(+) |
18 |
|
19 |
diff --git a/app-editors/qhexedit2/files/qhexedit2-0.8.6_p20190316-sip5.patch b/app-editors/qhexedit2/files/qhexedit2-0.8.6_p20190316-sip5.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..837c2af211f |
22 |
--- /dev/null |
23 |
+++ b/app-editors/qhexedit2/files/qhexedit2-0.8.6_p20190316-sip5.patch |
24 |
@@ -0,0 +1,82 @@ |
25 |
+https://github.com/Simsys/qhexedit2/pull/137 |
26 |
+https://src.fedoraproject.org/rpms/qhexedit2/blob/rawhide/f/sip5.patch |
27 |
+https://bugs.gentoo.org/815133 |
28 |
+ |
29 |
+From ce17d35586de1b9fdc21e3f8450dd1d2b76d5bcc Mon Sep 17 00:00:00 2001 |
30 |
+From: Scott Talbert <swt@××××××.net> |
31 |
+Date: Mon, 18 Jan 2021 21:06:46 -0500 |
32 |
+Subject: [PATCH] Add support for building with sip 5 |
33 |
+ |
34 |
+--- |
35 |
+ project.py | 29 +++++++++++++++++++++++++++++ |
36 |
+ pyproject.toml | 14 ++++++++++++++ |
37 |
+ src/qhexedit.sip | 2 +- |
38 |
+ 3 files changed, 44 insertions(+), 1 deletion(-) |
39 |
+ create mode 100644 project.py |
40 |
+ create mode 100644 pyproject.toml |
41 |
+ |
42 |
+diff --git a/project.py b/project.py |
43 |
+new file mode 100644 |
44 |
+index 0000000..c9ee67f |
45 |
+--- /dev/null |
46 |
++++ b/project.py |
47 |
+@@ -0,0 +1,29 @@ |
48 |
++"""The build configuration file for QHexEdit, used by sip.""" |
49 |
++ |
50 |
++import os |
51 |
++from os.path import abspath, join |
52 |
++from sipbuild import Option |
53 |
++from pyqtbuild import PyQtBindings, PyQtProject |
54 |
++import PyQt5 |
55 |
++ |
56 |
++ |
57 |
++class QHexEditProject(PyQtProject): |
58 |
++ """The QHexEdit Project class.""" |
59 |
++ |
60 |
++ def __init__(self): |
61 |
++ super().__init__() |
62 |
++ self.bindings_factories = [QHexEditBindings] |
63 |
++ |
64 |
++ def update(self, tool): |
65 |
++ """Allows SIP to find PyQt5 .sip files.""" |
66 |
++ super().update(tool) |
67 |
++ self.sip_include_dirs.append(join(PyQt5.__path__[0], 'bindings')) |
68 |
++ |
69 |
++ |
70 |
++class QHexEditBindings(PyQtBindings): |
71 |
++ """The QHexEdit Bindings class.""" |
72 |
++ |
73 |
++ def __init__(self, project): |
74 |
++ super().__init__(project, name='QHexEdit', |
75 |
++ sip_file='qhexedit.sip', |
76 |
++ qmake_QT=['widgets']) |
77 |
+diff --git a/pyproject.toml b/pyproject.toml |
78 |
+new file mode 100644 |
79 |
+index 0000000..b5edaa4 |
80 |
+--- /dev/null |
81 |
++++ b/pyproject.toml |
82 |
+@@ -0,0 +1,14 @@ |
83 |
++[build-system] |
84 |
++requires = ["sip >=5", "PyQt-builder", "PyQt5"] |
85 |
++build-backend = "sipbuild.api" |
86 |
++ |
87 |
++[tool.sip.metadata] |
88 |
++name = "QHexEdit" |
89 |
++version = "0.8.9" |
90 |
++ |
91 |
++[tools.sip] |
92 |
++abi-version = "12.8" |
93 |
++project-factory = "pyqtbuild:PyQtProject" |
94 |
++ |
95 |
++[tool.sip.project] |
96 |
++sip-files-dir = "src" |
97 |
+diff --git a/src/qhexedit.sip b/src/qhexedit.sip |
98 |
+index f7db293..6d4ebae 100644 |
99 |
+--- a/src/qhexedit.sip |
100 |
++++ b/src/qhexedit.sip |
101 |
+@@ -1,4 +1,4 @@ |
102 |
+-%Module(name=qhexedit, version=1) |
103 |
++%Module(name=qhexedit) |
104 |
+ |
105 |
+ %Import QtCore/QtCoremod.sip |
106 |
+ %Import QtGui/QtGuimod.sip |
107 |
|
108 |
diff --git a/app-editors/qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild b/app-editors/qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild |
109 |
new file mode 100644 |
110 |
index 00000000000..5fcee894a76 |
111 |
--- /dev/null |
112 |
+++ b/app-editors/qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild |
113 |
@@ -0,0 +1,86 @@ |
114 |
+# Copyright 1999-2021 Gentoo Authors |
115 |
+# Distributed under the terms of the GNU General Public License v2 |
116 |
+ |
117 |
+EAPI=7 |
118 |
+ |
119 |
+PYTHON_COMPAT=( python3_{7,8,9} ) |
120 |
+ |
121 |
+DISTUTILS_OPTIONAL=1 |
122 |
+ |
123 |
+inherit distutils-r1 qmake-utils |
124 |
+ |
125 |
+EGIT_COMMIT="ba5af8616b3a6c916e718914225a483267c01356" |
126 |
+DESCRIPTION="Hex editor library, Qt application written in C++ with Python bindings" |
127 |
+HOMEPAGE="https://github.com/lancos/qhexedit2/" |
128 |
+SRC_URI="https://github.com/lancos/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" |
129 |
+ |
130 |
+LICENSE="GPL-2" |
131 |
+SLOT="0" |
132 |
+KEYWORDS="~amd64 ~x86" |
133 |
+IUSE="doc +gui python" |
134 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
135 |
+ |
136 |
+PATCHES=( |
137 |
+ "${FILESDIR}/${PN}-0.8.4-setup.py.patch" |
138 |
+ "${FILESDIR}/${PN}-0.8.6_p20190316-sip5.patch" |
139 |
+) |
140 |
+ |
141 |
+RDEPEND=" |
142 |
+ dev-qt/qtcore:5 |
143 |
+ dev-qt/qtgui:5 |
144 |
+ dev-qt/qtwidgets:5 |
145 |
+ python? ( |
146 |
+ dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}] |
147 |
+ >=dev-python/sip-5[${PYTHON_USEDEP}] |
148 |
+ ${PYTHON_DEPS} |
149 |
+ ) |
150 |
+" |
151 |
+DEPEND="${RDEPEND}" |
152 |
+ |
153 |
+S="${WORKDIR}/${PN}-${EGIT_COMMIT}" |
154 |
+ |
155 |
+src_prepare() { |
156 |
+ default |
157 |
+ sed -i -e '/^unix:DESTDIR/ d' -e "\$atarget.path = /usr/$(get_libdir)" \ |
158 |
+ -e "\$aINSTALLS += target" src/qhexedit.pro \ |
159 |
+ || die "src/qhexedit.pro: sed failed" |
160 |
+ use python && distutils-r1_src_prepare |
161 |
+} |
162 |
+ |
163 |
+src_configure() { |
164 |
+ eqmake5 src/qhexedit.pro |
165 |
+ if use gui; then |
166 |
+ cd example || die "can't cd example" |
167 |
+ eqmake5 qhexedit.pro |
168 |
+ fi |
169 |
+} |
170 |
+ |
171 |
+src_compile() { |
172 |
+ default |
173 |
+ use python && distutils-r1_src_compile |
174 |
+ use gui && emake -C example |
175 |
+} |
176 |
+ |
177 |
+python_compile() { |
178 |
+ use python && distutils-r1_python_compile build_ext --library-dirs="${S}" |
179 |
+} |
180 |
+ |
181 |
+src_test() { |
182 |
+ cd test || die "can't cd test" |
183 |
+ mkdir logs || die "can't create logs dir" |
184 |
+ eqmake5 chunks.pro |
185 |
+ emake |
186 |
+ ./chunks || die "test run failed" |
187 |
+ grep -q "^NOK" logs/Summary.log && die "test failed" |
188 |
+} |
189 |
+ |
190 |
+src_install() { |
191 |
+ emake INSTALL_ROOT="${D}" install |
192 |
+ doheader src/*.h |
193 |
+ use python && distutils-r1_src_install |
194 |
+ use gui && dobin example/qhexedit |
195 |
+ if use doc; then |
196 |
+ dodoc -r doc/html |
197 |
+ dodoc doc/release.txt |
198 |
+ fi |
199 |
+} |