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

# Autogenerated by pycargoebuild 0.13.4

EAPI=8

CRATES="
	addr2line@0.24.2
	adler2@2.0.0
	aead@0.5.2
	aes-gcm@0.10.3
	aes@0.8.4
	ahash@0.8.11
	aho-corasick@1.1.3
	alloc-no-stdlib@2.0.4
	alloc-stdlib@0.2.2
	amplify@4.8.0
	amplify_derive@4.0.1
	amplify_num@0.5.3
	amplify_syn@2.0.1
	android-tzdata@0.1.1
	android_system_properties@0.1.5
	anes@0.1.6
	anstream@0.6.18
	anstyle-parse@0.2.6
	anstyle-query@1.1.2
	anstyle-wincon@3.0.7
	anstyle@1.0.10
	anyhow@1.0.96
	arc-swap@1.7.1
	argon2@0.5.3
	arrayref@0.3.9
	arrayvec@0.7.6
	arti-client@0.27.0
	ascii@1.1.0
	asn1-rs-derive@0.5.1
	asn1-rs-impl@0.2.0
	asn1-rs@0.6.2
	async-channel@2.3.1
	async-compression@0.4.18
	async-recursion@1.1.1
	async-stream-impl@0.3.6
	async-stream@0.3.6
	async-task@4.7.1
	async-trait@0.1.86
	async_executors@0.7.0
	asynchronous-codec@0.7.0
	atomic-waker@1.1.2
	atomic@0.5.3
	atomic@0.6.0
	autocfg@1.4.0
	axum-core@0.4.5
	axum-core@0.5.0
	axum-macros@0.5.0
	axum@0.7.9
	axum@0.8.1
	backtrace@0.3.74
	base16ct@0.2.0
	base32@0.4.0
	base64@0.13.1
	base64@0.21.7
	base64@0.22.1
	base64ct@1.6.0
	bcrypt-pbkdf@0.10.0
	bindgen@0.70.1
	bitflags@1.3.2
	bitflags@2.8.0
	bitvec@1.0.1
	blake2@0.10.6
	blake3@1.5.5
	blanket@0.3.0
	block-buffer@0.10.4
	block-padding@0.3.3
	blocking@1.6.1
	blowfish@0.9.1
	bollard-stubs@1.47.1-rc.27.3.1
	bollard@0.18.1
	bounded-vec-deque@0.1.1
	brotli-decompressor@4.0.2
	brotli@7.0.0
	bstr@1.11.3
	bumpalo@3.16.0
	by_address@1.2.1
	byte_string@1.0.0
	bytemuck@1.21.0
	byteorder@1.5.0
	bytes@1.10.0
	c2rust-bitfields-derive@0.19.0
	c2rust-bitfields@0.19.0
	camellia@0.1.0
	caret@0.5.1
	cast@0.3.0
	cbc@0.1.2
	cc@1.2.10
	cexpr@0.6.0
	cfb-mode@0.8.2
	cfg-if@1.0.0
	cfg_aliases@0.2.1
	chacha20@0.9.1
	chacha20poly1305@0.10.1
	chrono@0.4.39
	ciborium-io@0.2.2
	ciborium-ll@0.2.2
	ciborium@0.2.2
	cipher@0.4.4
	clang-sys@1.8.1
	clap@4.5.30
	clap_builder@4.5.30
	clap_derive@4.5.28
	clap_lex@0.7.4
	coarsetime@0.1.35
	colorchoice@1.0.3
	concurrent-queue@2.5.0
	console-api@0.8.1
	console-subscriber@0.4.1
	const-fnv1a-hash@1.1.0
	const-oid@0.9.6
	constant_time_eq@0.2.6
	constant_time_eq@0.3.1
	convert_case@0.6.0
	cookie-factory@0.3.3
	core-foundation-sys@0.8.7
	core-foundation@0.10.0
	cpufeatures@0.2.16
	crc32fast@1.4.2
	criterion-plot@0.5.0
	criterion@0.5.1
	crossbeam-channel@0.5.14
	crossbeam-deque@0.8.6
	crossbeam-epoch@0.9.18
	crossbeam-queue@0.3.12
	crossbeam-utils@0.8.21
	crossbeam@0.8.4
	crunchy@0.2.3
	crypto-bigint@0.5.5
	crypto-common@0.1.6
	ctr@0.9.2
	curve25519-dalek-derive@0.1.1
	curve25519-dalek@4.1.3
	darling@0.14.4
	darling@0.20.10
	darling_core@0.14.4
	darling_core@0.20.10
	darling_macro@0.14.4
	darling_macro@0.20.10
	data-encoding@2.7.0
	defmt-macros@0.4.0
	defmt-parser@0.4.1
	defmt@0.3.10
	delegate@0.13.2
	der-parser@9.0.0
	der@0.7.9
	deranged@0.3.11
	derive-deftly-macros@0.14.2
	derive-deftly@0.14.2
	derive_builder_core_fork_arti@0.11.2
	derive_builder_fork_arti@0.11.2
	derive_builder_macro_fork_arti@0.11.2
	derive_more-impl@1.0.0
	derive_more@1.0.0
	dhat@0.3.3
	dhcproto-macros@0.1.0
	dhcproto@0.12.0
	digest@0.10.7
	directories@5.0.1
	dirs-sys@0.4.1
	dirs-sys@0.5.0
	dirs@5.0.1
	dirs@6.0.0
	displaydoc@0.2.5
	doc-comment@0.3.3
	downcast-rs@2.0.1
	downcast@0.11.0
	dyn-clone@1.0.17
	dynosaur@0.1.2
	dynosaur_derive@0.1.2
	ecdsa@0.16.9
	ed25519-dalek@2.1.1
	ed25519@2.2.3
	educe@0.4.23
	educe@0.6.0
	either@1.13.0
	elliptic-curve@0.13.8
	endian-type@0.1.2
	enum-as-inner@0.5.1
	enum-as-inner@0.6.1
	enum-ordinalize-derive@4.3.1
	enum-ordinalize@3.1.15
	enum-ordinalize@4.3.0
	enum_dispatch@0.3.13
	env_filter@0.1.3
	env_logger@0.11.6
	equivalent@1.0.1
	erased-serde@0.4.5
	errno@0.3.10
	etherparse@0.16.0
	event-listener-strategy@0.5.3
	event-listener@5.4.0
	eyre@0.6.12
	fallible-iterator@0.3.0
	fallible-streaming-iterator@0.1.9
	fastrand@2.3.0
	ff@0.13.0
	fiat-crypto@0.2.9
	figment@0.10.19
	filetime@0.2.25
	fixedbitset@0.4.2
	flate2@1.0.35
	fluid-let@1.0.0
	fnv@1.0.7
	foreign-types-shared@0.3.1
	form_urlencoded@1.2.1
	fragile@2.0.0
	fs-mistrust@0.9.0
	fsevent-sys@4.1.0
	fslock@0.2.1
	funty@2.0.0
	futures-channel@0.3.31
	futures-core@0.3.31
	futures-executor@0.3.31
	futures-io@0.3.31
	futures-lite@2.6.0
	futures-macro@0.3.31
	futures-rustls@0.26.0
	futures-sink@0.3.31
	futures-task@0.3.31
	futures-util@0.3.31
	futures@0.3.31
	fxhash@0.2.1
	generator@0.8.4
	generic-array@0.14.7
	getrandom@0.2.15
	getrandom@0.3.1
	ghash@0.5.1
	gimli@0.31.1
	glob-match@0.2.1
	glob@0.3.2
	group@0.13.0
	h2@0.4.8
	h3-quinn@0.0.7
	h3@0.0.6
	half@2.4.1
	hash32@0.3.1
	hashbrown@0.12.3
	hashbrown@0.14.5
	hashbrown@0.15.2
	hashlink@0.9.1
	hdrhistogram@7.5.4
	heapless@0.8.0
	heck@0.4.1
	heck@0.5.0
	hermit-abi@0.4.0
	hex-literal@0.4.1
	hex@0.4.3
	hickory-client@0.25.0-alpha.4
	hickory-proto@0.25.0-alpha.4
	hickory-resolver@0.25.0-alpha.4
	hickory-server@0.25.0-alpha.4
	hkdf@0.12.4
	hmac@0.12.1
	home@0.5.11
	hostname-validator@1.1.1
	hostname@0.3.1
	http-body-util@0.1.2
	http-body@1.0.1
	http-range-header@0.4.2
	http@1.2.0
	httparse@1.10.0
	httpdate@1.0.3
	humantime-serde@1.1.1
	humantime@2.1.0
	hyper-named-pipe@0.1.0
	hyper-rustls@0.27.5
	hyper-timeout@0.5.2
	hyper-util@0.1.10
	hyper@1.6.0
	hyperlocal@0.9.1
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.61
	icu_collections@1.5.0
	icu_locid@1.5.0
	icu_locid_transform@1.5.0
	icu_locid_transform_data@1.5.0
	icu_normalizer@1.5.0
	icu_normalizer_data@1.5.0
	icu_properties@1.5.1
	icu_properties_data@1.5.0
	icu_provider@1.5.0
	icu_provider_macros@1.5.0
	ident_case@1.0.1
	idna@0.2.3
	idna@1.0.3
	idna_adapter@1.2.0
	indenter@0.3.3
	indexmap@1.9.3
	indexmap@2.7.1
	inotify-sys@0.1.5
	inotify@0.10.2
	inotify@0.11.0
	inout@0.1.3
	instant@0.1.13
	internal-russh-forked-ssh-key@0.6.9+upstream-0.6.7
	inventory@0.3.17
	ip_network@0.4.1
	ip_network_table-deps-treebitmap@0.5.0
	ip_network_table@0.2.0
	ipconfig@0.3.2
	ipnet@2.11.0
	ipnetwork@0.21.1
	is-terminal@0.4.15
	is_terminal_polyfill@1.70.1
	itertools@0.10.5
	itertools@0.13.0
	itertools@0.14.0
	itoa@1.0.14
	js-sys@0.3.77
	keccak@0.1.5
	kqueue-sys@1.0.4
	kqueue@1.0.8
	lazy_static@1.5.0
	libc@0.2.170
	libloading@0.8.6
	libm@0.2.11
	libredox@0.1.3
	libsqlite3-sys@0.30.1
	linux-raw-sys@0.4.15
	litemap@0.7.4
	lock_api@0.4.12
	log@0.4.25
	loom@0.7.2
	lru_time_cache@0.11.11
	mach@0.3.2
	managed@0.8.0
	match_cfg@0.1.0
	matchers@0.1.0
	matches@0.1.10
	matchit@0.7.3
	matchit@0.8.4
	maxminddb@0.25.0
	md-5@0.10.6
	md5@0.7.0
	memchr@2.7.4
	memmap2@0.9.5
	memory-stats@1.2.0
	merlin@3.0.0
	mime@0.3.17
	mime_guess@2.0.5
	minimal-lexical@0.2.1
	miniz_oxide@0.8.3
	mintex@0.1.3
	mio@1.0.3
	mockall@0.13.1
	mockall_derive@0.13.1
	moka@0.12.10
	multimap@0.10.0
	murmur3@0.5.2
	nibble_vec@0.1.0
	nix@0.25.1
	nix@0.29.0
	nom@7.1.3
	notify-types@1.0.1
	notify-types@2.0.0
	notify@7.0.0
	notify@8.0.0
	nu-ansi-term@0.46.0
	num-bigint-dig@0.8.4
	num-bigint@0.4.6
	num-conv@0.1.0
	num-integer@0.1.46
	num-iter@0.1.45
	num-traits@0.2.19
	num_enum@0.7.3
	num_enum_derive@0.7.3
	num_threads@0.1.7
	object@0.36.7
	once_cell@1.20.3
	oneshot-fused-workaround@0.2.1
	oorandom@11.1.4
	opaque-debug@0.3.1
	option-ext@0.2.0
	ordered-float@2.10.1
	os_str_bytes@6.6.1
	overload@0.1.1
	p256@0.13.2
	p384@0.13.0
	p521@0.13.3
	pageant@0.0.2
	parking@2.2.1
	parking_lot@0.12.3
	parking_lot_core@0.9.10
	password-hash@0.5.0
	paste@1.0.15
	pbkdf2@0.12.2
	pem-rfc7468@0.7.0
	percent-encoding@2.3.1
	petgraph@0.6.5
	phf@0.11.3
	phf_generator@0.11.3
	phf_macros@0.11.3
	phf_shared@0.11.3
	pin-project-internal@1.1.8
	pin-project-lite@0.2.16
	pin-project@1.1.8
	pin-utils@0.1.0
	piper@0.2.4
	pkcs1@0.7.5
	pkcs5@0.7.1
	pkcs8@0.10.2
	pkg-config@0.3.31
	plotters-backend@0.3.7
	plotters-svg@0.3.7
	plotters@0.3.7
	poly1305@0.8.0
	polyval@0.6.2
	portable-atomic@1.10.0
	postage@0.5.0
	powerfmt@0.2.0
	ppv-lite86@0.2.20
	predicates-core@1.0.9
	predicates-tree@1.0.12
	predicates@3.1.3
	prefix-trie@0.5.1
	prettyplease@0.2.29
	primeorder@0.13.6
	priority-queue@2.1.1
	proc-macro-crate@3.2.0
	proc-macro-error-attr2@2.0.0
	proc-macro-error2@2.0.1
	proc-macro2@1.0.93
	prost-build@0.13.5
	prost-derive@0.13.5
	prost-types@0.13.5
	prost@0.13.5
	public-suffix@0.1.2
	pwd-grp@1.0.0
	quanta@0.9.3
	quick-error@1.2.3
	quinn-proto@0.11.9
	quinn-udp@0.5.9
	quinn@0.11.6
	quote@1.0.38
	radium@0.7.0
	radix_trie@0.2.1
	rand@0.8.5
	rand@0.9.0
	rand_chacha@0.3.1
	rand_chacha@0.9.0
	rand_core@0.6.4
	rand_core@0.9.0
	raw-cpuid@10.7.0
	rayon-core@1.12.1
	rayon@1.10.0
	redox_syscall@0.5.8
	redox_users@0.4.6
	redox_users@0.5.0
	regex-automata@0.1.10
	regex-automata@0.4.9
	regex-syntax@0.6.29
	regex-syntax@0.8.5
	regex@1.11.1
	register-count@0.1.0
	resolv-conf@0.7.0
	retry-error@0.6.2
	rfc6979@0.4.0
	ring-compat@0.8.0
	ring@0.16.20
	ring@0.17.8
	rsa@0.9.7
	rusqlite@0.32.1
	russh-cryptovec@0.50.2
	russh-util@0.50.0
	russh@0.50.4
	rustc-demangle@0.1.24
	rustc-hash@1.1.0
	rustc-hash@2.1.0
	rustc_version@0.4.1
	rusticata-macros@4.1.0
	rustix@0.38.44
	rustls-pemfile@2.2.0
	rustls-pki-types@1.10.1
	rustls-webpki@0.102.8
	rustls@0.23.23
	rustversion@1.0.19
	ryu@1.0.18
	safelog@0.4.3
	salsa20@0.10.2
	same-file@1.0.6
	sanitize-filename@0.6.0
	scc@2.3.0
	scoped-tls@1.0.1
	scopeguard@1.2.0
	scrypt@0.11.0
	sdd@3.0.5
	sec1@0.7.3
	security-framework-sys@2.14.0
	security-framework@3.2.0
	semver@1.0.25
	sendfd@0.4.3
	serde-value@0.7.0
	serde@1.0.218
	serde_derive@1.0.218
	serde_ignored@0.1.10
	serde_json@1.0.139
	serde_path_to_error@0.1.16
	serde_repr@0.1.19
	serde_spanned@0.6.8
	serde_urlencoded@0.7.1
	serde_with@3.12.0
	serde_with_macros@3.12.0
	serde_yaml@0.9.34+deprecated
	serial_test@3.2.0
	serial_test_derive@3.2.0
	sha1@0.10.6
	sha2@0.10.8
	sha3@0.10.8
	shadowsocks-crypto@0.5.8
	sharded-slab@0.1.7
	shellexpand@3.1.0
	shlex@1.3.0
	signal-hook-registry@1.4.2
	signature@2.2.0
	siphasher@1.0.1
	slab@0.4.9
	slotmap-careful@0.2.3
	slotmap@1.0.7
	smallvec@1.13.2
	smoltcp@0.11.0
	smoltcp@0.12.0
	socket2@0.4.10
	socket2@0.5.8
	spin@0.5.2
	spin@0.9.8
	spki@0.7.3
	ssh-cipher@0.2.0
	ssh-encoding@0.2.0
	ssh-key@0.6.7
	stable_deref_trait@1.2.0
	static_assertions@1.1.0
	strsim@0.10.0
	strsim@0.11.1
	strum@0.26.3
	strum_macros@0.26.4
	subtle@2.6.1
	syn@1.0.109
	syn@2.0.96
	sync_wrapper@1.0.2
	synstructure@0.13.1
	tagptr@0.2.0
	tap@1.0.1
	tempfile@3.17.1
	termtree@0.5.1
	thiserror-impl@1.0.69
	thiserror-impl@2.0.11
	thiserror@1.0.69
	thiserror@2.0.11
	thousands@0.2.0
	thread_local@1.1.8
	tikv-jemalloc-sys@0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7
	tikv-jemallocator@0.6.0
	time-core@0.1.2
	time-macros@0.2.19
	time@0.3.37
	tinystr@0.7.6
	tinystr@0.8.0
	tinytemplate@1.2.1
	tinyvec@1.8.1
	tinyvec_macros@0.1.1
	tokio-macros@2.5.0
	tokio-rustls@0.26.1
	tokio-stream@0.1.17
	tokio-test@0.4.4
	tokio-tfo@0.3.1
	tokio-tungstenite@0.26.2
	tokio-util@0.7.13
	tokio@1.43.0
	toml@0.8.19
	toml_datetime@0.6.8
	toml_edit@0.22.22
	tonic@0.12.3
	tor-async-utils@0.27.0
	tor-basic-utils@0.27.0
	tor-bytes@0.27.0
	tor-cell@0.27.0
	tor-cert@0.27.0
	tor-chanmgr@0.27.0
	tor-checkable@0.27.0
	tor-circmgr@0.27.0
	tor-config-path@0.27.0
	tor-config@0.27.0
	tor-consdiff@0.27.0
	tor-dirclient@0.27.0
	tor-dirmgr@0.27.0
	tor-error@0.27.0
	tor-general-addr@0.27.0
	tor-guardmgr@0.27.0
	tor-hsclient@0.27.0
	tor-hscrypto@0.27.0
	tor-key-forge@0.27.0
	tor-keymgr@0.27.0
	tor-linkspec@0.27.0
	tor-llcrypto@0.27.0
	tor-log-ratelim@0.27.0
	tor-memquota@0.27.0
	tor-netdir@0.27.0
	tor-netdoc@0.27.0
	tor-persist@0.27.0
	tor-proto@0.27.0
	tor-protover@0.27.0
	tor-relay-selection@0.27.0
	tor-rtcompat@0.27.0
	tor-rtmock@0.27.0
	tor-socksproto@0.27.0
	tor-units@0.27.0
	totp-rs@5.6.0
	tower-http@0.6.2
	tower-layer@0.3.3
	tower-service@0.3.3
	tower@0.4.13
	tower@0.5.2
	tracing-appender@0.2.3
	tracing-attributes@0.1.28
	tracing-core@0.1.33
	tracing-log@0.2.0
	tracing-subscriber@0.3.19
	tracing-test-macro@0.2.5
	tracing-test@0.2.5
	tracing-timing@0.6.0
	tracing@0.1.41
	trait-variant@0.1.2
	trust-dns-proto@0.22.0
	try-lock@0.2.5
	tun@0.7.13
	tungstenite@0.26.2
	typed-index-collections@3.1.0
	typeid@1.0.2
	typenum@1.17.0
	uncased@0.9.10
	unicase@2.8.1
	unicode-bidi@0.3.18
	unicode-ident@1.0.15
	unicode-normalization@0.1.24
	unicode-segmentation@1.12.0
	unicode-xid@0.2.6
	universal-hash@0.5.1
	unsafe-libyaml@0.2.11
	untrusted@0.7.1
	untrusted@0.9.0
	url@2.5.4
	utf-8@0.7.6
	utf16_iter@1.0.5
	utf8_iter@1.0.4
	utf8parse@0.2.2
	uuid-macro-internal@1.14.0
	uuid@1.14.0
	valuable@0.1.1
	vcpkg@0.2.15
	version_check@0.9.5
	visibility@0.1.1
	void@1.0.2
	walkdir@2.5.0
	want@0.3.1
	wasi@0.10.2+wasi-snapshot-preview1
	wasi@0.11.0+wasi-snapshot-preview1
	wasi@0.13.3+wasi-0.2.2
	wasix@0.12.21
	wasm-bindgen-backend@0.2.100
	wasm-bindgen-futures@0.4.50
	wasm-bindgen-macro-support@0.2.100
	wasm-bindgen-macro@0.2.100
	wasm-bindgen-shared@0.2.100
	wasm-bindgen@0.2.100
	watfaq-dns@0.1.1
	weak-table@0.3.2
	web-sys@0.3.77
	web-time@1.1.0
	webpki-roots@0.26.8
	widestring@1.1.0
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.9
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-collections@0.1.1
	windows-core@0.52.0
	windows-core@0.58.0
	windows-core@0.60.1
	windows-future@0.1.1
	windows-implement@0.58.0
	windows-implement@0.59.0
	windows-interface@0.58.0
	windows-interface@0.59.0
	windows-link@0.1.0
	windows-numerics@0.1.1
	windows-result@0.2.0
	windows-result@0.3.1
	windows-strings@0.1.0
	windows-strings@0.3.1
	windows-sys@0.48.0
	windows-sys@0.52.0
	windows-sys@0.59.0
	windows-targets@0.48.5
	windows-targets@0.52.6
	windows@0.58.0
	windows@0.60.0
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.48.5
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.48.5
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.48.5
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.48.5
	windows_x86_64_msvc@0.52.6
	winnow@0.6.24
	winreg@0.50.0
	winreg@0.55.0
	wintun-bindings@0.7.30
	wit-bindgen-rt@0.33.0
	write16@1.0.0
	writeable@0.5.5
	wyz@0.5.1
	x25519-dalek@2.0.1
	x509-signature@0.5.0
	yoke-derive@0.7.5
	yoke@0.7.5
	zerocopy-derive@0.7.35
	zerocopy-derive@0.8.17
	zerocopy@0.7.35
	zerocopy@0.8.17
	zerofrom-derive@0.1.5
	zerofrom@0.1.5
	zeroize@1.8.1
	zeroize_derive@1.4.2
	zerovec-derive@0.10.3
	zerovec@0.10.4
