1 # Copyright 2017-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_6} )
10 inherit distutils-r1 qmake-utils
12 DESCRIPTION="Hex editor library, Qt application written in C++ with Python bindings"
13 HOMEPAGE="https://github.com/lancos/qhexedit2/"
14 SRC_URI="https://github.com/lancos/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
18 KEYWORDS="~amd64 ~x86"
19 IUSE="doc +gui python"
20 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
23 "${FILESDIR}/${P}-fixtest.patch"
24 "${FILESDIR}/${P}-setup.py.patch"
31 python? ( dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
32 dev-python/sip[${PYTHON_USEDEP}]
39 sed -i -e '/^unix:DESTDIR/ d' -e "\$atarget.path = /usr/$(get_libdir)" \
40 -e "\$aINSTALLS += target" src/qhexedit.pro \
41 || die "src/qhexedit.pro: sed failed"
42 use python && distutils-r1_src_prepare
46 eqmake5 src/qhexedit.pro
48 cd example || die "can't cd example"
55 use python && distutils-r1_src_compile
57 cd example || die "can't cd example"
63 use python && distutils-r1_python_compile build_ext --library-dirs="${S}"
67 cd test || die "can't cd test"
68 mkdir logs || die "can't create logs dir"
71 ./chunks || die "test run failed"
72 grep -q "^NOK" logs/Summary.log && die "test failed"
76 emake INSTALL_ROOT="${D}" install
77 use python && distutils-r1_src_install
78 use gui && dobin example/qhexedit