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

# Autogenerated by pycargoebuild 0.13.2

EAPI=8

CRATES="
	adler2@2.0.1
	aho-corasick@1.1.2
	android_system_properties@0.1.5
	ansi_colours@1.2.2
	ansi_term@0.12.1
	anstream@0.6.20
	anstyle-parse@0.2.7
	anstyle-query@1.0.2
	anstyle-wincon@3.0.11
	anstyle@1.0.13
	anyhow@1.0.102
	approx@0.5.1
	arboard@3.6.1
	atomic@0.6.1
	autocfg@1.1.0
	base64@0.22.1
	bat@0.26.1
	bincode@1.3.3
	bitflags@2.13.2
	box_drawing@0.1.2
	bstr@1.9.0
	bumpalo@3.14.0
	bytelines@2.5.0
	bytemuck@1.14.0
	bytesize@1.3.0
	cc@1.2.45
	cfg-if@1.0.0
	chrono-humanize@0.2.3
	chrono@0.4.45
	clap@4.5.60
	clap_builder@4.5.60
	clap_complete@4.6.9
	clap_derive@4.5.55
	clap_lex@1.0.0
	clipboard-win@5.4.1
	clircle@0.6.1
	colorchoice@1.0.0
	console@0.15.7
	console@0.16.2
	content_inspector@0.2.4
	convert_case@0.10.0
	core-foundation-sys@0.8.6
	crc32fast@1.3.2
	crossbeam-channel@0.5.15
	crossbeam-utils@0.8.21
	crossterm@0.27.0
	crossterm@0.29.0
	crossterm_winapi@0.9.1
	ctrlc@3.4.2
	darling@0.21.3
	darling_core@0.21.3
	darling_macro@0.21.3
	delta-gitu@0.1.21
	deranged@0.3.11
	derive_more-impl@2.1.1
	derive_more@2.1.1
	diff@0.1.13
	dirs-sys@0.5.0
	dirs@6.0.0
	dispatch2@0.3.1
	displaydoc@0.2.7
	document-features@0.2.12
	downcast-rs@1.2.1
	either@1.9.0
	encode_unicode@0.3.6
	encode_unicode@1.0.0
	encoding_rs@0.8.35
	equivalent@1.0.1
	errno@0.3.14
	error-code@3.4.0
	etcetera@0.11.0
	fast-srgb8@1.0.0
	figment@0.10.19
	filedescriptor@0.8.3
	find-msvc-tools@0.1.4
	fixedbitset@0.5.7
	flate2@1.1.9
	fnv@1.0.7
	foldhash@0.1.5
	form_urlencoded@1.2.2
	fsevent-sys@4.1.0
	futures-channel@0.3.30
	futures-core@0.3.30
	futures-executor@0.3.30
	futures-io@0.3.30
	futures-macro@0.3.30
	futures-sink@0.3.30
	futures-task@0.3.30
	futures-timer@3.0.3
	futures-util@0.3.30
	futures@0.3.30
	fuzzy-matcher@0.3.7
	gethostname@1.1.0
	getrandom@0.2.11
	git2@0.20.4
	glob@0.3.1
	globset@0.4.18
	grep-cli@0.1.12
	hashbrown@0.15.5
	hashbrown@0.16.1
	heck@0.5.0
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.59
	icu_collections@2.3.0
	icu_locale_core@2.3.0
	icu_normalizer@2.3.0
	icu_normalizer_data@2.3.0
	icu_properties@2.3.0
	icu_properties_data@2.3.0
	icu_provider@2.3.1
	ident_case@1.0.1
	idna@1.1.0
	idna_adapter@1.2.2
	indexmap@2.13.0
	inotify-sys@0.1.8
	inotify@0.11.5
	insta@1.39.0
	is_terminal_polyfill@1.70.2
	itertools@0.10.5
	itertools@0.14.0
	itoa@1.0.10
	jobserver@0.1.32
	js-sys@0.3.66
	kqueue-sys@1.1.2
	kqueue@1.2.1
	lazy_static@1.4.0
	libc@0.2.182
	libgit2-sys@0.18.8+1.9.7
	libredox@0.1.10
	libz-sys@1.1.12
	linked-hash-map@0.5.6
	linux-raw-sys@0.12.1
	litemap@0.8.3
	litrs@1.0.0
	lock_api@0.4.14
	log@0.4.34
	memchr@2.8.3
	miniz_oxide@0.8.9
	minus@5.6.1
	mio@0.8.11
	mio@1.0.3
	nix@0.27.1
	nom@8.0.0
	notify-types@2.1.0
	notify@8.2.0
	ntapi@0.4.1
	nu-ansi-term@0.50.3
	num-conv@0.1.0
	num-traits@0.2.17
	objc2-app-kit@0.3.2
	objc2-core-foundation@0.3.2
	objc2-core-graphics@0.3.2
	objc2-encode@4.1.0
	objc2-foundation@0.3.2
	objc2-io-kit@0.3.2
	objc2-io-surface@0.3.2
	objc2@0.6.4
	once_cell@1.21.3
	once_cell_polyfill@1.70.2
	onig@6.5.1
	onig_sys@69.9.1
	option-ext@0.2.0
	os_pipe@1.2.3
	palette@0.7.3
	palette_derive@0.7.3
	parking_lot@0.12.5
	parking_lot_core@0.9.12
	path_abs@0.5.1
	pathdiff@0.2.1
	percent-encoding@2.3.2
	petgraph@0.8.3
	phf@0.11.2
	phf_generator@0.11.2
	phf_macros@0.11.2
	phf_shared@0.11.2
	pin-project-lite@0.2.14
	pin-utils@0.1.0
	pkg-config@0.3.28
	plist@1.7.0
	potential_utf@0.1.6
	powerfmt@0.2.0
	pretty_assertions@1.4.1
	prettyplease@0.2.37
	proc-macro-crate@3.1.0
	proc-macro2@1.0.103
	quick-xml@0.32.0
	quick-xml@0.41.0
	quote@1.0.44
	rand@0.8.5
	rand_core@0.6.4
	redox_syscall@0.1.57
	redox_syscall@0.5.18
	redox_users@0.5.2
	regex-automata@0.4.14
	regex-syntax@0.8.10
	regex@1.12.3
	relative-path@1.9.3
	rgb@0.8.37
	rstest@0.21.0
	rstest_macros@0.21.0
	rustc_version@0.4.0
	rustix@1.1.4
	rustversion@1.0.23
	ryu@1.0.16
	same-file@1.0.6
	scopeguard@1.2.0
	semver@1.0.21
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	serde_json@1.0.151
	serde_spanned@0.6.9
	serde_spanned@1.0.4
	serde_with@3.17.0
	serde_with_macros@3.17.0
	serde_yaml@0.9.30
	shell-words@1.1.0
	shlex@1.3.0
	signal-hook-mio@0.2.5
	signal-hook-registry@1.4.8
	signal-hook@0.3.18
	simd-adler32@0.3.8
	similar@2.5.0
	simple-logging@2.0.2
	siphasher@0.3.11
	slab@0.4.9
	smallvec@1.15.1
	smashquote@0.1.2
	smol_str@0.1.24
	stable_deref_trait@1.2.1
	std_prelude@0.2.12
	strip-ansi-escapes@0.2.1
	strsim@0.11.1
	strum@0.26.3
	strum_macros@0.26.4
	syn@2.0.111
	syn@3.0.6
	synstructure@0.14.0
	syntect@5.3.0
	sysinfo@0.29.11
	sysinfo@0.39.6
	termcolor@1.4.0
	terminal-colorsaurus@0.4.8
	terminal-colorsaurus@1.0.0
	terminal-trx@0.2.4
	terminal_size@0.4.3
	textwrap@0.16.2
	thiserror-impl@1.0.56
	thiserror-impl@2.0.17
	thiserror@1.0.56
	thiserror@2.0.17
	thread-id@3.3.0
	thread_local@1.1.10
	time-core@0.1.2
	time-macros@0.2.18
	time@0.3.36
	tinystr@0.8.4
	tinyvec@1.13.3
	toml@0.8.23
	toml@0.9.12+spec-1.1.0
	toml_datetime@0.6.11
	toml_datetime@0.7.5+spec-1.1.0
	toml_edit@0.21.1
	toml_edit@0.22.27
	toml_parser@1.0.9+spec-1.1.0
	toml_write@0.1.2
	toml_writer@1.0.6+spec-1.1.0
	tree_magic_mini@3.2.2
	uncased@0.9.10
	unicode-ident@1.0.12
	unicode-segmentation@1.12.0
	unicode-width@0.1.14
	unicode-width@0.2.2
	unsafe-libyaml@0.2.10
	url@2.5.8
	utf8_iter@1.0.4
	utf8parse@0.2.1
	vcpkg@0.2.15
	version_check@0.9.5
	vte@0.14.1
	walkdir@2.5.0
	wasi@0.11.0+wasi-snapshot-preview1
	wasm-bindgen-backend@0.2.89
	wasm-bindgen-macro-support@0.2.89
	wasm-bindgen-macro@0.2.89
	wasm-bindgen-shared@0.2.89
	wasm-bindgen@0.2.89
	wayland-backend@0.3.17
	wayland-client@0.31.15
	wayland-protocols-wlr@0.3.12
	wayland-protocols@0.32.13
	wayland-scanner@0.31.11
	wayland-sys@0.31.11
	wild@2.2.0
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.6
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-collections@0.3.2
	windows-core@0.52.0
	windows-core@0.56.0
	windows-core@0.62.2
	windows-future@0.3.2
	windows-implement@0.56.0
	windows-implement@0.60.2
	windows-interface@0.56.0
	windows-interface@0.59.3
	windows-link@0.2.1
	windows-numerics@0.3.1
	windows-result@0.1.2
	windows-result@0.4.1
	windows-strings@0.5.1
	windows-sys@0.45.0
	windows-sys@0.48.0
	windows-sys@0.52.0
	windows-sys@0.59.0
	windows-sys@0.60.2
	windows-sys@0.61.2
	windows-targets@0.42.2
	windows-targets@0.48.5
	windows-targets@0.52.6
	windows-targets@0.53.5
	windows-threading@0.2.1
	windows@0.56.0
	windows@0.62.2
	windows_aarch64_gnullvm@0.42.2
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_gnullvm@0.53.1
	windows_aarch64_msvc@0.42.2
	windows_aarch64_msvc@0.48.5
	windows_aarch64_msvc@0.52.6
	windows_aarch64_msvc@0.53.1
	windows_i686_gnu@0.42.2
	windows_i686_gnu@0.48.5
	windows_i686_gnu@0.52.6
	windows_i686_gnu@0.53.1
	windows_i686_gnullvm@0.52.6
	windows_i686_gnullvm@0.53.1
	windows_i686_msvc@0.42.2
	windows_i686_msvc@0.48.5
	windows_i686_msvc@0.52.6
	windows_i686_msvc@0.53.1
	windows_x86_64_gnu@0.42.2
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnu@0.53.1
	windows_x86_64_gnullvm@0.42.2
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_gnullvm@0.53.1
	windows_x86_64_msvc@0.42.2
	windows_x86_64_msvc@0.48.5
	windows_x86_64_msvc@0.52.6
	windows_x86_64_msvc@0.53.1
	winnow@0.5.40
	winnow@0.7.14
	wl-clipboard-rs@0.9.4
	writeable@0.6.4
	x11rb-protocol@0.13.2
	x11rb@0.13.2
	xdg@2.5.2
	xterm-color@1.0.1
	yaml-rust@0.4.5
	yansi@1.0.1
	yoke-derive@0.8.4
	yoke@0.8.3
	zerofrom-derive@0.1.8
	zerofrom@0.1.8
	zerotrie@0.2.5
	zerovec-derive@0.11.6
	zerovec@0.11.8
	zmij@1.0.23