"

declare -A GIT_CRATES=(
	[boring-noise]='https://github.com/Watfaq/boring-noise;e01409626a15a987b0174d8c78b8181031c37309;boring-noise-%commit%'
	[netstack-smoltcp]='https://github.com/automesh-network/netstack-smoltcp;62260478079d96b42fa524caa855609312c2cf43;netstack-smoltcp-%commit%'
	[network-interface]='https://github.com/Watfaq/network-interface;db9f1bcd2faa5122f694283bd300bf42d166d2f3;network-interface-%commit%'
	[shadowsocks]='https://github.com/shadowsocks/shadowsocks-rust;fe1388da06775e3ebe3f216c96073fa6c6d1ba25;shadowsocks-rust-%commit%/crates/shadowsocks'
	[tokio-watfaq-rustls]='https://github.com/Watfaq/tokio-rustls;638db32084d7ecf9c2660847b55d48d1186b4055;tokio-rustls-%commit%'
	[tracing-oslog]='https://github.com/Absolucy/tracing-oslog;b44d62871464e332249ae79e000dad9ebeb06434;tracing-oslog-%commit%'
	[tuic-quinn]='https://github.com/Itsusinn/tuic;17ee3f702e26aca048495d4c66ad5316bb8eaf98;tuic-%commit%/tuic-quinn'
	[tuic]='https://github.com/Itsusinn/tuic;17ee3f702e26aca048495d4c66ad5316bb8eaf98;tuic-%commit%/tuic'
	[unix-udp-sock]='https://github.com/Watfaq/unix-udp-sock;cd3e4eca43e6f3be82a2703c3d711b7e18fbfd18;unix-udp-sock-%commit%'
	[watfaq-rustls]='https://github.com/Watfaq/rustls;4cae3aa2e84ea29d8a74b495793773bdb0a72206;rustls-%commit%/rustls'
)

