# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CRATES="
	accessory@2.1.1
	adler2@2.0.1
	aead@0.6.1
	aes@0.8.4
	aes@0.9.3
	aho-corasick@1.1.5
	android_system_properties@0.1.6
	anyhow@1.0.104
	anymap2@0.13.0
	archery@1.2.3
	arrayvec@0.7.8
	as_variant@1.3.0
	ashpd@0.13.13
	assign@1.1.1
	async-broadcast@0.7.2
	async-channel@2.5.0
	async-compression@0.4.51
	async-recursion@1.2.0
	async-stream-impl@0.3.6
	async-stream@0.3.6
	async-trait@0.1.92
	atk-sys@0.19.0
	atk@0.19.0
	atomic-waker@1.1.2
	autocfg@1.5.1
	aws-lc-rs@1.18.2
	aws-lc-sys@0.46.0
	backon@1.6.0
	base16ct@1.0.0
	base64@0.22.1
	base64@0.23.1
	base64ct@1.8.3
	bitflags@2.13.2
	blake3@1.8.7
	block-buffer@0.10.4
	block-buffer@0.12.1
	block-padding@0.3.3
	block-padding@0.4.2
	bs58@0.5.1
	bumpalo@3.20.3
	bytemuck@1.25.2
	byteorder@1.5.0
	bytes@1.12.1
	bytesize@2.7.0
	cairo-rs@0.22.9
	cairo-sys-rs@0.22.9
	cbc@0.1.2
	cbc@0.2.1
	cc@1.8.0
	cfg-expr@0.20.10
	cfg-if@1.0.5
	cfg_aliases@0.2.2
	chacha20@0.10.2
	chacha20poly1305@0.11.0
	chrono@0.4.45
	cipher@0.4.4
	cipher@0.5.2
	cmake@0.1.58
	cmov@0.5.4
	combine@4.6.9
	compression-codecs@0.4.46
	compression-core@0.4.34
	concurrent-queue@2.5.0
	const-oid@0.10.2
	const_panic@0.2.17
	constant_time_eq@0.4.2
	core-foundation-sys@0.8.7
	core-foundation@0.10.1
	cpubits@0.1.1
	cpufeatures@0.2.17
	cpufeatures@0.3.1
	crc32fast@1.5.2
	crossbeam-utils@0.8.23
	crypto-common@0.1.7
	crypto-common@0.2.2
	ctr@0.10.1
	ctutils@0.4.3
	curve25519-dalek-derive@0.1.1
	curve25519-dalek@5.0.0
	date_header@1.0.5
	deadpool-runtime@0.3.1
	deadpool-sync@0.2.0
	deadpool@0.13.1
	decancer@3.3.3
	delegate-display@3.0.1
	deranged@0.5.9
	derivative@2.2.0
	derive_more-impl@1.0.0
	derive_more-impl@2.1.1
	derive_more@1.0.0
	derive_more@2.1.1
	digest@0.10.7
	digest@0.11.3
	directories@6.0.0
	dirs-sys@0.5.0
	displaydoc@0.2.7
	downcast-rs@1.2.1
	dunce@1.0.5
	ed25519-dalek@3.0.0
	ed25519@3.0.0
	either@1.19.0
	endi@1.1.1
	enumflags2@0.7.12
	enumflags2_derive@0.7.12
	equivalent@1.0.3
	errno@0.3.14
	event-listener-strategy@0.5.4
	event-listener@5.4.2
	eyeball-im@0.9.1
	eyeball@0.8.8
	fallible-iterator@0.3.0
	fallible-streaming-iterator@0.1.9
	fancy_constructor@2.1.1
	fastrand@2.5.0
	fiat-crypto@0.3.0
	field-offset@0.3.6
	find-msvc-tools@0.1.14
	flate2@1.1.10
	fnv@1.0.7
	foldhash@0.2.0
	form_urlencoded@1.2.2
	fs_extra@1.3.0
	futures-channel@0.3.34
	futures-core@0.3.34
	futures-executor@0.3.34
	futures-io@0.3.34
	futures-lite@2.6.1
	futures-macro@0.3.34
	futures-sink@0.3.34
	futures-task@0.3.34
	futures-util@0.3.34
	gdk-pixbuf-sys@0.22.9
	gdk-pixbuf@0.22.0
	gdk-sys@0.19.0
	gdk@0.19.0
	generic-array@0.14.7
	getrandom@0.2.17
	getrandom@0.3.4
	getrandom@0.4.3
	gio-sys@0.22.9
	gio@0.22.10
	glib-macros@0.22.9
	glib-sys@0.22.9
	glib@0.22.10
	gloo-timers@0.3.0
	gloo-timers@0.4.0
	gloo-utils@0.3.0
	gobject-sys@0.22.9
	growable-bloom-filter@2.1.1
	gtk-sys@0.19.0
	gtk3-macros@0.19.0
	gtk@0.19.0
	h2@0.4.20
	hashbrown@0.16.1
	hashbrown@0.17.1
	hashlink@0.12.2
	heck@0.5.0
	hermit-abi@0.5.3
	hex@0.4.3
	hkdf@0.12.4
	hkdf@0.13.0
	hmac@0.12.1
	hmac@0.13.0
	hpke@0.14.1
	html5ever@0.39.0
	http-body-util@0.1.5
	http-body@1.1.0
	http@1.5.0
	httparse@1.10.1
	hybrid-array@0.4.15
	hyper-rustls@0.27.10
	hyper-util@0.1.21
	hyper@1.12.0
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.65
	icu_collections@2.3.0
	icu_locale_core@2.3.0
	icu_normalizer@2.3.0
	icu_normalizer_data@2.3.0
	icu_properties@2.3.0
	icu_properties_data@2.3.0
	icu_provider@2.3.1
	idna@1.1.0
	idna_adapter@1.2.2
	imbl-sized-chunks@0.2.0
	imbl@7.0.2
	impartial-ord@2.0.0
	indexmap@2.14.2
	inout@0.1.4
	inout@0.2.4
	ipnet@2.12.2
	itertools@0.14.0
	itertools@0.15.0
	itoa@1.0.18
	jni-macros@0.22.4
	jni-sys-macros@0.4.1
	jni-sys@0.4.1
	jni@0.22.4
	jobserver@0.1.35
	js-sys@0.3.106
	js_int@0.2.2
	js_option@0.2.0
	konst@0.4.3
	ksni@0.3.6
	language-tags@0.3.2
	lazy_static@1.5.1
	libc@0.2.191
	libm@0.2.16
	libredox@0.1.25
	libsqlite3-sys@0.38.2
	linux-raw-sys@0.12.1
	litemap@0.8.3
	lock_api@0.4.14
	log@0.4.34
	lru-slab@0.1.3
	macroific@2.0.0
	macroific@3.1.0
	macroific_attr_parse@2.0.0
	macroific_attr_parse@3.1.0
	macroific_core@2.0.0
	macroific_core@3.1.0
	macroific_macro@2.0.0
	macroific_macro@3.1.0
	maplit@1.0.2
	markup5ever@0.39.0
	matchers@0.2.0
	matrix-pickle-derive@0.2.3
	matrix-pickle@0.2.3
	matrix-sdk-base@0.19.1
	matrix-sdk-common@0.19.1
	matrix-sdk-crypto@0.19.1
	matrix-sdk-indexeddb@0.19.1
	matrix-sdk-sqlite@0.19.1
	matrix-sdk-store-encryption@0.19.1
	matrix-sdk@0.19.1
	matrix_indexed_db_futures@0.7.0
	matrix_indexed_db_futures_macros_internal@1.0.0
	md-5@0.10.6
	memchr@2.8.3
	memoffset@0.9.1
	mime2ext@0.1.54
	mime@0.3.17
	mime_guess@2.0.5
	miniz_oxide@0.9.1
	mio@1.2.4
	new_debug_unreachable@1.0.6
	nu-ansi-term@0.50.3
	num-bigint-dig@0.9.1
	num-bigint@0.4.8
	num-complex@0.4.6
	num-conv@0.2.2
	num-integer@0.1.47
	num-iter@0.1.46
	num-rational@0.4.2
	num-traits@0.2.19
	num@0.4.3
	num_cpus@1.17.0
	oauth2-reqwest@0.1.0-alpha.3
	oauth2@5.0.0
	once_cell@1.21.4
	oo7@0.6.0
	openssl-probe@0.2.1
	option-ext@0.2.0
	ordered-stream@0.2.0
	pango-sys@0.22.9
	pango@0.22.9
	parking@2.2.1
	parking_lot@0.12.5
	parking_lot_core@0.9.12
	pastey@0.2.3
	pbkdf2@0.12.2
	pbkdf2@0.13.0
	percent-encoding@2.3.2
	phf@0.13.1
	phf_codegen@0.13.1
	phf_generator@0.13.1
	phf_shared@0.13.1
	pin-project-lite@0.2.17
	pkg-config@0.3.34
	poly1305@0.9.1
	potential_utf@0.1.6
	powerfmt@0.2.1
	ppv-lite86@0.2.21
	precomputed-hash@0.1.1
	proc-macro-crate@3.5.0
	proc-macro2@1.0.107
	prost-derive@0.14.4
	prost@0.14.4
	quick-xml@0.41.0
	quinn-proto@0.11.19
	quinn-udp@0.5.16
	quinn@0.11.12
	quote@1.0.47
	r-efi@5.3.0
	r-efi@6.0.0
	rand@0.10.3
	rand@0.8.8
	rand@0.9.5
	rand_chacha@0.3.1
	rand_chacha@0.9.0
	rand_core@0.10.1
	rand_core@0.6.4
	rand_core@0.9.5
	rand_pcg@0.10.2
	rand_xoshiro@0.7.0
	readlock-tokio@0.1.6
	readlock@0.1.11
	redox_syscall@0.5.18
	redox_users@0.5.3
	regex-automata@0.4.18
	regex-syntax@0.8.11
	regex@1.13.1
	reqwest@0.13.5
	ring@0.17.14
	rmp-serde@1.3.1
	rmp@0.8.15
	rsqlite-vfs@0.1.1
	ruma-client-api@0.25.0
	ruma-common@0.20.0
	ruma-events@0.35.0
	ruma-html@0.9.0
	ruma-identifiers-validation@0.12.1
	ruma-macros@0.20.0
	ruma@0.17.0
	rusqlite@0.40.2
	rustc-hash@2.1.3
	rustc_version@0.4.1
	rustix@1.1.5
	rustls-native-certs@0.8.5
	rustls-pki-types@1.15.1
	rustls-platform-verifier-android@0.2.0
	rustls-platform-verifier@0.7.1
	rustls-webpki@0.103.15
	rustls@0.23.46
	rustversion@1.0.23
	safe_arch@0.7.4
	same-file@1.0.6
	schannel@0.1.30
	scopeguard@1.2.0
	sealed@0.6.0
	sealed@0.7.0
	security-framework-sys@2.17.0
	security-framework@3.7.0
	semver@1.0.28
	serde-wasm-bindgen@0.6.5
	serde@1.0.229
	serde_bytes@0.11.19
	serde_core@1.0.229
	serde_derive@1.0.229
	serde_html_form@0.4.1
	serde_json@1.0.154
	serde_path_to_error@0.1.20
	serde_repr@0.1.21
	serde_spanned@1.1.2
	serdect@0.4.3
	sha2@0.10.9
	sha2@0.11.1
	sharded-slab@0.1.7
	shlex@2.0.1
	signal-hook-registry@1.4.8
	signature@3.0.0
	simd-adler32@0.3.10
	simd_cesu8@1.2.0
	simdutf8@0.1.5
	siphasher@1.0.4
	slab@0.4.12
	smallvec@1.16.3
	socket2@0.6.5
	sqlite-wasm-rs@0.5.5
	stable_deref_trait@1.2.1
	string_cache@0.9.0
	string_cache_codegen@0.6.1
	subtle@2.6.1
	syn@1.0.109
	syn@2.0.119
	syn@3.0.9
	sync_wrapper@1.0.2
	synstructure@0.14.0
	system-deps@9.0.0
	target-lexicon@0.13.5
	tempfile@3.27.0
	tendril@0.5.1
	thiserror-impl@1.0.69
	thiserror-impl@2.0.21
	thiserror@1.0.69
	thiserror@2.0.21
	thread_local@1.1.10
	time-core@0.1.9
	time-macros@0.2.32
	time@0.3.55
	tinystr@0.8.4
	tinyvec@1.13.3
	tokio-macros@2.7.2
	tokio-rustls@0.26.6
	tokio-stream@0.1.19
	tokio-util@0.7.20
	tokio@1.53.3
	toml@1.1.8+spec-1.1.0
	toml_datetime@1.1.2+spec-1.1.0
	toml_edit@0.25.17+spec-1.1.0
	toml_parser@1.1.5+spec-1.1.0
	toml_writer@1.1.3+spec-1.1.0
	tower-http@0.6.11
	tower-layer@0.3.3
	tower-service@0.3.3
	tower@0.5.3
	tracing-attributes@0.1.31
	tracing-core@0.1.36
	tracing-log@0.2.0
	tracing-subscriber@0.3.23
	tracing@0.1.44
	try-lock@0.2.5
	typenum@1.20.1
	typewit@1.15.2
	uds_windows@1.2.1
	ulid@3.0.0
	unicase@2.10.0
	unicode-ident@1.0.27
	unicode-normalization@0.1.26
	unicode-xid@0.2.6
	universal-hash@0.6.1
	untrusted@0.9.0
	url@2.5.8
	utf8_iter@1.0.4
	uuid@1.28.0
	valuable@0.1.1
	vcpkg@0.2.15
	version-compare@0.2.1
	version_check@0.9.5
	vodozemac@0.11.1
	walkdir@2.5.0
	want@0.3.2
	wasi@0.11.1+wasi-snapshot-preview1
	wasip2@1.0.4+wasi-0.2.12
	wasm-bindgen-futures@0.4.79
	wasm-bindgen-macro-support@0.2.129
	wasm-bindgen-macro@0.2.129
	wasm-bindgen-shared@0.2.129
	wasm-bindgen@0.2.129
	wasm-streams@0.5.0
	wasm_evt_listener@0.1.0
	wayland-backend@0.3.17
	wayland-client@0.31.15
	wayland-protocols@0.32.13
	wayland-scanner@0.31.11
	wayland-sys@0.31.11
	web-sys@0.3.106
	web-time@1.1.0
	web_atoms@0.2.6
	webpki-root-certs@1.0.9
	wide@0.7.33
	wildmatch@2.6.1
	winapi-util@0.1.11
	windows-core@0.62.2
	windows-implement@0.60.2
	windows-interface@0.59.3
	windows-link@0.2.1
	windows-result@0.4.1
	windows-strings@0.5.1
	windows-sys@0.52.0
	windows-sys@0.61.2
	windows-targets@0.52.6
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.52.6
	winnow@1.0.4
	wit-bindgen@0.57.1
	writeable@0.6.4
	x25519-dalek@3.0.0
	xxhash-rust@0.8.19
	yoke-derive@0.8.4
	yoke@0.8.3
	zbus@5.19.0
	zbus_macros@5.19.0
	zbus_names@4.3.5
	zcheapstr@1.1.0
	zerocopy-derive@0.8.63
	zerocopy@0.8.63
	zerofrom-derive@0.1.8
	zerofrom@0.1.8
	zeroize@1.9.1
	zeroize_derive@1.5.0
	zerotrie@0.2.5
	zerovec-derive@0.11.6
	zerovec@0.11.8
	zlib-rs@0.6.8
	zmij@1.0.23
	zvariant@5.15.1
	zvariant_derive@5.15.1
	zvariant_utils@4.2.0
"

inherit cargo desktop xdg

DESCRIPTION="MSN-Messenger-style desktop client for Matrix"
HOMEPAGE="https://github.com/DMJC/msm"
SRC_URI="https://github.com/DMJC/msm/archive/refs/tags/v${PV}.tar.gz
	-> ${P}.tar.gz
	${CARGO_CRATE_URIS}"

LICENSE="GPL-3+"
# Dependent crate licenses
LICENSE+=" Apache-2.0 BSD MIT"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="
	x11-libs/gtk+:3
	media-libs/opus
	dev-db/sqlite:3
"
RDEPEND="${DEPEND}"
BDEPEND="
	virtual/pkgconfig
"

src_configure() {
	cargo_src_configure
}

src_install() {
	cargo_src_install
	domenu data/com.matrixmessenger.Msm.desktop
	local icon_path="data/icons/hicolor/scalable/apps"
	icon_path+="/com.matrixmessenger.Msm.svg"
	newicon -s scalable "${icon_path}" com.matrixmessenger.Msm.svg
}