aboutsummaryrefslogtreecommitdiff
blob: 868dd6251bcabdfc3c895b50bc53cb386e787989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{8..9} )
inherit distutils-r1 udev

DESCRIPTION="Library and command line tool for interacting with hardware wallets"
HOMEPAGE="https://github.com/bitcoin-core/HWI"

MY_PN="HWI"
MY_P="${MY_PN}-${PV}"
SRC_URI="https://github.com/bitcoin-core/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${MY_P}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="udev"

RDEPEND="
	>=dev-python/bitbox02-5.3.0[${PYTHON_USEDEP}]
	>=dev-python/ecdsa-0.13.0[${PYTHON_USEDEP}]
	>=dev-python/hidapi-0.7.99[${PYTHON_USEDEP}]
	>=dev-python/libusb1-1.7.0[${PYTHON_USEDEP}]
	>=dev-python/mnemonic-0.18.0[${PYTHON_USEDEP}]
	>=dev-python/pyaes-1.6.0[${PYTHON_USEDEP}]
	>=dev-python/typing-extensions-3.7.4.1[${PYTHON_USEDEP}]"

distutils_enable_tests unittest

distutils_enable_sphinx docs \
	dev-python/sphinx_rtd_theme \
	dev-python/sphinxcontrib-autoprogram

python_prepare_all() {
	# remove upper bounds on dependencies from setup.py file
	sed 's/,<[0-9.]\+//' -i setup.py || die

	pushd test || die
	# remove tests that require hardware emulation
	rm test_coldcard.py test_device.py test_digitalbitbox.py test_keepkey.py test_ledger.py test_trezor.py || die
	# remove udev tests because it expects the rules are installed in the libs folder
	rm test_udevrules.py || die
	popd || die

	distutils-r1_python_prepare_all
}

python_install_all() {
	use udev && udev_dorules hwilib/udev/*.rules
	use doc  && dodoc -r docs

	distutils-r1_python_install_all
}