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

# Autogenerated by pycargoebuild 0.13.2

EAPI=8

CRATES="
	addr2line@0.22.0
	adler@1.0.2
	aes@0.8.4
	ahash@0.7.8
	ahash@0.8.11
	aho-corasick@1.1.3
	allo-isolate@0.1.25
	alloc-no-stdlib@2.0.4
	alloc-stdlib@0.2.2
	allocator-api2@0.2.18
	alsa-sys@0.3.1
	alsa@0.9.0
	android-tzdata@0.1.1
	android_log-sys@0.3.1
	android_logger@0.13.3
	android_system_properties@0.1.5
	ansi_term@0.12.1
	anstream@0.6.14
	anstyle-parse@0.2.4
	anstyle-query@1.1.0
	anstyle-wincon@3.0.3
	anstyle@1.0.7
	anyhow@1.0.86
	async-broadcast@0.5.1
	async-channel@2.3.1
	async-compression@0.4.11
	async-executor@1.12.0
	async-fs@1.6.0
	async-io@1.13.0
	async-io@2.3.3
	async-lock@2.8.0
	async-lock@3.4.0
	async-process@1.8.1
	async-recursion@1.1.1
	async-signal@0.2.8
	async-task@4.7.1
	async-trait@0.1.80
	atk-sys@0.18.0
	atk@0.18.0
	atomic-waker@1.1.2
	atomic@0.5.3
	atty@0.2.14
	autocfg@0.1.8
	autocfg@1.3.0
	backtrace@0.3.73
	base32@0.4.0
	base64@0.21.7
	base64@0.22.1
	base64ct@1.6.0
	bindgen@0.59.2
	bindgen@0.65.1
	bindgen@0.69.4
	bit_field@0.10.2
	bitflags@1.3.2
	bitflags@2.6.0
	bitmask-enum@2.2.4
	bitvec@1.0.1
	block-buffer@0.10.4
	block-sys@0.1.0-beta.1
	block2@0.2.0-alpha.6
	block2@0.5.1
	block@0.1.6
	blocking@1.6.1
	brotli-decompressor@2.5.1
	brotli@3.5.0
	build-target@0.4.0
	bumpalo@3.16.0
	bytemuck@1.16.1
	byteorder@1.5.0
	bytes@1.6.0
	bzip2-sys@0.1.11+1.0.8
	bzip2@0.4.4
	cairo-rs@0.18.5
	cairo-sys-rs@0.18.2
	cc@1.0.102
	cesu8@1.1.0
	cexpr@0.6.0
	cfg-expr@0.15.8
	cfg-if@0.1.10
	cfg-if@1.0.0
	cfg_aliases@0.1.1
	chrono@0.4.38
	cidr-utils@0.5.11
	cipher@0.4.4
	clang-sys@1.8.1
	clap@2.34.0
	clap@4.5.8
	clap_builder@4.5.8
	clap_lex@0.7.1
	clipboard-win@5.4.0
	cloudabi@0.0.3
	cmake@0.1.50
	cocoa-foundation@0.1.2
	cocoa@0.24.1
	cocoa@0.25.0
	color_quant@1.1.0
	colorchoice@1.0.1
	combine@4.6.7
	concurrent-queue@2.5.0
	console_error_panic_hook@0.1.7
	const_fn@0.4.10
	const_format@0.2.32
	const_format_proc_macros@0.2.32
	constant_time_eq@0.1.5
	constant_time_eq@0.2.6
	core-foundation-sys@0.8.6
	core-foundation@0.9.4
	core-graphics-types@0.1.3
	core-graphics@0.22.3
	core-graphics@0.23.2
	coreaudio-rs@0.11.3
	coreaudio-sys@0.2.15
	cpal@0.15.3
	cpufeatures@0.2.12
	crc32fast@1.4.2
	crossbeam-channel@0.5.13
	crossbeam-deque@0.8.5
	crossbeam-epoch@0.9.18
	crossbeam-queue@0.3.11
	crossbeam-utils@0.8.20
	crunchy@0.2.2
	crypto-common@0.1.6
	ctrlc@3.4.4
	dart-sys@4.1.5
	dashmap@5.5.3
	dasp@0.11.0
	dasp_envelope@0.11.0
	dasp_frame@0.11.0
	dasp_interpolate@0.11.0
	dasp_peak@0.11.0
	dasp_ring_buffer@0.11.0
	dasp_rms@0.11.0
	dasp_sample@0.11.0
	dasp_signal@0.11.0
	dasp_slice@0.11.0
	dasp_window@0.11.1
	dbus-crossroads@0.5.2
	dbus@0.9.7
	debug-helper@0.3.13
	default-net@0.14.1
	deranged@0.3.11
	derivative@2.2.0
	digest@0.10.7
	directories-next@2.0.0
	dirs-next@2.0.0
	dirs-sys-next@0.1.2
	dirs-sys@0.3.7
	dirs-sys@0.4.1
	dirs@2.0.2
	dirs@5.0.1
	dispatch@0.2.0
	dlib@0.5.2
	dlopen2@0.4.1
	dlopen2_derive@0.2.0
	dlopen@0.1.8
	dlopen_derive@0.1.4
	dlv-list@0.3.0
	docopt@1.1.1
	downcast-rs@1.2.1
	dpi@0.1.1
	dtoa@0.4.8
	ed25519@1.5.3
	either@1.13.0
	encoding_rs@0.8.34
	enquote@1.1.0
	enum-map-derive@0.17.0
	enum-map@2.7.3
	enumflags2@0.7.10
	enumflags2_derive@0.7.10
	env_logger@0.10.2
	env_logger@0.9.3
	epoll@4.3.3
	equivalent@1.0.1
	errno@0.3.9
	error-code@3.2.0
	event-listener-strategy@0.5.2
	event-listener@2.5.3
	event-listener@3.1.0
	event-listener@5.3.1
	exr@1.72.0
	fastrand@1.9.0
	fastrand@2.1.0
	fdeflate@0.3.4
	field-offset@0.3.6
	filetime@0.2.23
	fixedbitset@0.4.2
	flate2@1.0.30
	flexi_logger@0.27.4
	flume@0.11.0
	flutter_rust_bridge@1.80.1
	flutter_rust_bridge_macros@1.82.6
	fnv@1.0.7
	fon@0.6.0
	foreign-types-macros@0.2.3
	foreign-types-shared@0.1.1
	foreign-types-shared@0.3.1
	foreign-types@0.3.2
	foreign-types@0.5.0
	form_urlencoded@1.2.1
	fruitbasket@0.10.0
	fuchsia-cprng@0.1.1
	funty@2.0.0
	fuser@0.13.0
	futures-channel@0.3.30
	futures-core@0.3.30
	futures-executor@0.3.30
	futures-io@0.3.30
	futures-lite@1.13.0
	futures-lite@2.3.0
	futures-macro@0.3.30
	futures-sink@0.3.30
	futures-task@0.3.30
	futures-util@0.3.30
	futures@0.3.30
	gdk-pixbuf-sys@0.18.0
	gdk-pixbuf@0.18.5
	gdk-sys@0.18.0
	gdk@0.18.0
	gdkwayland-sys@0.18.0
	gdkx11-sys@0.18.0
	generic-array@0.14.7
	gethostname@0.3.0
	gethostname@0.4.3
	getrandom@0.2.15
	gif@0.13.1
	gimli@0.29.0
	gio-sys@0.18.1
	gio@0.18.4
	git2@0.16.1
	glib-macros@0.10.1
	glib-macros@0.18.5
	glib-sys@0.10.1
	glib-sys@0.18.1
	glib@0.10.3
	glib@0.18.5
	glob@0.3.1
	gobject-sys@0.10.0
	gobject-sys@0.18.0
	gstreamer-app-sys@0.9.1
	gstreamer-app@0.16.5
	gstreamer-base-sys@0.9.1
	gstreamer-base@0.16.5
	gstreamer-sys@0.9.1
	gstreamer-video-sys@0.9.1
	gstreamer-video@0.16.7
	gstreamer@0.16.7
	gtk-sys@0.18.0
	gtk3-macros@0.18.0
	gtk@0.18.1
	h2@0.3.26
	half@2.4.1
	hashbrown@0.12.3
	hashbrown@0.14.5
	heck@0.3.3
	heck@0.4.1
	heck@0.5.0
	hermit-abi@0.1.19
	hermit-abi@0.3.9
	hermit-abi@0.4.0
	hex@0.4.3
	hmac@0.12.1
	home@0.5.9
	hound@3.5.1
	html-escape@0.2.13
	http-body@0.4.6
	http@0.2.12
	httparse@1.9.4
	httpdate@1.0.3
	humantime@2.1.0
	hyper-rustls@0.24.2
	hyper-tls@0.5.0
	hyper@0.14.29
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.60
	idna@0.5.0
	image@0.24.9
	image@0.25.1
	include_dir@0.7.4
	include_dir_macros@0.7.4
	indexmap@2.2.6
	inotify-sys@0.1.5
	inotify@0.10.2
	inout@0.1.3
	instant@0.1.13
	io-lifetimes@1.0.11
	ipnet@2.9.0
	is-terminal@0.4.12
	is_debug@1.0.1
	is_terminal_polyfill@1.70.0
	itertools@0.12.1
	itertools@0.9.0
	itoa@0.3.4
	itoa@1.0.11
	jni-sys@0.3.0
	jni@0.19.0
	jni@0.21.1
	jobserver@0.1.31
	jpeg-decoder@0.3.1
	js-sys@0.3.69
	kernel32-sys@0.2.2
	keyboard-types@0.7.0
	lazy_static@1.5.0
	lazycell@1.3.0
	lebe@0.5.2
	libappindicator-sys@0.9.0
	libappindicator@0.9.0
	libc@0.2.155
	libdbus-sys@0.2.5
	libgit2-sys@0.14.2+1.5.1
	libloading@0.7.4
	libloading@0.8.4
	libm@0.2.8
	libpulse-binding@2.28.1
	libpulse-simple-binding@2.28.1
	libpulse-simple-sys@1.21.1
	libpulse-sys@1.21.0
	libredox@0.1.3
	libsamplerate-sys@0.1.12
	libsodium-sys@0.2.7
	libxdo-sys@0.11.0
	libxdo@0.6.0
	libz-sys@1.1.18
	line-wrap@0.2.0
	linux-raw-sys@0.3.8
	linux-raw-sys@0.4.14
	lock_api@0.4.12
	log@0.4.22
	mac_address@1.1.7
	mach2@0.4.2
	malloc_buf@0.0.6
	md5@0.7.0
	memalloc@0.1.0
	memchr@2.7.4
	memoffset@0.6.5
	memoffset@0.7.1
	memoffset@0.9.1
	mime@0.3.17
	minimal-lexical@0.2.1
	miniz_oxide@0.7.4
	mio@0.8.11
	muda@0.13.5
	muldiv@0.2.1
	native-tls@0.2.12
	native-windows-gui@1.0.13
	ndk-context@0.1.1
	ndk-sys@0.4.1+23.1.7779620
	ndk-sys@0.5.0+25.2.9519653
	ndk@0.7.0
	ndk@0.8.0
	netlink-packet-core@0.5.0
	netlink-packet-route@0.15.0
	netlink-packet-utils@0.5.2
	netlink-sys@0.8.6
	nix@0.23.2
	nix@0.26.4
	nix@0.28.0
	nom@7.1.3
	ntapi@0.4.1
	nu-ansi-term@0.49.0
	num-bigint@0.4.6
	num-complex@0.4.6
	num-conv@0.1.0
	num-derive@0.3.3
	num-derive@0.4.2
	num-integer@0.1.46
	num-rational@0.3.2
	num-traits@0.1.43
	num-traits@0.2.19
	num_cpus@1.16.0
	num_enum@0.5.11
	num_enum@0.7.2
	num_enum_derive@0.5.11
	num_enum_derive@0.7.2
	num_threads@0.1.7
	objc-foundation@0.1.1
	objc-sys@0.2.0-beta.2
	objc-sys@0.3.5
	objc2-app-kit@0.2.2
	objc2-core-data@0.2.2
	objc2-core-image@0.2.2
	objc2-encode@2.0.0-pre.2
	objc2-encode@4.0.3
	objc2-foundation@0.2.2
	objc2-metal@0.2.2
	objc2-quartz-core@0.2.2
	objc2@0.3.0-beta.2
	objc2@0.5.2
	objc@0.2.7
	objc_exception@0.1.2
	objc_id@0.1.1
	object@0.36.1
	oboe-sys@0.6.1
	oboe@0.6.1
	once_cell@1.19.0
	openssl-macros@0.1.1
	openssl-probe@0.1.5
	openssl-sys@0.9.102
	openssl@0.10.64
	option-ext@0.2.0
	ordered-multimap@0.4.3
	ordered-stream@0.2.0
	os-version@0.2.0
	os_info@3.8.2
	os_pipe@1.2.0
	osascript@0.3.0
	page_size@0.5.0
	pam-macros@0.0.3
	pango-sys@0.18.0
	pango@0.18.3
	parking@2.2.0
	parking_lot@0.12.3
	parking_lot_core@0.9.10
	password-hash@0.4.2
	paste@1.0.15
	pbkdf2@0.11.0
	peeking_take_while@0.1.2
	percent-encoding@2.3.1
	petgraph@0.6.5
	phf@0.7.24
	phf_codegen@0.7.24
	phf_generator@0.7.24
	phf_shared@0.7.24
	pin-project-internal@1.1.5
	pin-project-lite@0.2.14
	pin-project@1.1.5
	pin-utils@0.1.0
	piper@0.2.3
	pkg-config@0.3.30
	plist@1.6.1
	png@0.17.13
	polling@2.8.0
	polling@3.7.2
	powerfmt@0.2.0
	ppv-lite86@0.2.17
	pretty-hex@0.2.1
	prettyplease@0.2.20
	primal-check@0.3.4
	proc-macro-crate@0.1.5
	proc-macro-crate@1.3.1
	proc-macro-crate@2.0.2
	proc-macro-error-attr@1.0.4
	proc-macro-error@1.0.4
	proc-macro2@0.4.30
	proc-macro2@1.0.86
	protobuf-codegen@3.5.0
	protobuf-parse@3.5.0
	protobuf-support@3.5.0
	protobuf@3.5.0
	qoi@0.4.1
	qrcode-generator@4.1.9
	qrcodegen@1.8.0
	quest@0.3.0
	quick-xml@0.30.0
	quick-xml@0.31.0
	quick-xml@0.34.0
	quote@0.6.13
	quote@1.0.36
	radium@0.7.0
	rand@0.6.5
	rand@0.8.5
	rand_chacha@0.1.1
	rand_chacha@0.3.1
	rand_core@0.3.1
	rand_core@0.4.2
	rand_core@0.6.4
	rand_hc@0.1.0
	rand_isaac@0.1.1
	rand_jitter@0.1.4
	rand_os@0.1.3
	rand_pcg@0.1.2
	rand_xorshift@0.1.1
	raw-window-handle@0.5.2
	raw-window-handle@0.6.2
	rayon-core@1.12.1
	rayon@1.10.0
	rdrand@0.4.0
	realfft@3.3.0
	redox_syscall@0.4.1
	redox_syscall@0.5.2
	redox_users@0.4.5
	regex-automata@0.4.7
	regex-syntax@0.8.4
	regex@1.10.5
	repng@0.2.2
	ring@0.17.8
	ringbuf@0.3.3
	rpassword@2.1.0
	rpassword@7.3.1
	rtoolbox@0.0.2
	rubato@0.12.0
	runas@1.2.0
	rust-ini@0.18.0
	rustc-demangle@0.1.24
	rustc-hash@1.1.0
	rustc_version@0.4.0
	rustfft@6.2.0
	rustix@0.37.27
	rustix@0.38.34
	rustls-native-certs@0.6.3
	rustls-native-certs@0.7.0
	rustls-pemfile@1.0.4
	rustls-pemfile@2.1.2
	rustls-pki-types@1.7.0
	rustls-platform-verifier-android@0.1.0
	rustls-platform-verifier@0.3.2
	rustls-webpki@0.101.7
	rustls-webpki@0.102.4
	rustls@0.21.12
	rustls@0.23.10
	rustversion@1.0.17
	ryu@1.0.18
	same-file@1.0.6
	samplerate@0.2.4
	schannel@0.1.23
	scoped-tls@1.0.1
	scopeguard@1.2.0
	sct@0.7.1
	security-framework-sys@2.11.0
	security-framework@2.10.0
	semver@1.0.23
	serde@0.9.15
	serde@1.0.203
	serde_derive@1.0.203
	serde_json@0.9.10
	serde_json@1.0.118
	serde_repr@0.1.19
	serde_spanned@0.6.6
	serde_urlencoded@0.7.1
	sha1@0.10.6
	sha2@0.10.8
	shadow-rs@0.21.0
	shared_memory@0.12.4
	shlex@1.3.0
	shutdown_hooks@0.1.0
	signal-hook-registry@1.4.2
	signature@1.6.4
	simd-adler32@0.3.7
	siphasher@0.2.3
	slab@0.4.9
	smallvec@1.13.2
	socket2@0.3.19
	socket2@0.4.10
	socket2@0.5.7
	sodiumoxide@0.2.7
	spin@0.9.8
	static_assertions@1.1.0
	strength_reduce@0.2.4
	strsim@0.10.0
	strsim@0.11.1
	strsim@0.8.0
	strum@0.18.0
	strum@0.24.1
	strum_macros@0.18.0
	strum_macros@0.24.3
	subtle@2.6.1
	syn@0.15.44
	syn@1.0.109
	syn@2.0.68
	sync_wrapper@0.1.2
	sys-locale@0.3.1
	system-configuration-sys@0.5.0
	system-configuration@0.5.1
	system-deps@1.3.2
	system-deps@6.2.2
	system_shutdown@4.0.1
	tap@1.0.1
	target-lexicon@0.12.14
	target_build_utils@0.3.1
	tauri-winrt-notification@0.1.3
	tempfile@3.10.1
	termcolor@1.4.1
	termios@0.3.3
	textwrap@0.11.0
	thiserror-impl@1.0.61
	thiserror@1.0.61
	threadpool@1.8.1
	tiff@0.9.1
	time-core@0.1.2
	time-macros@0.2.18
	time@0.1.45
	time@0.3.36
	tinyvec@1.6.1
	tinyvec_macros@0.1.1
	tokio-macros@2.3.0
	tokio-native-tls@0.3.1
	tokio-rustls@0.24.1
	tokio-rustls@0.26.0
	tokio-socks@0.5.1
	tokio-util@0.7.11
	tokio@1.38.0
	toml@0.5.11
	toml@0.7.8
	toml@0.8.2
	toml_datetime@0.6.3
	toml_edit@0.19.15
	toml_edit@0.20.2
	totp-rs@5.5.1
	tower-service@0.3.2
	tracing-attributes@0.1.27
	tracing-core@0.1.32
	tracing@0.1.40
	transpose@0.2.3
	tree_magic_mini@3.1.5
	try-lock@0.2.5
	typenum@1.17.0
	tz-rs@0.6.14
	tzdb@0.5.10
	tzdb@0.6.1
	tzdb_data@0.1.2
	uds_windows@1.1.0
	uname@0.1.1
	unicode-bidi@0.3.15
	unicode-ident@1.0.12
	unicode-normalization@0.1.23
	unicode-segmentation@1.11.0
	unicode-width@0.1.13
	unicode-xid@0.1.0
	unicode-xid@0.2.4
	untrusted@0.9.0
	url@2.5.2
	urlencoding@2.1.3
	users@0.10.0
	users@0.11.0
	utf16string@0.2.0
	utf8-width@0.1.7
	utf8parse@0.2.2
	uuid@1.9.1
	vcpkg@0.2.15
	vec_map@0.8.2
	version-compare@0.0.10
	version-compare@0.2.0
	version_check@0.9.4
	waker-fn@1.2.0
	walkdir@2.5.0
	want@0.3.1
	wasi@0.10.0+wasi-snapshot-preview1
	wasi@0.11.0+wasi-snapshot-preview1
	wasite@0.1.0
	wasm-bindgen-backend@0.2.92
	wasm-bindgen-futures@0.4.42
	wasm-bindgen-macro-support@0.2.92
	wasm-bindgen-macro@0.2.92
	wasm-bindgen-shared@0.2.92
	wasm-bindgen@0.2.92
	wayland-backend@0.3.6
	wayland-client@0.31.5
	wayland-protocols-wlr@0.3.3
	wayland-protocols@0.32.3
	wayland-scanner@0.31.4
	wayland-sys@0.31.4
	web-sys@0.3.69
	webpki-roots@0.25.4
	webpki-roots@0.26.3
	weezl@0.1.8
	which@4.4.2
	whoami@1.5.1
	widestring@1.1.0
	win-sys@0.3.1
	winapi-build@0.1.1
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.8
	winapi-wsapoll@0.1.2
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.2.8
	winapi@0.3.9
	windows-core@0.51.1
	windows-core@0.52.0
	windows-core@0.54.0
	windows-implement@0.52.0
	windows-interface@0.52.0
	windows-result@0.1.2
	windows-service@0.6.0
	windows-sys@0.45.0
	windows-sys@0.48.0
	windows-sys@0.52.0
	windows-targets@0.42.2
	windows-targets@0.48.5
	windows-targets@0.52.5
	windows-version@0.1.1
	windows-win@3.0.0
	windows@0.32.0
	windows@0.34.0
	windows@0.44.0
	windows@0.48.0
	windows@0.51.1
	windows@0.52.0
	windows@0.54.0
	windows_aarch64_gnullvm@0.42.2
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_gnullvm@0.52.5
	windows_aarch64_msvc@0.32.0
	windows_aarch64_msvc@0.34.0
	windows_aarch64_msvc@0.42.2
	windows_aarch64_msvc@0.48.5
	windows_aarch64_msvc@0.52.5
	windows_i686_gnu@0.32.0
	windows_i686_gnu@0.34.0
	windows_i686_gnu@0.42.2
	windows_i686_gnu@0.48.5
	windows_i686_gnu@0.52.5
	windows_i686_gnullvm@0.52.5
	windows_i686_msvc@0.32.0
	windows_i686_msvc@0.34.0
	windows_i686_msvc@0.42.2
	windows_i686_msvc@0.48.5
	windows_i686_msvc@0.52.5
	windows_x86_64_gnu@0.32.0
	windows_x86_64_gnu@0.34.0
	windows_x86_64_gnu@0.42.2
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnu@0.52.5
	windows_x86_64_gnullvm@0.42.2
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_gnullvm@0.52.5
	windows_x86_64_msvc@0.32.0
	windows_x86_64_msvc@0.34.0
	windows_x86_64_msvc@0.42.2
	windows_x86_64_msvc@0.48.5
	windows_x86_64_msvc@0.52.5
	winnow@0.5.40
	winreg@0.11.0
	winreg@0.50.0
	winres@0.1.12
	wl-clipboard-rs@0.9.0
	wol-rs@1.0.1
	wyz@0.5.1
	x11-clipboard@0.9.2
	x11-dl@2.21.0
	x11@2.21.0
	x11rb-protocol@0.12.0
	x11rb-protocol@0.13.1
	x11rb@0.12.0
	x11rb@0.13.1
	xdg-home@1.2.0
	zbus@3.15.2
	zbus_macros@3.15.2
	zbus_names@2.6.1
	zerocopy-derive@0.6.6
	zerocopy-derive@0.7.34
	zerocopy@0.6.6
	zerocopy@0.7.34
	zeroize@1.8.1
	zip@0.6.6
	zstd-safe@5.0.2+zstd.1.5.2
	zstd-safe@7.1.0
	zstd-sys@2.0.11+zstd.1.5.6
	zstd@0.11.2+zstd.1.5.2
	zstd@0.13.1
	zune-inflate@0.2.54
	zvariant@3.15.2
	zvariant_derive@3.15.2
	zvariant_utils@1.0.1
