Diff proton-mail-bridge-3.1.3 with a proton-mail-bridge-3.3.2-r1

/usr/portage/mail-mta/proton-mail-bridge/proton-mail-bridge-3.3.2-r1.ebuild 2023-10-09 14:52:31.592368403 +0300
3 3

  
4 4
EAPI=8
5 5

  
6
inherit go-module systemd xdg-utils
6
inherit cmake go-module systemd xdg-utils
7 7

  
8 8
MY_PN="${PN/-mail/}"
9 9
MY_P="${MY_PN}-${PV}"
......
16 16
LICENSE="Apache-2.0 BSD BSD-2 GPL-3+ ISC LGPL-3+ MIT MPL-2.0 Unlicense"
17 17
SLOT="0"
18 18
KEYWORDS="~amd64"
19
IUSE="gui"
19 20

  
20 21
# Quite a few tests require Internet access
21 22
PROPERTIES="test_network"
22 23
RESTRICT="test"
23 24

  
24
RDEPEND="app-crypt/libsecret"
25
RDEPEND="app-crypt/libsecret
26
	gui? (
27
		>=dev-libs/protobuf-21.12:=
28
		>=dev-libs/sentry-native-0.6.5-r1
29
		dev-qt/qtbase:6=[gui,icu,widgets]
30
		dev-qt/qtdeclarative:6=[widgets]
31
		dev-qt/qtsvg:6=
32
		media-libs/mesa
33
		net-libs/grpc:=
34
	)
35
"
25 36
DEPEND="${RDEPEND}"
26 37

  
38
PATCHES=(
39
	"${FILESDIR}"/${PN}-3.3.2-gui_gentoo.patch
40
)
41

  
27 42
S="${WORKDIR}"/${MY_P}
28 43

  
29 44
src_prepare() {
30 45
	xdg_environment_reset
31 46
	default
47
	if use gui; then
48
		local PATCHES=()
49
		BUILD_DIR="${WORKDIR}"/gui_build \
50
			CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \
51
			cmake_src_prepare
52
	fi
53
}
54

  
55
src_configure() {
56
	if use gui; then
57
		# TODO:
58
		#  - auto-sync version number between the two executables
59
		#  - can we leave BRIDGE_TAG unset? Seems it gets displayed in some info box
60
		local mycmakeargs=(
61
			-DBRIDGE_APP_FULL_NAME="Proton Mail Bridge"
62
			-DBRIDGE_APP_VERSION="${PV}+git"
63
			-DBRIDGE_REPO_ROOT="${S}"
64
			-DBRIDGE_TAG="NOTAG"
65
			-DBRIDGE_VENDOR="Gentoo Linux"
66
		)
67
		BUILD_DIR="${WORKDIR}"/gui_build \
68
			CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \
69
			cmake_src_configure
70
	fi
32 71
}
33 72

  
34 73
src_compile() {
35 74
	emake build-nogui
75

  
76
	if use gui; then
77
		BUILD_DIR="${WORKDIR}"/gui_build \
78
			CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \
79
			cmake_src_compile
80
	fi
36 81
}
37 82

  
38 83
src_test() {
......
43 88
	exeinto /usr/bin
44 89
	newexe bridge ${PN}
45 90

  
91
	if use gui; then
92
		BUILD_DIR="${WORKDIR}"/gui_build \
93
			CMAKE_USE_DIR="${S}"/internal/frontend/bridge-gui/bridge-gui \
94
			cmake_src_install
95
		mv "${ED}"/usr/bin/bridge-gui "${ED}"/usr/bin/${PN}-gui || die
96
	fi
97

  
46 98
	systemd_newuserunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service
47 99

  
48 100
	einstalldocs
49 101
}
102

  
103
pkg_postinst() {
104
	if [[ -n "${REPLACING_VERSIONS}" ]]; then
105
		local oldver
106
		for oldver in ${REPLACING_VERSIONS}; do
107
			if ver_test "${oldver}" -lt 3.2.0; then
108
				ewarn "Please note that since version 3.2.0, ${PN} by default shares usage statistics with upstream."
109
				ewarn "For details, please see"
110
				ewarn
111
				ewarn "	https://proton.me/support/share-usage-statistics"
112
				ewarn
113
				ewarn "This behaviour can be disabled through ${PN}-gui, under Advanced Settings."
114
				ewarn
115
				break
116
			fi
117
		done
118
	fi
119
}
Thank you!