inherit cargo systemd

DESCRIPTION="Custom protocol, rule based network proxy"
HOMEPAGE="
	https://watfaq.gitbook.io/clashrs-user-manual/
	https://github.com/Watfaq/clash-rs/
"
SRC_URI="
	https://github.com/Watfaq/clash-rs/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"

# Dependent crate licenses
LICENSE+="
	0BSD Apache-2.0 BSD-2 BSD CC0-1.0 GPL-3+ ISC MIT MPL-2.0 Unicode-3.0
	Unlicense WTFPL-2 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"

# https://github.com/Watfaq/clash-rs/blob/v0.7.6/clash/Cargo.toml
IUSE="doc +lto standard plus perf +shadowsocks ssh tuic onion jemallocator bench"
REQUIRED_USE="
	debug? ( !lto )
	standard? (
		shadowsocks
		ssh
		tuic
	)
	plus? (
		standard
		onion
	)
	perf? (
		plus
		jemallocator
	)
"

BDEPEND="dev-libs/protobuf"

PATCHES=(
	"${FILESDIR}/${P}-fix-unstable-features.patch"
)

src_configure() {
	local myfeatures=(
		$(usev bench)
		$(usev onion)
		$(usev standard)
		$(usev plus)
		$(usev perf)
		$(usev shadowsocks)
		$(usev ssh)
		$(usev tuic)
		$(usev jemallocator)
	)
	cargo_src_configure
}

src_compile() {
	if use !debug; then
		# let portage do the strip
		export CARGO_PROFILE_RELEASE_STRIP=false
		if use !lto; then
			export CARGO_PROFILE_RELEASE_LTO=false
		fi
	fi

	# enable unstable features

	export RUSTC_BOOTSTRAP=1

	cargo_src_compile --package=clash-rs --bin=clash-rs
}

src_install() {
	dobin "$(cargo_target_dir)"/clash-rs
	insinto "/etc/clash-rs"
	doins "${FILESDIR}/config.example.yaml"
	systemd_dounit "${FILESDIR}/clash-rs.service"
}