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

# Autogenerated by pycargoebuild 0.13.3

EAPI=8

inherit cargo

DESCRIPTION="Analyzes data for embedded file types"
HOMEPAGE="https://github.com/ReFirmLabs/binwalk"

if [[ ${PV} == 9999 ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/ReFirmLabs/binwalk.git"
else
	SRC_URI="
		https://github.com/ReFirmLabs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
		${CARGO_CRATE_URIS}
	"
	KEYWORDS="~amd64"
fi

LICENSE="MIT"
# Dependent crate licenses
LICENSE+=" Boost-1.0 ISC MIT MPL-2.0 Unicode-DFS-2016"
SLOT="3"

src_unpack() {
	if [[ "${PV}" == *9999* ]]; then
		git-r3_src_unpack
		cargo_live_src_unpack
	else
		cargo_src_unpack
	fi
}

src_install() {
	newbin "$(cargo_target_dir)/binwalk" binwalk3
}