"

declare -A GIT_CRATES=(
	[android-wakelock]='https://github.com/rustdesk-org/android-wakelock;d0292e5a367e627c4fa6f1ca6bdfad005dca7d90;android-wakelock-%commit%'
	[arboard]='https://github.com/rustdesk-org/arboard;a04bdb1b368a99691822c33bf0f7ed497d6a7a35;arboard-%commit%'
	[cacao]='https://github.com/clslaid/cacao;05e1536b0b43aaae308ec72c0eed703e875b7b95;cacao-%commit%'
	[clipboard-master]='https://github.com/rustdesk-org/clipboard-master;4fb62e5b62fb6350d82b571ec7ba94b3cd466695;clipboard-master-%commit%'
	[confy]='https://github.com/rustdesk-org/confy;83db9ec19a2f97e9718aef69e4fc5611bb382479;confy-%commit%'
	[core-foundation-sys]='https://github.com/madsmtm/core-foundation-rs;7d593d016175755e492a92ef89edca68ac3bd5cd;core-foundation-rs-%commit%/core-foundation-sys'
	[core-foundation]='https://github.com/madsmtm/core-foundation-rs;7d593d016175755e492a92ef89edca68ac3bd5cd;core-foundation-rs-%commit%/core-foundation'
	[core-graphics-types]='https://github.com/madsmtm/core-foundation-rs;7d593d016175755e492a92ef89edca68ac3bd5cd;core-foundation-rs-%commit%/core-graphics-types'
	[core-graphics]='https://github.com/madsmtm/core-foundation-rs;7d593d016175755e492a92ef89edca68ac3bd5cd;core-foundation-rs-%commit%/core-graphics'
	[evdev]='https://github.com/rustdesk-org/evdev;cec616e37790293d2cd2aa54a96601ed6b1b35a9;evdev-%commit%'
	[hwcodec]='https://github.com/rustdesk-org/hwcodec;6abd1898f3a03481ed0c038507b5218d6ea94267;hwcodec-%commit%'
	[impersonate_system]='https://github.com/rustdesk-org/impersonate-system;2f429010a5a10b1fe5eceb553c6672fd53d20167;impersonate-system-%commit%'
	[keepawake]='https://github.com/rustdesk-org/keepawake-rs;64d568586dd16551d02120e19668d2b0fec8e3c9;keepawake-rs-%commit%'
	[machine-uid]='https://github.com/rustdesk-org/machine-uid;381ff579c1dc3a6c54db9dfec47c44bcb0246542;machine-uid-%commit%'
	[magnum-opus]='https://github.com/rustdesk-org/magnum-opus;5cd2bf989c148662fa3a2d9d539a71d71fd1d256;magnum-opus-%commit%'
	[pam-sys]='https://github.com/rustdesk-org/pam-sys;3337c9bb9a9c68d7497ec8c93cad2368c26091b7;pam-sys-%commit%'
	[pam]='https://github.com/rustdesk-org/pam;7bfd25510202cd269292cbdd7c71f3977a6fd762;pam-%commit%'
	[parity-tokio-ipc]='https://github.com/rustdesk-org/parity-tokio-ipc;3623ec9ebef50c9b118e03b03df831008a4d1441;parity-tokio-ipc-%commit%'
	[rdev]='https://github.com/rustdesk-org/rdev;b3434caee84c92412b45a2f655a15ac5dad33488;rdev-%commit%'
	[reqwest]='https://github.com/rustdesk-org/reqwest;9cb758c9fb2f4edc62eb790acfd45a6a3da21ed3;reqwest-%commit%'
	[rust-pulsectl]='https://github.com/open-trade/pulsectl;5e68f4c2b7c644fa321984688602d71e8ad0bba3;pulsectl-%commit%'
	[sciter-rs]='https://github.com/open-trade/rust-sciter;5322f3a755a0e6bf999fbc60d1efc35246c0f821;rust-sciter-%commit%'
	[sysinfo]='https://github.com/rustdesk-org/sysinfo;90b1705d909a4902dbbbdea37ee64db17841077d;sysinfo-%commit%'
	[tao-macros]='https://github.com/rustdesk-org/tao;288c219cb0527e509590c2b2d8e7072aa9feb2d3;tao-%commit%/tao-macros'
	[tao]='https://github.com/rustdesk-org/tao;288c219cb0527e509590c2b2d8e7072aa9feb2d3;tao-%commit%'
	[tfc]='https://github.com/rustdesk-org/The-Fat-Controller;de9c8ba480f166a9fc90aaa47bb0e84b443ea9c6;The-Fat-Controller-%commit%'
	[tokio-socks]='https://github.com/rustdesk-org/tokio-socks;94e97c6d7c93b0bcbfa54f2dc397c1da0a6e43d3;tokio-socks-%commit%'
	[tray-icon]='https://github.com/tauri-apps/tray-icon;d4078696edba67b0ab42cef67e6a421a0332c96f;tray-icon-%commit%'
	[wallpaper]='https://github.com/rustdesk-org/wallpaper.rs;ce4a0cd3f58327c7cc44d15a63706fb0c022bacf;wallpaper.rs-%commit%'
	[webm-sys]='https://github.com/rustdesk-org/rust-webm;d2c4d3ac133c7b0e4c0f656da710b48391981e64;rust-webm-%commit%/src/sys'
	[webm]='https://github.com/rustdesk-org/rust-webm;d2c4d3ac133c7b0e4c0f656da710b48391981e64;rust-webm-%commit%'
	[x11-clipboard]='https://github.com/clslaid/x11-clipboard;5fc2e73bc01ada3681159b34cf3ea8f0d14cd904;x11-clipboard-%commit%'
	[x11]='https://github.com/bjornsnoen/x11-rs;c2e9bfaa7b196938f8700245564d8ac5d447786a;x11-rs-%commit%/x11'
)

