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

# Autogenerated by pycargoebuild 0.13.2

EAPI=8

RUST_MIN_VER="1.85.0"
CRATES="
	addr2line@0.25.1
	adler2@2.0.1
	aho-corasick@1.1.3
	anstream@0.6.21
	anstyle-parse@0.2.7
	anstyle-query@1.1.4
	anstyle-wincon@3.0.10
	anstyle@1.0.13
	async-attributes@1.1.2
	async-channel@1.9.0
	async-channel@2.5.0
	async-executor@1.13.3
	async-global-executor@2.4.1
	async-io@2.6.0
	async-lock@3.4.1
	async-process@2.5.0
	async-signal@0.2.13
	async-std@1.13.2
	async-stream-impl@0.2.1
	async-stream@0.2.1
	async-task@4.7.1
	atomic-waker@1.1.2
	autocfg@1.5.0
	avahi-sys@0.10.1
	aws-lc-rs@1.14.1
	aws-lc-sys@0.32.2
	backtrace@0.3.76
	base64@0.22.1
	bindgen@0.68.1
	bindgen@0.69.5
	bindgen@0.72.1
	bitflags@2.9.4
	blocking@1.6.2
	bonjour-sys@0.1.1
	bumpalo@3.19.0
	byteorder@1.5.0
	bytes@1.10.1
	cc@1.2.40
	cexpr@0.6.0
	cfg-if@0.1.10
	cfg-if@1.0.3
	clang-sys@1.8.1
	cmake@0.1.54
	colorchoice@1.0.4
	colored@3.0.0
	concurrent-queue@2.5.0
	crossbeam-queue@0.3.12
	crossbeam-utils@0.8.21
	crossfire@2.1.4
	darling@0.10.2
	darling_core@0.10.2
	darling_macro@0.10.2
	deranged@0.5.4
	derive-getters@0.2.1
	derive-new@0.5.9
	derive_builder@0.9.0
	derive_builder_core@0.9.0
	dns-parser@0.8.0
	dunce@1.0.5
	either@1.15.0
	env_filter@0.1.3
	env_logger@0.11.8
	equivalent@1.0.2
	err-derive@0.2.4
	errno@0.3.14
	event-listener-strategy@0.5.4
	event-listener@2.5.3
	event-listener@5.4.1
	fastrand@2.3.0
	find-msvc-tools@0.1.3
	fnv@1.0.7
	fs_extra@1.3.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.1
	futures-macro@0.3.31
	futures-sink@0.3.31
	futures-task@0.3.31
	futures-util@0.3.31
	futures@0.3.31
	getrandom@0.2.16
	getrandom@0.3.3
	gimli@0.32.3
	glob@0.3.3
	gloo-timers@0.3.0
	hashbrown@0.16.0
	hermit-abi@0.5.2
	home@0.5.11
	ident_case@1.0.1
	idevice@0.1.43
	indexmap@2.11.4
	io-uring@0.7.10
	is_terminal_polyfill@1.70.1
	itertools@0.12.1
	itertools@0.13.0
	itoa@1.0.15
	jiff-static@0.2.15
	jiff@0.2.15
	jobserver@0.1.34
	js-sys@0.3.81
	kv-log-macro@1.0.7
	lazy_static@1.5.0
	lazycell@1.3.0
	libc@0.2.176
	libloading@0.8.8
	linux-raw-sys@0.11.0
	linux-raw-sys@0.4.15
	lock_api@0.4.14
	log@0.4.28
	mdns@3.0.0
	memchr@2.7.6
	minimal-lexical@0.2.1
	miniz_oxide@0.8.9
	mio@1.0.4
	net2@0.2.39
	nom@7.1.3
	num-conv@0.1.0
	object@0.37.3
	once_cell@1.21.3
	once_cell_polyfill@1.70.1
	parking@2.2.1
	parking_lot@0.12.5
	parking_lot_core@0.9.12
	peeking_take_while@0.1.2
	pin-project-lite@0.2.16
	pin-utils@0.1.0
	piper@0.2.4
	plist@1.8.0
	polling@3.11.0
	portable-atomic-util@0.2.4
	portable-atomic@1.11.1
	powerfmt@0.2.0
	prettyplease@0.2.37
	proc-macro-error-attr@1.0.4
	proc-macro-error@1.0.4
	proc-macro2@1.0.101
	quick-error@1.2.3
	quick-xml@0.38.3
	quote@1.0.41
	r-efi@5.3.0
	redox_syscall@0.5.18
	regex-automata@0.4.11
	regex-syntax@0.8.6
	regex@1.11.3
	ring@0.17.14
	rustc-demangle@0.1.26
	rustc-hash@1.1.0
	rustc-hash@2.1.1
	rustix@0.38.44
	rustix@1.1.2
	rustls-pki-types@1.12.0
	rustls-webpki@0.103.7
	rustls@0.23.32
	rustversion@1.0.22
	scopeguard@1.2.0
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	shlex@1.3.0
	signal-hook-registry@1.4.6
	slab@0.4.11
	smallvec@1.15.1
	socket2@0.6.0
	strsim@0.9.3
	subtle@2.6.1
	syn@1.0.109
	syn@2.0.106
	synstructure@0.12.6
	thiserror-impl@2.0.17
	thiserror@2.0.17
	time-core@0.1.6
	time-macros@0.2.24
	time@0.3.44
	tokio-macros@2.5.0
	tokio-rustls@0.26.4
	tokio@1.47.1
	unicode-ident@1.0.19
	unicode-xid@0.2.6
	untrusted@0.9.0
	utf8parse@0.2.2
	uuid@1.18.1
	value-bag@1.11.1
	version_check@0.9.5
	wasi@0.11.1+wasi-snapshot-preview1
	wasi@0.14.7+wasi-0.2.4
	wasip2@1.0.1+wasi-0.2.4
	wasm-bindgen-backend@0.2.104
	wasm-bindgen-futures@0.4.54
	wasm-bindgen-macro-support@0.2.104
	wasm-bindgen-macro@0.2.104
	wasm-bindgen-shared@0.2.104
	wasm-bindgen@0.2.104
	web-sys@0.3.81
	which@4.4.2
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-link@0.2.0
	windows-sys@0.52.0
	windows-sys@0.59.0
	windows-sys@0.60.2
	windows-sys@0.61.1
	windows-targets@0.52.6
	windows-targets@0.53.4
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_gnullvm@0.53.0
	windows_aarch64_msvc@0.52.6
	windows_aarch64_msvc@0.53.0
	windows_i686_gnu@0.52.6
	windows_i686_gnu@0.53.0
	windows_i686_gnullvm@0.52.6
	windows_i686_gnullvm@0.53.0
	windows_i686_msvc@0.52.6
	windows_i686_msvc@0.53.0
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnu@0.53.0
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_gnullvm@0.53.0
	windows_x86_64_msvc@0.52.6
	windows_x86_64_msvc@0.53.0
	wit-bindgen@0.46.0
	zeroize@1.8.2
