summaryrefslogtreecommitdiff
path: root/net-im/nheko/nheko-0.12.0-r2.ebuild
blob: 3b4235902a6e9625598dea5e40d587f67b33b1ce (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake optfeature xdg

MY_P="${PN}-v${PV}"
DESCRIPTION="Native desktop client for Matrix using Qt"
HOMEPAGE="https://github.com/Nheko-Reborn/nheko"
SRC_URI="https://nheko.im/nheko-reborn/${PN}/-/archive/v${PV}/${MY_P}.tar.bz2"
S="${WORKDIR}/${MY_P}"

LICENSE="GPL-3 MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="X doc +pie man video voip wayland"
REQUIRED_USE="video? ( voip )"

# Check WebRTCSession::havePlugins() in ./src/voip/WebRTCSession.cpp
# to get GStreamer plugin deps right.
MY_GST_V="1.20.0"

QTMIN="6.5.0"
COMMON_DEPEND="
	app-text/cmark:=
	>=dev-cpp/blurhash-0.2.0:=
	dev-cpp/cpp-httplib:=
	dev-db/lmdb:=
	dev-libs/libfmt:=
	>=dev-libs/kdsingleapplication-1.1.0
	>=dev-libs/mtxclient-0.10.0:=
	dev-libs/olm
	>=dev-libs/qtkeychain-0.14.1-r1:=
	dev-libs/spdlog:=
	>=dev-qt/qtbase-${QTMIN}:6=[dbus,gui,widgets]
	>=dev-qt/qtdeclarative-${QTMIN}:6=
	>=dev-qt/qtmultimedia-${QTMIN}:6[qml]
	>=dev-qt/qtsvg-${QTMIN}:6
	X? (
		x11-libs/libxcb:=
		x11-libs/xcb-util-wm
	)
	voip? (
		>=media-libs/gstreamer-${MY_GST_V}:1.0
		>=media-libs/gst-plugins-bad-${MY_GST_V}:1.0[wayland?]
		>=media-libs/gst-plugins-base-${MY_GST_V}:1.0[X?,opengl]
	)
"
# Dependencies which are required by CMake but not linked with Nheko
INDIRECT_DEPEND="
	>=dev-cpp/coeurl-0.3.0
	dev-libs/libevent
	dev-libs/openssl
	dev-libs/re2
	net-misc/curl
"
DEPEND="
	${COMMON_DEPEND}
	${INDIRECT_DEPEND}
	dev-cpp/nlohmann_json
	>=dev-db/lmdb++-1.0.0
"
RDEPEND="
	${COMMON_DEPEND}
	dev-qt/qtimageformats:6
	virtual/notification-daemon
	voip? (
		>=media-plugins/gst-plugins-dtls-${MY_GST_V}:1.0
		media-plugins/gst-plugins-libnice:1.0
		>=media-plugins/gst-plugins-meta-${MY_GST_V}:1.0[opus]
		>=media-plugins/gst-plugins-srtp-${MY_GST_V}:1.0
		>=media-plugins/gst-plugins-webrtc-${MY_GST_V}:1.0
		video? (
			>=media-plugins/gst-plugins-meta-${MY_GST_V}:1.0[vpx]
			>=media-plugins/gst-plugins-qt6-${MY_GST_V}:1.0
			X? (
				>=media-plugins/gst-plugins-ximagesrc-${MY_GST_V}:1.0
			)
			wayland? (
				media-video/pipewire[gstreamer]
			)
		)
	)
"
BDEPEND="
	>=dev-qt/qttools-${QTMIN}:6[linguist]
	virtual/pkgconfig
	doc? (
		app-text/doxygen
		media-gfx/graphviz
	)
	man? (
		|| (
			app-text/asciidoc
			dev-ruby/asciidoctor
		)
	)
"

PATCHES=(
	"${FILESDIR}"/${PN}-0.12.0-disable-http3.patch
	"${FILESDIR}"/${PN}-0.12.0-fmt11.patch
	"${FILESDIR}"/${PN}-0.12.0-remove-wayland-dep-on-x11.patch
)

src_configure() {
	local -a mycmakeargs=(
		-DUSE_BUNDLED_CPPHTTPLIB=no
		-DUSE_BUNDLED_BLURHASH=no

		-DVOIP=$(usex voip)
		-DX11=$(usex X)
		-DBUILD_DOCS=$(usex doc)
		-DMAN=$(usex man)

		# See #890903 and #911111
		-DCMAKE_POSITION_INDEPENDENT_CODE=$(usex pie)
	)

	cmake_src_configure
}

pkg_postinst() {
	optfeature "secrets storage support other than kwallet (for example gnome-keyring or keepassxc)" \
		"dev-libs/qtkeychain[keyring]"
	optfeature "additional, less common, image format support" \
		kde-frameworks/kimageformats:6
	optfeature "identicons support" dev-cpp/qt-jdenticon:6

	xdg_pkg_postinst
}