"

RUST_MIN_VER="1.95"

inherit cargo shell-completion

DESCRIPTION="Syntax-highlighting pager for git"
HOMEPAGE="https://github.com/dandavison/delta"
SRC_URI="
	https://github.com/dandavison/delta/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"
S="${WORKDIR}/${P/git-/}"

LICENSE="MIT"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 BSD Boost-1.0 CC0-1.0 ISC LGPL-3+ MIT MPL-2.0 Unicode-3.0
	Unicode-DFS-2016 ZLIB
"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv"

BDEPEND="
	virtual/pkgconfig
"
DEPEND="
	dev-libs/libgit2:0/1.9
	dev-libs/oniguruma:=
	virtual/zlib:=
"
RDEPEND="
	${DEPEND}
	!app-text/delta
"

QA_FLAGS_IGNORED="usr/bin/delta"

pkg_setup() {
	rust_pkg_setup
}

src_prepare() {
	default

	# unpin crates, and allow newer libgit2
	rm Cargo.lock || die
	sed -i -e '/git2/s:0\.18\.2:*:' Cargo.toml || die

	export LIBGIT2_NO_VENDOR=1
	export PKG_CONFIG_ALLOW_CROSS=1
	export RUSTONIG_SYSTEM_LIBONIG=1
}

src_install() {
	cargo_src_install

	newbashcomp "${S}"/etc/completion/completion.bash delta
	newzshcomp "${S}"/etc/completion/completion.zsh _delta
	newfishcomp "${S}"/etc/completion/completion.fish delta.fish
}
