# 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.24.2
	adler2@2.0.0
	aho-corasick@1.1.3
	anstream@0.6.18
	anstyle-parse@0.2.6
	anstyle-query@1.1.2
	anstyle-wincon@3.0.7
	anstyle@1.0.10
	async-attributes@1.1.2
	async-channel@1.9.0
	async-channel@2.3.1
	async-executor@1.13.1
	async-global-executor@2.4.1
	async-io@2.4.0
	async-lock@3.4.0
	async-process@2.3.0
	async-signal@0.2.10
	async-std@1.13.0
	async-stream-impl@0.2.1
	async-stream@0.2.1
	async-task@4.7.1
	atomic-waker@1.1.2
	autocfg@1.4.0
	avahi-sys@0.10.1
	backtrace@0.3.74
	base64@0.22.1
	bindgen@0.68.1
	bindgen@0.69.5
	bitflags@2.7.0
	blocking@1.6.1
	bonjour-sys@0.1.1
	bumpalo@3.16.0
	byteorder@1.5.0
	bytes@1.9.0
	cc@1.2.9
	cexpr@0.6.0
	cfg-if@0.1.10
	cfg-if@1.0.0
	clang-sys@1.8.1
	colorchoice@1.0.3
	colored@2.2.0
	concurrent-queue@2.5.0
	crossbeam-utils@0.8.21
	darling@0.10.2
	darling_core@0.10.2
	darling_macro@0.10.2
	deranged@0.3.11
	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
	either@1.13.0
	env_filter@0.1.3
	env_logger@0.11.6
	equivalent@1.0.1
	err-derive@0.2.4
	errno@0.3.10
	event-listener-strategy@0.5.3
	event-listener@2.5.3
	event-listener@5.4.0
	fastrand@2.3.0
	fnv@1.0.7
	foreign-types-shared@0.1.1
	foreign-types@0.3.2
	futures-channel@0.3.31
	futures-core@0.3.31
	futures-io@0.3.31
	futures-lite@2.6.0
	futures-macro@0.3.31
	futures-task@0.3.31
	futures-util@0.3.31
	getrandom@0.2.15
	gimli@0.31.1
	glob@0.3.2
	gloo-timers@0.3.0
	hashbrown@0.15.2
	hermit-abi@0.4.0
	home@0.5.11
	humantime@2.1.0
	ident_case@1.0.1
	idevice@0.1.7
	indexmap@2.7.0
	is_terminal_polyfill@1.70.1
	itertools@0.12.1
	itoa@1.0.14
	js-sys@0.3.77
	kv-log-macro@1.0.7
	lazy_static@1.5.0
	lazycell@1.3.0
	libc@0.2.169
	libloading@0.8.6
	libusb1-sys@0.7.0
	linux-raw-sys@0.4.15
	lock_api@0.4.12
	log@0.4.22
	mdns@3.0.0
	memchr@2.7.4
	minimal-lexical@0.2.1
	miniz_oxide@0.8.2
	mio@1.0.3
	net2@0.2.39
	nom@7.1.3
	num-conv@0.1.0
	object@0.36.7
	once_cell@1.20.2
	openssl-macros@0.1.1
	openssl-sys@0.9.104
	openssl@0.10.68
	parking@2.2.1
	parking_lot@0.12.3
	parking_lot_core@0.9.10
	peeking_take_while@0.1.2
	pin-project-lite@0.2.16
	pin-utils@0.1.0
	piper@0.2.4
	pkg-config@0.3.31
	plist@1.7.0
	polling@3.7.4
	powerfmt@0.2.0
	prettyplease@0.2.29
	proc-macro-error-attr@1.0.4
	proc-macro-error@1.0.4
	proc-macro2@1.0.93
	quick-error@1.2.3
	quick-xml@0.32.0
	quote@1.0.38
	redox_syscall@0.5.8
	regex-automata@0.4.9
	regex-syntax@0.8.5
	regex@1.11.1
	rusb@0.9.4
	rustc-demangle@0.1.24
	rustc-hash@1.1.0
	rustix@0.38.43
	rustversion@1.0.19
	scopeguard@1.2.0
	serde@1.0.217
	serde_derive@1.0.217
	shlex@1.3.0
	signal-hook-registry@1.4.2
	slab@0.4.9
	smallvec@1.13.2
	socket2@0.5.8
	strsim@0.9.3
	syn@1.0.109
	syn@2.0.96
	synstructure@0.12.6
	thiserror-impl@2.0.11
	thiserror@2.0.11
	time-core@0.1.2
	time-macros@0.2.19
	time@0.3.37
	tokio-macros@2.5.0
	tokio-openssl@0.6.5
	tokio@1.43.0
	tracing-core@0.1.33
	tracing@0.1.41
	unicode-ident@1.0.14
	unicode-xid@0.2.6
	utf8parse@0.2.2
	uuid@1.11.1
	value-bag@1.10.0
	vcpkg@0.2.15
	version_check@0.9.5
	wasi@0.11.0+wasi-snapshot-preview1
	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
	web-sys@0.3.77
	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-sys@0.52.0
	windows-sys@0.59.0
	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
"

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}
	https://github.com/zeyugao/zeroconf-rs/archive/${ZEROCONF_RS_SHA}.tar.gz -> ${PN}-zeroconf-rs-${ZEROCONF_RS_SHA:0:7}.tar.gz"

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_configure() {
	local myfeatures=( usb )
	cargo_src_configure --bin "${PN}"
}

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

src_install() {
	cargo_src_install
	einstalldocs
}