LLVM_COMPAT=( 17 18 19 )
RUST_MIN_VER="1.75.0"
RUST_NEEDS_LLVM=1
inherit cargo desktop llvm-r1 systemd xdg

DESCRIPTION="An open-source remote desktop, and alternative to TeamViewer."
HOMEPAGE="https://rustdesk.com/"
_WEBM_PV="1.0.0.31"
_HWCODEC_DEPS_COMMIT="0.1.4"
_HWCODEC_EXTERNALS_COMMIT="fd2ab190c333204d51173794e39fb03d3f2dbb43"
SRC_URI="
	https://github.com/rustdesk/rustdesk/archive/refs/tags/${PV}.tar.gz
		-> ${P}.tar.gz
	https://github.com/st0nie/gentoo-deps/releases/download/vcpkg/vcpkg-20240222.tar.gz
	https://github.com/webmproject/libwebm/archive/refs/tags/libwebm-${_WEBM_PV}.tar.gz
	https://github.com/21pages/deps/archive/refs/tags/${_HWCODEC_DEPS_COMMIT}.tar.gz
		-> hwcodec-deps-${_HWCODEC_DEPS_COMMIT}.tar.gz
	https://github.com/21pages/externals/archive/${_HWCODEC_EXTERNALS_COMMIT}.tar.gz
		-> hwcodec-externals-${_HWCODEC_EXTERNALS_COMMIT}.tar.gz
	https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
		-> ${P}-libsciter-gtk.so

	${CARGO_CRATE_URIS}
