blob: 733cc1e4f00f2cfe77ad83eb187095136543adfb (
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
57
58
59
60
61
62
63
64
65
66
67
68
|
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1
DESCRIPTION="Transit relay server for magic-wormhole"
HOMEPAGE="
https://magic-wormhole.readthedocs.io/en/latest/
https://github.com/magic-wormhole/magic-wormhole-transit-relay/
https://pypi.org/project/magic-wormhole-transit-relay/
"
SRC_URI="
https://github.com/magic-wormhole/magic-wormhole-transit-relay/archive/${PV}.tar.gz
-> ${P}.gh.tar.gz
"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
RDEPEND="
>=dev-python/autobahn-21.3.1[${PYTHON_USEDEP}]
>=dev-python/twisted-21.2.0[ssl,${PYTHON_USEDEP}]
"
BDEPEND="
dev-python/versioneer[${PYTHON_USEDEP}]
test? (
dev-python/mock[${PYTHON_USEDEP}]
)
"
distutils_enable_tests pytest
src_prepare() {
distutils-r1_src_prepare
rm versioneer.py || die
}
python_test() {
local -x PATH=${T}/bin:${PATH}
mkdir -p "${T}"/bin || die
# the script is apparently run with PATH wiped, sigh
cat > "${T}"/bin/twistd <<-EOF || die
#!$(type -P python)
import sys
from twisted.scripts.twistd import run
sys.exit(run())
EOF
chmod +x "${T}"/bin/twistd || die
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
epytest
find "${BUILD_DIR}/install" -name dropin.cache -delete || die
}
pkg_postinst() {
python_foreach_impl twisted-regen-cache
}
pkg_postrm() {
python_foreach_impl twisted-regen-cache
}
|