"

declare -A GIT_CRATES=(
	[zeroconf-macros]='https://github.com/zeyugao/zeroconf-rs;860b030064308d4318e2c6936886674d955c6472;zeroconf-rs-%commit%/zeroconf-macros'
	[zeroconf]='https://github.com/zeyugao/zeroconf-rs;860b030064308d4318e2c6936886674d955c6472;zeroconf-rs-%commit%/zeroconf'
)

inherit cargo

DESCRIPTION="A replacement/addition to usbmuxd."
HOMEPAGE="https://github.com/jkcoxson/netmuxd"
ZEROCONF_RS_SHA="860b030064308d4318e2c6936886674d955c6472"
SRC_URI="https://github.com/jkcoxson/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}"

LICENSE="MIT"
# Dependent crate licenses
LICENSE+=" Apache-2.0 BSD ISC LGPL-2.1+ MIT MPL-2.0 Unicode-DFS-2016"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="app-pda/libimobiledevice[static-libs]
	>=app-pda/libplist-2.6.0[static-libs]"
BDEPEND="dev-libs/openssl[static-libs]
	app-pda/libimobiledevice-glue[static-libs]
	app-pda/libusbmuxd[static-libs]"

src_prepare() {
	default
	ln -s "${WORKDIR}/zeroconf-rs-${ZEROCONF_RS_SHA}" "${WORKDIR}/zeroconf-rs" || die
	ln -s "${WORKDIR}/cargo_home/gentoo/mdns-3.0.0" "${WORKDIR}/mdns" || die
	sed -re 's/, "vendored" //g' -i Cargo.toml || die
}

src_compile() {
	RUSTFLAGS="${RUSTFLAGS} -L /usr/$(get_libdir) -l dylib=imobiledevice-1.0 -l dylib=plist"
	export RUSTFLAGS
	cargo_src_compile
}

src_install() {
	cargo_src_install
	einstalldocs
}