"

LICENSE="AGPL-3"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD Boost-1.0 CC0-1.0
	GPL-2 GPL-3 GPL-3+ ISC MIT MPL-2.0 openssl SSLeay Unicode-DFS-2016 Unlicense ZLIB
	Sciter
"
SLOT="0"
KEYWORDS="~amd64"

IUSE="wayland +hwaccel"

RDEPEND="
	media-libs/alsa-lib
	x11-libs/gtk+:3
	x11-libs/libxcb
	x11-libs/libXfixes
	media-libs/libpulse
	x11-misc/xdotool
	media-libs/libva[X]
	wayland? ( media-video/pipewire[gstreamer] )
	hwaccel? ( x11-libs/libvdpau )
"
BDEPEND="
	dev-lang/nasm
	dev-lang/yasm
	media-libs/alsa-lib
	media-libs/libpulse
	dev-build/cmake
	dev-build/ninja
	media-libs/gstreamer
	media-libs/gst-plugins-base
	$(llvm_gen_dep '
		sys-devel/clang:${LLVM_SLOT}
		sys-devel/llvm:${LLVM_SLOT}
	')
"

QA_PRESTRIPPED="
	/usr/share/${PN}/${PN}
	/usr/share/${PN}/libsciter-gtk.so
"

pkg_setup() {
	llvm-r1_pkg_setup
	rust_pkg_setup
}

src_prepare() {
	PATCHES+=(
		"${FILESDIR}"/rust-sciter.patch
	)
	cd "${S}"/.. || die

	default

	cd - || die
	cd ../rust-webm-*/src/sys || die
	rm -rf libwebm/ || die
	ln -s "${WORKDIR}"/libwebm-libwebm-*/ libwebm || die

	local _HWCODEC_COMMIT=`echo "${GIT_CRATES[hwcodec]}" | awk -F';' '{print $2}'`
	rm -rf "${WORKDIR}"/hwcodec-${_HWCODEC_COMMIT}/externals || die
	ln -s "${WORKDIR}"/deps-${_HWCODEC_DEPS_COMMIT}	"${WORKDIR}"/hwcodec-${_HWCODEC_COMMIT}/deps || die
	ln -s "${WORKDIR}"/externals-${_HWCODEC_EXTERNALS_COMMIT} "${WORKDIR}"/hwcodec-${_HWCODEC_COMMIT}/externals || die
	# HACK: this vcpkg bootstrap may be outdated, it needs to copy these libraries manually
	cp -a "${WORKDIR}"/deps-${_HWCODEC_DEPS_COMMIT}/ffmpeg/linux-x86_64/{include,lib}\
		"${WORKDIR}"/vcpkg/installed/x64-linux/ || die
}

src_configure() {
	if use hwaccel ;then
		local myfeatures=(hwcodec)
	fi

	cargo_src_configure
}

src_compile() {
	VCPKG_ROOT="$WORKDIR"/vcpkg cargo_src_compile
}

src_install() {
	local rustdesk_dir="/usr/share/${PN}"

	exeinto "${rustdesk_dir}"
	insinto "${rustdesk_dir}"
	doexe $(cargo_target_dir)/rustdesk
	newins "${DISTDIR}/${P}-libsciter-gtk.so" libsciter-gtk.so
	rm src/ui/*.rs || die
	newbin "${FILESDIR}/rustdesk.sh" rustdesk
	insinto "${rustdesk_dir}/src"
	doins -r src/ui

	newicon -s 32 $(realpath res/32x32.png || die) rustdesk.png
	newicon -s 128 $(realpath res/128x128.png || die) rustdesk.png
	newicon -s 256 $(realpath res/128x128@2x.png || die) rustdesk.png

	domenu "${FILESDIR}"/rustdesk{,-link}.desktop
	systemd_dounit "${FILESDIR}"/rustdesk.service

	einstalldocs
}