Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/qhexedit2/files/, app-editors/qhexedit2/
Date: Thu, 04 Jan 2018 19:07:18
Message-Id: 1515092814.af2ab4a3e7880cb7a5605080e5c17a136d889765.zlogene@gentoo
1 commit: af2ab4a3e7880cb7a5605080e5c17a136d889765
2 Author: Victor <coyote <AT> bks <DOT> tv>
3 AuthorDate: Mon Jan 1 19:19:10 2018 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 4 19:06:54 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af2ab4a3
7
8 app-editors/qhexedit2: new package
9
10 QHexEdit is a hex editor widget written in C++ for the Qt5 framework.
11 Used by ponyprog2000.
12
13 Package-Manager: Portage-2.3.13, Repoman-2.3.3
14 Closes: https://github.com/gentoo/gentoo/pull/6728
15
16 app-editors/qhexedit2/Manifest | 1 +
17 .../qhexedit2/files/qhexedit2-0.8.4-fixtest.patch | 12 ++++
18 .../qhexedit2/files/qhexedit2-0.8.4-setup.py.patch | 11 +++
19 app-editors/qhexedit2/metadata.xml | 33 +++++++++
20 app-editors/qhexedit2/qhexedit2-0.8.4.ebuild | 83 ++++++++++++++++++++++
21 5 files changed, 140 insertions(+)
22
23 diff --git a/app-editors/qhexedit2/Manifest b/app-editors/qhexedit2/Manifest
24 new file mode 100644
25 index 00000000000..961c901f02e
26 --- /dev/null
27 +++ b/app-editors/qhexedit2/Manifest
28 @@ -0,0 +1 @@
29 +DIST qhexedit2-0.8.4.tar.gz 340766 BLAKE2B af24031fdd9f8d677f7e8ab8fd69667852dd971db30f5406b9aaaa08bf7f2dc692c87e99c141f355adc82c8226b5b29f53ce07ba63656d866f8688cb2cbc67f2 SHA512 8ed831d75c8ec1897dfd7ef497423908b26b0f56e6577928ed035654e52b437f64edd61cfcc1de6eaf5d1f29f9dc97da84d2edd7f427e3c09c9d75d7bc6504ff
30
31 diff --git a/app-editors/qhexedit2/files/qhexedit2-0.8.4-fixtest.patch b/app-editors/qhexedit2/files/qhexedit2-0.8.4-fixtest.patch
32 new file mode 100644
33 index 00000000000..339ef99477e
34 --- /dev/null
35 +++ b/app-editors/qhexedit2/files/qhexedit2-0.8.4-fixtest.patch
36 @@ -0,0 +1,12 @@
37 +--- qhexedit2-0.8.4/test/testchunks.cpp- 2017-01-17 02:32:54.000000000 +0300
38 ++++ qhexedit2-0.8.4/test/testchunks.cpp 2018-01-03 21:34:24.988555308 +0300
39 +@@ -1,8 +1,7 @@
40 + #include "testchunks.h"
41 + #include <cstdlib>
42 +
43 +-
44 +-TestChunks::TestChunks(QTextStream &log, QString tName, int size, bool random, int saveFile)
45 ++TestChunks::TestChunks(QTextStream &log, QString tName, int size, bool random, int saveFile): _chunks(nullptr)
46 + {
47 + char hex[] = "0123456789abcdef";
48 + srand(0);
49
50 diff --git a/app-editors/qhexedit2/files/qhexedit2-0.8.4-setup.py.patch b/app-editors/qhexedit2/files/qhexedit2-0.8.4-setup.py.patch
51 new file mode 100644
52 index 00000000000..83d9183fcdb
53 --- /dev/null
54 +++ b/app-editors/qhexedit2/files/qhexedit2-0.8.4-setup.py.patch
55 @@ -0,0 +1,11 @@
56 +--- qhexedit2-0.8.4/setup.py- 2018-01-02 19:40:57.542961661 +0300
57 ++++ qhexedit2-0.8.4/setup.py 2017-01-17 02:32:54.000000000 +0300
58 +@@ -98,7 +98,7 @@
59 + lib + ".framework", "Headers")]
60 + else:
61 + if PyQt_Version == 'PyQt5':
62 +- for qt_inc_dir in ('/usr/include/qt', '/usr/include/x86_64-linux-gnu/qt5'):
63 ++ for qt_inc_dir in ('/usr/include/qt', '/usr/include/qt5'):
64 + include_dirs.append(qt_inc_dir)
65 + include_dirs += [os.path.join(qt_inc_dir, lib) for lib in qt_libs]
66 + libraries = ["Qt5" + lib[2:] for lib in qt_libs]
67
68 diff --git a/app-editors/qhexedit2/metadata.xml b/app-editors/qhexedit2/metadata.xml
69 new file mode 100644
70 index 00000000000..3f610e098d9
71 --- /dev/null
72 +++ b/app-editors/qhexedit2/metadata.xml
73 @@ -0,0 +1,33 @@
74 +<?xml version="1.0" encoding="UTF-8"?>
75 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
76 +<pkgmetadata>
77 + <maintainer type="person">
78 + <email>coyote@×××.tv</email>
79 + <name>Victor Kustov</name>
80 + <description>Proxied-maintainer. Assign bugs to him</description>
81 + </maintainer>
82 + <maintainer type="person">
83 + <email>zlogene@g.o</email>
84 + <name>Mikle Kolyada</name>
85 + </maintainer>
86 + <maintainer type="person">
87 + <email>maksbotan@g.o</email>
88 + <name>Maxim Koltsov</name>
89 + </maintainer>
90 + <maintainer type="project">
91 + <email>proxy-maint@g.o</email>
92 + <name>Proxy Maintainers</name>
93 + </maintainer>
94 + <use>
95 + <flag name="gui">Install Qt5 hex editor</flag>
96 + </use>
97 + <longdescription lang="en">
98 + QHexEdit is a hex editor widget written in C++ for the Qt5 framework.
99 + It is a simple editor for binary data, and has bindings to PyQt
100 + with python 2 and 3.
101 + </longdescription>
102 + <upstream>
103 + <remote-id type="github">lancos/qhexedit2</remote-id>
104 + <remote-id type="github">Simsys/qhexedit2</remote-id>
105 + </upstream>
106 +</pkgmetadata>
107
108 diff --git a/app-editors/qhexedit2/qhexedit2-0.8.4.ebuild b/app-editors/qhexedit2/qhexedit2-0.8.4.ebuild
109 new file mode 100644
110 index 00000000000..07dccd9847e
111 --- /dev/null
112 +++ b/app-editors/qhexedit2/qhexedit2-0.8.4.ebuild
113 @@ -0,0 +1,83 @@
114 +# Copyright 2017-2018 Gentoo Foundation
115 +# Distributed under the terms of the GNU General Public License v2
116 +
117 +EAPI=6
118 +
119 +PYTHON_COMPAT=( python{2_7,3_5,3_6} )
120 +
121 +DISTUTILS_OPTIONAL=1
122 +
123 +inherit distutils-r1 qmake-utils
124 +
125 +DESCRIPTION="Hex editor library, Qt application written in C++ with Python bindings"
126 +HOMEPAGE="https://github.com/lancos/qhexedit2/"
127 +SRC_URI="https://github.com/lancos/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
128 +
129 +LICENSE="GPL-2"
130 +SLOT="0"
131 +KEYWORDS="~amd64 ~x86"
132 +IUSE="doc gui python"
133 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
134 +
135 +PATCHES=(
136 + "${FILESDIR}/${P}-fixtest.patch"
137 + "${FILESDIR}/${P}-setup.py.patch"
138 +)
139 +
140 +RDEPEND="
141 + dev-qt/qtcore:5
142 + dev-qt/qtgui:5
143 + dev-qt/qtwidgets:5
144 + python? ( dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
145 + dev-python/sip[${PYTHON_USEDEP}]
146 + ${PYTHON_DEPS} )
147 +"
148 +DEPEND="${RDEPEND}"
149 +
150 +src_prepare() {
151 + default
152 + sed -i -e '/^unix:DESTDIR/ d' -e "\$atarget.path = /usr/$(get_libdir)" \
153 + -e "\$aINSTALLS += target" src/qhexedit.pro \
154 + || die "src/qhexedit.pro: sed failed"
155 + use python && distutils-r1_src_prepare
156 +}
157 +
158 +src_configure() {
159 + eqmake5 src/qhexedit.pro
160 + if use gui; then
161 + cd example || die "can't cd example"
162 + eqmake5 qhexedit.pro
163 + fi
164 +}
165 +
166 +src_compile() {
167 + default
168 + use python && distutils-r1_src_compile
169 + if use gui; then
170 + cd example || die "can't cd example"
171 + emake
172 + fi
173 +}
174 +
175 +python_compile() {
176 + use python && distutils-r1_python_compile build_ext --library-dirs="${S}"
177 +}
178 +
179 +src_test() {
180 + cd test || die "can't cd test"
181 + mkdir logs || die "can't create logs dir"
182 + eqmake5 chunks.pro
183 + emake
184 + ./chunks || die "test run failed"
185 + grep -q "^NOK" logs/Summary.log && die "test failed"
186 +}
187 +
188 +src_install() {
189 + emake INSTALL_ROOT="${D}" install
190 + use python && distutils-r1_src_install
191 + use gui && dobin example/qhexedit
192 + if use doc; then
193 + dodoc -r doc/html
194 + dodoc doc/release.txt
195 + fi
196 +}