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

# Autogenerated by pycargoebuild 0.16.0

EAPI=8

CRATES="
"
RUST_MIN_VER="1.91.0"

inherit cargo

DESCRIPTION="Fast, encrypted, and deduplicated backups powered by Rust"
HOMEPAGE="https://rustic.cli.rs/"
SRC_URI="
	https://github.com/rustic-rs/rustic/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	https://distfiles.living180.net/${P}-crates.tar.xz
	${CARGO_CRATE_URIS}
"

LICENSE="|| ( Apache-2.0 MIT )"
# Dependent crate licenses
LICENSE+="
	0BSD Apache-2.0 BSD CC0-1.0 CDLA-Permissive-2.0 ISC MIT MPL-2.0
	MPL-2.0 Unicode-3.0 Unicode-DFS-2016 WTFPL-2 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"
RESTRICT="mirror"

DEPEND="
	app-arch/zstd:=
"
RDEPEND="
	${DEPEND}
"

src_prepare() {
	default

	# enable system libraries where supported
	export ZSTD_SYS_USE_PKG_CONFIG=1

	# remove bundled sources, just in case
	find "${ECARGO_VENDOR}"/zstd-sys-*/ -name '*.c' -delete || die
}