aboutsummaryrefslogtreecommitdiff
blob: 7f88918767a6a388d3c5c7d84daab4b381bf44bc (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 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

if [[ "${PV}" == "9999" ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/emersion/hydroxide.git"
else
	inherit verify-sig
	SRC_URI="https://github.com/emersion/${PN}/releases/download/v${PV}/${P}.tar.gz
		verify-sig? ( https://github.com/emersion/${PN}/releases/download/v${PV}/${P}.tar.gz.sig )
		https://gitlab.com/sevz17/go-deps/-/raw/main/${P}-deps.tar.xz
	"
	VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/emersion.asc"
	BDEPEND+="verify-sig? ( sec-keys/openpgp-keys-emersion )"
	KEYWORDS="~amd64"
fi

DESCRIPTION="A third-party, open-source ProtonMail CardDAV, IMAP and SMTP bridge"
HOMEPAGE="https://github.com/emersion/hydroxide"

LICENSE="MIT BSD"
SLOT="0"

src_unpack() {
	if [[ "${PV}" == "9999" ]]; then
		git-r3_src_unpack
		go-module_live_vendor
	else
		if use verify-sig; then
			verify-sig_verify_detached "${DISTDIR}"/"${P}".tar.gz{,.sig}
		fi
		go-module_src_unpack
	fi
}

src_compile() {
	ego build -v ./cmd/hydroxide
}

src_install() {
	local DOCS=( "LICENSE" "README.md" )
	einstalldocs

	dobin "${PN}"
}

pkg_postinst() {
	elog ""
	elog "In order to use ${PN} you need to read"
	elog "https://github.com/emersion/hydroxide#installing"
	elog ""
}