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

# This ebuild is only useful to build an unreleased version of yabridge, in all
# other cases users should instead use media-sound/yabridge-bin.
#
# The version number indicated by this ebuild can be misleading as yabridge
# identifies with last released version number although we are actually building
# a dev version from Git.
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!! see https://wiki.gentoo.org/wiki/Writing_Rust_ebuilds on how to update !!!
# !!! essentially, just pycargoebuild ./ needs to be called on a checkout    !!!
# !!! ebuild then also needs correct EGIT_COMMIT to match version of the day !!!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

# Autogenerated by pycargoebuild 0.15.2

EAPI=8

CRATES="
	anstream@0.3.2
	anstyle-parse@0.2.1
	anstyle-query@1.0.0
	anstyle-wincon@1.0.2
	anstyle@1.0.1
	anyhow@1.0.72
	autocfg@1.1.0
	bitflags@1.3.2
	bitflags@2.4.0
	cc@1.0.82
	cfg-if@1.0.0
	clap@4.3.21
	clap_builder@4.3.21
	clap_derive@4.3.12
	clap_lex@0.5.0
	clipboard-win@4.5.0
	colorchoice@1.0.0
	colored@2.0.4
	crossbeam-channel@0.5.8
	crossbeam-deque@0.8.3
	crossbeam-epoch@0.9.15
	crossbeam-utils@0.8.16
	dirs-next@2.0.0
	dirs-sys-next@0.1.2
	either@1.9.0
	endian-type@0.1.2
	errno-dragonfly@0.1.2
	errno@0.3.2
	error-code@2.3.1
	fd-lock@3.0.13
	getrandom@0.2.10
	goblin@0.6.1
	heck@0.4.1
	hermit-abi@0.3.2
	io-lifetimes@1.0.11
	is-terminal@0.4.9
	is_executable@1.0.1
	itoa@0.4.8
	lazy_static@1.4.0
	libc@0.2.147
	libloading@0.7.4
	linux-raw-sys@0.3.8
	linux-raw-sys@0.4.5
	log@0.4.20
	memchr@2.5.0
	memoffset@0.6.5
	memoffset@0.9.0
	nibble_vec@0.1.0
	nix@0.23.2
	num_cpus@1.16.0
	once_cell@1.18.0
	plain@0.2.3
	proc-macro2@1.0.66
	promptly@0.3.1
	quote@1.0.32
	radix_trie@0.2.1
	rayon-core@1.11.0
	rayon@1.7.0
	redox_syscall@0.2.16
	redox_users@0.4.3
	rustix@0.37.23
	rustix@0.38.8
	rustyline@9.1.2
	ryu@0.2.8
	same-file@1.0.6
	scopeguard@1.2.0
	scroll@0.11.0
	scroll_derive@0.11.1
	serde@1.0.183
	serde_derive@1.0.183
	serde_jsonrc@0.1.0
	smallvec@1.11.0
	smawk@0.3.1
	str-buf@1.0.6
	strsim@0.10.0
	syn@2.0.28
	terminal_size@0.2.6
	textwrap@0.16.0
	thiserror-impl@1.0.44
	thiserror@1.0.44
	toml@0.5.11
	unicode-ident@1.0.11
	unicode-linebreak@0.1.5
	unicode-segmentation@1.10.1
	unicode-width@0.1.10
	utf8parse@0.2.1
	walkdir@2.3.3
	wasi@0.11.0+wasi-snapshot-preview1
	which@4.4.0
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.5
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-sys@0.48.0
	windows-targets@0.48.1
	windows_aarch64_gnullvm@0.48.0
	windows_aarch64_msvc@0.48.0
	windows_i686_gnu@0.48.0
	windows_i686_msvc@0.48.0
	windows_x86_64_gnu@0.48.0
	windows_x86_64_gnullvm@0.48.0
	windows_x86_64_msvc@0.48.0
	xdg@2.5.2
"

declare -A GIT_CRATES=(
	[reflink]='https://github.com/nicokoch/reflink;e8d93b465f5d9ad340cd052b64bbc77b8ee107e2;reflink-%commit%'
)

inherit cargo

DESCRIPTION="Utility for setting up and managing yabridge"
HOMEPAGE=""
SRC_URI="
	${CARGO_CRATE_URIS}
"

LICENSE="GPL-3+"
# Dependent crate licenses
LICENSE+=" Apache-2.0 Boost-1.0 ISC MIT MPL-2.0 Unicode-DFS-2016"
SLOT="0"
KEYWORDS="~amd64"

# === end of auto-generated ebuild contents ===


inherit git-r3

DEPEND="
	!media-sound/yabridge-bin
"

EGIT_COMMIT="48ea9749b682c48875366134a42073d6b3d0a8c4"
EGIT_REPO_URI="https://github.com/robbert-vdh/yabridge.git"

RESTRICT="mirror"
S="${WORKDIR}/${P}/tools/yabridgectl"

src_unpack() {
	# src_unpack must be called for both eclasses
	git-r3_src_unpack || die "git-r3_src_unpack failed"
	cargo_src_unpack || die "cargo_src_unpack failed"
}