summaryrefslogtreecommitdiff
path: root/net-p2p/trezord-go/trezord-go-2.0.33.ebuild
blob: d6ca2c0233bf7860117cf22a28b21ca1f524baf9 (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
69
70
71
72
73
74
75
76
77
78
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module systemd udev

EGO_SUM=(
	"github.com/BurntSushi/toml v0.3.1"
	"github.com/BurntSushi/toml v0.3.1/go.mod"
	"github.com/felixge/httpsnoop v1.0.1"
	"github.com/felixge/httpsnoop v1.0.1/go.mod"
	"github.com/gorilla/csrf v1.7.0"
	"github.com/gorilla/csrf v1.7.0/go.mod"
	"github.com/gorilla/handlers v1.5.1"
	"github.com/gorilla/handlers v1.5.1/go.mod"
	"github.com/gorilla/mux v1.8.0"
	"github.com/gorilla/mux v1.8.0/go.mod"
	"github.com/gorilla/securecookie v1.1.1"
	"github.com/gorilla/securecookie v1.1.1/go.mod"
	"github.com/pkg/errors v0.9.1"
	"github.com/pkg/errors v0.9.1/go.mod"
	"gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405"
	"gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod"
	"gopkg.in/natefinch/lumberjack.v2 v2.0.0"
	"gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod"
	"gopkg.in/yaml.v2 v2.4.0"
	"gopkg.in/yaml.v2 v2.4.0/go.mod"
)

go-module_set_globals

DESCRIPTION="TREZOR Communication Daemon"
HOMEPAGE="https://github.com/trezor/trezord-go"
SRC_URI="
	https://github.com/trezor/trezord-go/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${EGO_SUM_SRC_URI}
"

LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="systemd +udev"
RESTRICT="mirror test"

DEPEND="
	acct-user/trezord
	acct-group/plugdev
"

PATCHES=(
	"${FILESDIR}/${P}_libusb.patch"
	"${FILESDIR}/${P}_libusb-go-1.24.patch"
)

src_compile() {
	default
	go build -v -work -x -o ${PN} || die
}

src_install() {
	newbin trezord-go trezord
	newinitd "${FILESDIR}/trezord-openrc.sh" trezord
	keepdir /var/log/trezord
	fowners trezord:root /var/log/trezord
	einstalldocs

	use systemd && systemd_dounit release/linux/trezord.service
	use udev && udev_dorules release/linux/trezor.rules
}

pkg_postinst() {
	use udev && udev_reload
}

pkg_postrm() {
	use udev && udev_reload
}