Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/qhexedit2/files/, app-editors/qhexedit2/
Date: Fri, 13 May 2022 20:04:23
Message-Id: 1652472228.8759771fffe11541f3259bab8b305a0afd142f32.sam@gentoo
1 commit: 8759771fffe11541f3259bab8b305a0afd142f32
2 Author: Huang Rui <vowstar <AT> gmail <DOT> com>
3 AuthorDate: Mon May 9 03:04:44 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri May 13 20:03:48 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8759771f
7
8 app-editors/qhexedit2: fix compile problem and add BDEPEND
9
10 sip-4 no longer supports the latest PyQt5 syntax,
11 so it needs to be changed to sip-5
12 Fix unable to find file "QtCore/QtCoremod.sip"
13 Switched the build system to use sip-build + PyQt-builder
14 Add dev-python/sip-5 as RDEPEND
15 New maintainer by Proxy Maint
16
17 Closes: https://bugs.gentoo.org/820473
18 Closes: https://bugs.gentoo.org/758260
19 Signed-off-by: Huang Rui <vowstar <AT> gmail.com>
20 Closes: https://github.com/gentoo/gentoo/pull/25395
21 Signed-off-by: Sam James <sam <AT> gentoo.org>
22
23 .../qhexedit2/files/qhexedit2-0.8.6-sip.patch | 35 +++++++
24 .../qhexedit2/files/qhexedit2-0.8.6-sip5.patch | 82 +++++++++++++++
25 .../files/qhexedit2-0.8.9-fix-crash.patch | 37 +++++++
26 app-editors/qhexedit2/metadata.xml | 9 +-
27 .../qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild | 108 ++++++++++++++++++++
28 .../qhexedit2/qhexedit2-0.8.9_p20210525-r1.ebuild | 110 +++++++++++++++++++++
29 6 files changed, 380 insertions(+), 1 deletion(-)
30
31 diff --git a/app-editors/qhexedit2/files/qhexedit2-0.8.6-sip.patch b/app-editors/qhexedit2/files/qhexedit2-0.8.6-sip.patch
32 new file mode 100644
33 index 000000000000..56ae97159030
34 --- /dev/null
35 +++ b/app-editors/qhexedit2/files/qhexedit2-0.8.6-sip.patch
36 @@ -0,0 +1,35 @@
37 +https://bugs.gentoo.org/820473
38 +From bdb22d3542099d7e1933aaffa80e044375466914 Mon Sep 17 00:00:00 2001
39 +From: Huang Rui <vowstar@×××××.com>
40 +Date: Sat, 7 May 2022 14:49:35 +0800
41 +Subject: [PATCH] setup.py: fix pyqt_sip_dir on modern Linux distributions
42 +
43 +QtCore/QtCoremod.sip may be installed to:
44 +/usr/lib/python3.9/site-packages/PyQt5/bindings/QtCore/QtCoremod.sip
45 +See also: https://github.com/qgis/QGIS/blob/master/cmake/FindPyQt5.py
46 +
47 +Closes: https://bugs.gentoo.org/820473
48 +Signed-off-by: Huang Rui <vowstar@×××××.com>
49 +---
50 + setup.py | 8 ++++++++
51 + 1 file changed, 8 insertions(+)
52 +
53 +diff --git a/setup.py b/setup.py
54 +index 1a0d912..1906a07 100644
55 +--- a/setup.py
56 ++++ b/setup.py
57 +@@ -10,6 +10,14 @@
58 +
59 + cfg = sipconfig.Configuration()
60 + pyqt_sip_dir = cfg.default_sip_dir
61 ++for p in (os.path.join(pyqt_sip_dir, "PyQt5"),
62 ++ os.path.join(pyqt_sip_dir, "PyQt5-3"),
63 ++ os.path.join(pyqt_sip_dir, "PyQt4"),
64 ++ pyqt_sip_dir,
65 ++ os.path.join(cfg.default_mod_dir, "PyQt5", "bindings")):
66 ++ if os.path.exists(os.path.join(p, "QtCore", "QtCoremod.sip")):
67 ++ pyqt_sip_dir = p
68 ++ break
69 +
70 + try:
71 + import PyQt5
72
73 diff --git a/app-editors/qhexedit2/files/qhexedit2-0.8.6-sip5.patch b/app-editors/qhexedit2/files/qhexedit2-0.8.6-sip5.patch
74 new file mode 100644
75 index 000000000000..0cc134e32358
76 --- /dev/null
77 +++ b/app-editors/qhexedit2/files/qhexedit2-0.8.6-sip5.patch
78 @@ -0,0 +1,82 @@
79 +https://bugs.gentoo.org/820473
80 +https://bugs.gentoo.org/815133
81 +https://github.com/Simsys/qhexedit2/pull/137
82 +https://src.fedoraproject.org/rpms/qhexedit2/blob/rawhide/f/sip5.patch
83 +From ce17d35586de1b9fdc21e3f8450dd1d2b76d5bcc Mon Sep 17 00:00:00 2001
84 +From: Scott Talbert <swt@××××××.net>
85 +Date: Mon, 18 Jan 2021 21:06:46 -0500
86 +Subject: [PATCH] Add support for building with sip 5
87 +
88 +---
89 + project.py | 29 +++++++++++++++++++++++++++++
90 + pyproject.toml | 14 ++++++++++++++
91 + src/qhexedit.sip | 2 +-
92 + 3 files changed, 44 insertions(+), 1 deletion(-)
93 + create mode 100644 project.py
94 + create mode 100644 pyproject.toml
95 +
96 +diff --git a/project.py b/project.py
97 +new file mode 100644
98 +index 0000000..c9ee67f
99 +--- /dev/null
100 ++++ b/project.py
101 +@@ -0,0 +1,29 @@
102 ++"""The build configuration file for QHexEdit, used by sip."""
103 ++
104 ++import os
105 ++from os.path import abspath, join
106 ++from sipbuild import Option
107 ++from pyqtbuild import PyQtBindings, PyQtProject
108 ++import PyQt5
109 ++
110 ++
111 ++class QHexEditProject(PyQtProject):
112 ++ """The QHexEdit Project class."""
113 ++
114 ++ def __init__(self):
115 ++ super().__init__()
116 ++ self.bindings_factories = [QHexEditBindings]
117 ++
118 ++ def update(self, tool):
119 ++ """Allows SIP to find PyQt5 .sip files."""
120 ++ super().update(tool)
121 ++ self.sip_include_dirs.append(join(PyQt5.__path__[0], 'bindings'))
122 ++
123 ++
124 ++class QHexEditBindings(PyQtBindings):
125 ++ """The QHexEdit Bindings class."""
126 ++
127 ++ def __init__(self, project):
128 ++ super().__init__(project, name='QHexEdit',
129 ++ sip_file='qhexedit.sip',
130 ++ qmake_QT=['widgets'])
131 +diff --git a/pyproject.toml b/pyproject.toml
132 +new file mode 100644
133 +index 0000000..b5edaa4
134 +--- /dev/null
135 ++++ b/pyproject.toml
136 +@@ -0,0 +1,14 @@
137 ++[build-system]
138 ++requires = ["sip >=5, <7", "PyQt-builder >=1.1.0, <2", "PyQt5"]
139 ++build-backend = "sipbuild.api"
140 ++
141 ++[tool.sip.metadata]
142 ++name = "QHexEdit"
143 ++version = "0.8.9"
144 ++
145 ++[tools.sip]
146 ++abi-version = "12.8"
147 ++project-factory = "pyqtbuild:PyQtProject"
148 ++
149 ++[tool.sip.project]
150 ++sip-files-dir = "src"
151 +diff --git a/src/qhexedit.sip b/src/qhexedit.sip
152 +index f7db293..6d4ebae 100644
153 +--- a/src/qhexedit.sip
154 ++++ b/src/qhexedit.sip
155 +@@ -1,4 +1,4 @@
156 +-%Module(name=qhexedit, version=1)
157 ++%Module(name=qhexedit)
158 +
159 + %Import QtCore/QtCoremod.sip
160 + %Import QtGui/QtGuimod.sip
161
162 diff --git a/app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch b/app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch
163 new file mode 100644
164 index 000000000000..9c3099b06d28
165 --- /dev/null
166 +++ b/app-editors/qhexedit2/files/qhexedit2-0.8.9-fix-crash.patch
167 @@ -0,0 +1,37 @@
168 +https://github.com/Simsys/qhexedit2/pull/139
169 +From d314aab25eeab0db131fc87f20daf7c4ad587ee2 Mon Sep 17 00:00:00 2001
170 +From: =?UTF-8?q?=E8=AF=B7=E5=8F=AB=E6=88=91=E8=88=B9=E9=95=BF?=
171 + <38233142+thinkSJ@××××××××××××××××××××.com>
172 +Date: Sat, 13 Nov 2021 18:35:25 +0800
173 +Subject: [PATCH] Update qhexedit.cpp
174 +
175 +crashed when press ctrl alt keys....
176 +---
177 + src/qhexedit.cpp | 14 +++++++++-----
178 + 1 file changed, 9 insertions(+), 5 deletions(-)
179 +
180 +diff --git a/src/qhexedit.cpp b/src/qhexedit.cpp
181 +index d7e532c..4137192 100644
182 +--- a/src/qhexedit.cpp
183 ++++ b/src/qhexedit.cpp
184 +@@ -766,11 +766,15 @@ void QHexEdit::keyPressEvent(QKeyEvent *event)
185 + (QApplication::keyboardModifiers() == Qt::GroupSwitchModifier))
186 + {
187 + /* Hex and ascii input */
188 +- int key;
189 +- if (_editAreaIsAscii)
190 +- key = (uchar)event->text().at(0).toLatin1();
191 +- else
192 +- key = int(event->text().at(0).toLower().toLatin1());
193 ++ int key = 0;
194 ++ QString text = event->text();
195 ++ if (!text.isEmpty())
196 ++ {
197 ++ if (_editAreaIsAscii)
198 ++ key = (uchar)text.at(0).toLatin1();
199 ++ else
200 ++ key = int(text.at(0).toLower().toLatin1());
201 ++ }
202 +
203 + if ((((key >= '0' && key <= '9') || (key >= 'a' && key <= 'f')) && _editAreaIsAscii == false)
204 + || (key >= ' ' && _editAreaIsAscii))
205
206 diff --git a/app-editors/qhexedit2/metadata.xml b/app-editors/qhexedit2/metadata.xml
207 index 7db8b420f3d9..f7e7eb3ae5ad 100644
208 --- a/app-editors/qhexedit2/metadata.xml
209 +++ b/app-editors/qhexedit2/metadata.xml
210 @@ -1,7 +1,14 @@
211 <?xml version="1.0" encoding="UTF-8"?>
212 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
213 <pkgmetadata>
214 - <!-- maintainer-needed -->
215 + <maintainer type="person">
216 + <email>vowstar@×××××.com</email>
217 + <name>Huang Rui</name>
218 + </maintainer>
219 + <maintainer type="project">
220 + <email>proxy-maint@g.o</email>
221 + <name>Proxy Maintainers</name>
222 + </maintainer>
223 <use>
224 <flag name="gui">Install Qt5 hex editor</flag>
225 </use>
226
227 diff --git a/app-editors/qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild b/app-editors/qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild
228 new file mode 100644
229 index 000000000000..5a67a0db9e25
230 --- /dev/null
231 +++ b/app-editors/qhexedit2/qhexedit2-0.8.6_p20190316-r1.ebuild
232 @@ -0,0 +1,108 @@
233 +# Copyright 1999-2022 Gentoo Authors
234 +# Distributed under the terms of the GNU General Public License v2
235 +
236 +EAPI=8
237 +
238 +DISTUTILS_USE_PEP517=standalone
239 +PYTHON_COMPAT=( python3_{8..10} )
240 +
241 +inherit distutils-r1 qmake-utils
242 +
243 +EGIT_COMMIT="ba5af8616b3a6c916e718914225a483267c01356"
244 +DESCRIPTION="Hex editor library, Qt application written in C++ with Python bindings"
245 +HOMEPAGE="https://github.com/lancos/qhexedit2/"
246 +SRC_URI="https://github.com/lancos/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
247 +
248 +LICENSE="GPL-2"
249 +SLOT="0"
250 +KEYWORDS="~amd64 ~riscv ~x86"
251 +IUSE="doc +gui python"
252 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
253 +
254 +PATCHES=(
255 + "${FILESDIR}/${PN}-0.8.4-setup.py.patch"
256 + "${FILESDIR}/${PN}-0.8.6-sip5.patch" #820473
257 +)
258 +
259 +RDEPEND="
260 + dev-qt/qtcore:5
261 + dev-qt/qtgui:5
262 + dev-qt/qtwidgets:5
263 + python? (
264 + ${PYTHON_DEPS}
265 + $(python_gen_cond_dep '
266 + dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
267 + ')
268 + )
269 +"
270 +DEPEND="${RDEPEND}"
271 +BDEPEND="
272 + python? (
273 + $(python_gen_cond_dep '
274 + >=dev-python/PyQt-builder-1.10[${PYTHON_USEDEP}]
275 + >=dev-python/sip-5:=[${PYTHON_USEDEP}]
276 + ')
277 + )
278 +"
279 +
280 +S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
281 +
282 +src_prepare() {
283 + default
284 + sed -i -e '/^unix:DESTDIR/ d' -e "\$atarget.path = /usr/$(get_libdir)" \
285 + -e "\$aINSTALLS += target" src/qhexedit.pro \
286 + || die "src/qhexedit.pro: sed failed"
287 +}
288 +
289 +src_configure() {
290 + eqmake5 src/qhexedit.pro
291 + if use gui; then
292 + cd example || die "can't cd example"
293 + eqmake5 qhexedit.pro
294 + fi
295 +}
296 +
297 +src_compile() {
298 + emake
299 + use gui && emake -C example
300 + if use python; then
301 + export PATH="$(qt5_get_bindir):${PATH}"
302 + python_build() {
303 + pushd ${S} || die
304 + sip-build || die
305 + popd || die
306 + }
307 + python_foreach_impl run_in_build_dir python_build
308 + fi
309 +}
310 +
311 +src_test() {
312 + cd test || die "can't cd test"
313 + mkdir logs || die "can't create logs dir"
314 + eqmake5 chunks.pro
315 + emake
316 + ./chunks || die "test run failed"
317 + grep -q "^NOK" logs/Summary.log && die "test failed"
318 +}
319 +
320 +src_install() {
321 + doheader src/*.h
322 + dolib.so libqhexedit.so*
323 + if use python; then
324 + python_install() {
325 + pushd ${S}/build || die
326 + emake INSTALL_ROOT="${D}" install
327 + popd || die
328 + }
329 + python_foreach_impl run_in_build_dir python_install
330 + fi
331 + if use gui; then
332 + dobin example/qhexedit
333 + insinto /usr/share/${PN}/
334 + doins example/translations/*.qm
335 + fi
336 + if use doc; then
337 + dodoc -r doc/html
338 + dodoc doc/release.txt
339 + fi
340 +}
341
342 diff --git a/app-editors/qhexedit2/qhexedit2-0.8.9_p20210525-r1.ebuild b/app-editors/qhexedit2/qhexedit2-0.8.9_p20210525-r1.ebuild
343 new file mode 100644
344 index 000000000000..eb3f2601963f
345 --- /dev/null
346 +++ b/app-editors/qhexedit2/qhexedit2-0.8.9_p20210525-r1.ebuild
347 @@ -0,0 +1,110 @@
348 +# Copyright 1999-2022 Gentoo Authors
349 +# Distributed under the terms of the GNU General Public License v2
350 +
351 +EAPI=8
352 +
353 +DISTUTILS_USE_PEP517=standalone
354 +PYTHON_COMPAT=( python3_{8..10} )
355 +
356 +inherit distutils-r1 qmake-utils
357 +
358 +EGIT_COMMIT="541139125be034b90b6811a84faa1413e357fd94"
359 +DESCRIPTION="Hex editor library, Qt application written in C++ with Python bindings"
360 +HOMEPAGE="https://github.com/Simsys/qhexedit2/"
361 +SRC_URI="https://github.com/Simsys/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
362 +
363 +LICENSE="GPL-2"
364 +SLOT="0"
365 +KEYWORDS="~amd64 ~riscv ~x86"
366 +IUSE="doc +gui python"
367 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
368 +
369 +PATCHES=(
370 + "${FILESDIR}/${PN}-0.8.4-setup.py.patch"
371 + "${FILESDIR}/${PN}-0.8.6-sip.patch" #820473
372 + "${FILESDIR}/${PN}-0.8.6-sip5.patch" #820473
373 + "${FILESDIR}/${PN}-0.8.9-fix-crash.patch"
374 +)
375 +
376 +RDEPEND="
377 + dev-qt/qtcore:5
378 + dev-qt/qtgui:5
379 + dev-qt/qtwidgets:5
380 + python? (
381 + ${PYTHON_DEPS}
382 + $(python_gen_cond_dep '
383 + dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
384 + ')
385 + )
386 +"
387 +DEPEND="${RDEPEND}"
388 +BDEPEND="
389 + python? (
390 + $(python_gen_cond_dep '
391 + >=dev-python/PyQt-builder-1.10[${PYTHON_USEDEP}]
392 + >=dev-python/sip-5:=[${PYTHON_USEDEP}]
393 + ')
394 + )
395 +"
396 +
397 +S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
398 +
399 +src_prepare() {
400 + default
401 + sed -i -e '/^unix:DESTDIR/ d' -e "\$atarget.path = /usr/$(get_libdir)" \
402 + -e "\$aINSTALLS += target" src/qhexedit.pro \
403 + || die "src/qhexedit.pro: sed failed"
404 +}
405 +
406 +src_configure() {
407 + eqmake5 src/qhexedit.pro
408 + if use gui; then
409 + cd example || die "can't cd example"
410 + eqmake5 qhexedit.pro
411 + fi
412 +}
413 +
414 +src_compile() {
415 + emake
416 + use gui && emake -C example
417 + if use python; then
418 + export PATH="$(qt5_get_bindir):${PATH}"
419 + python_build() {
420 + pushd ${S} || die
421 + sip-build || die
422 + popd || die
423 + }
424 + python_foreach_impl run_in_build_dir python_build
425 + fi
426 +}
427 +
428 +src_test() {
429 + cd test || die "can't cd test"
430 + mkdir logs || die "can't create logs dir"
431 + eqmake5 chunks.pro
432 + emake
433 + ./chunks || die "test run failed"
434 + grep -q "^NOK" logs/Summary.log && die "test failed"
435 +}
436 +
437 +src_install() {
438 + doheader src/*.h
439 + dolib.so libqhexedit.so*
440 + if use python; then
441 + python_install() {
442 + pushd ${S}/build || die
443 + emake INSTALL_ROOT="${D}" install
444 + popd || die
445 + }
446 + python_foreach_impl run_in_build_dir python_install
447 + fi
448 + if use gui; then
449 + dobin example/qhexedit
450 + insinto /usr/share/${PN}/
451 + doins example/translations/*.qm
452 + fi
453 + if use doc; then
454 + dodoc -r doc/html
455 + dodoc doc/release.txt
456 + fi
457 +}