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

# Autogenerated by pycargoebuild 0.10

EAPI=8

CRATES="
	aho-corasick@1.0.2
	android-tzdata@0.1.1
	android_system_properties@0.1.5
	anstream@0.3.2
	anstyle-parse@0.2.1
	anstyle-query@1.0.0
	anstyle-wincon@1.0.1
	anstyle@1.0.1
	atty@0.2.14
	autocfg@1.1.0
	bitflags@1.3.2
	bitflags@2.3.3
	bumpalo@3.13.0
	cc@1.0.79
	cfg-if@1.0.0
	chrono@0.4.26
	clap@4.3.11
	clap_builder@4.3.11
	clap_derive@4.3.2
	clap_lex@0.5.0
	colorchoice@1.0.0
	console@0.15.7
	core-foundation-sys@0.8.4
	dirs-sys@0.3.7
	dirs@4.0.0
	encode_unicode@0.3.6
	env_logger@0.9.3
	errno-dragonfly@0.1.2
	errno@0.3.1
	getrandom@0.2.10
	heck@0.4.1
	hermit-abi@0.1.19
	hermit-abi@0.3.2
	humantime@2.1.0
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.57
	indicatif@0.17.5
	instant@0.1.12
	is-terminal@0.4.9
	itoa@1.0.8
	js-sys@0.3.64
	lazy_static@1.4.0
	libc@0.2.147
	linux-raw-sys@0.4.3
	log@0.4.19
	memchr@2.5.0
	num-traits@0.2.15
	number_prefix@0.4.0
	once_cell@1.18.0
	portable-atomic@1.3.3
	proc-macro2@1.0.64
	quote@1.0.29
	redox_syscall@0.2.16
	redox_users@0.4.3
	regex-automata@0.3.2
	regex-syntax@0.7.3
	regex@1.9.1
	rustix@0.38.3
	ryu@1.0.14
	serde@1.0.169
	serde_json@1.0.100
	strsim@0.10.0
	syn@2.0.24
	termcolor@1.2.0
	thiserror-impl@1.0.43
	thiserror@1.0.43
	time@0.1.45
	toml@0.5.11
	unicode-ident@1.0.10
	unicode-width@0.1.10
	utf8parse@0.2.1
	wasi@0.10.0+wasi-snapshot-preview1
	wasi@0.11.0+wasi-snapshot-preview1
	wasm-bindgen-backend@0.2.87
	wasm-bindgen-macro-support@0.2.87
	wasm-bindgen-macro@0.2.87
	wasm-bindgen-shared@0.2.87
	wasm-bindgen@0.2.87
	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.45.0
	windows-sys@0.48.0
	windows-targets@0.42.2
	windows-targets@0.48.1
	windows@0.48.0
	windows_aarch64_gnullvm@0.42.2
	windows_aarch64_gnullvm@0.48.0
	windows_aarch64_msvc@0.42.2
	windows_aarch64_msvc@0.48.0
	windows_i686_gnu@0.42.2
	windows_i686_gnu@0.48.0
	windows_i686_msvc@0.42.2
	windows_i686_msvc@0.48.0
	windows_x86_64_gnu@0.42.2
	windows_x86_64_gnu@0.48.0
	windows_x86_64_gnullvm@0.42.2
	windows_x86_64_gnullvm@0.48.0
	windows_x86_64_msvc@0.42.2
	windows_x86_64_msvc@0.48.0
"

inherit cargo

BORRG_COMMIT="2118641d4295099081ac3418671e07429fcf2f38"

DESCRIPTION="Wrapper for borgbackup"
HOMEPAGE="https://github.com/SebastianSpeitel/borrg"
SRC_URI="
	https://github.com/SebastianSpeitel/borrg/archive/${BORRG_COMMIT}.tar.gz -> ${P}.gh.tar.gz
	https://gitlab.fem-net.de/nex/fem-overlay-misc-patches/-/raw/master/app-backup/borrg/${P}-fix-lockfile.patch
	${CARGO_CRATE_URIS}
"

LICENSE=""
# Dependent crate licenses
LICENSE+="
	BSD MIT Unicode-DFS-2016
	|| ( Apache-2.0 Boost-1.0 )
"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
	<app-backup/borgbackup-2
"

S="${WORKDIR}/${PN}-${BORRG_COMMIT}"

DOCS=( "readme.md" )

PATCHES=(
	"${DISTDIR}/${P}-fix-lockfile.patch"
)

# Rust doesn't respect CFLAGS
QA_FLAGS_IGNORED="*"

src_install() {
	cargo_src_install
	einstalldocs
}