PORTNAME=	delta
DISTVERSION=	0.19.2
CATEGORIES=	devel
PKGNAMEPREFIX=	git-

MAINTAINER=	ports@MidnightBSD.org
COMMENT=	Syntax-highlighting pager for git/diff
WWW=		https://github.com/dandavison/delta

LICENSE=	mit
LICENSE_FILE=	${WRKSRC}/LICENSE

LIB_DEPENDS+=	libgit2.so:devel/libgit2 \
		libonig.so:devel/oniguruma

USES=		cargo cpe
CPE_VENDOR=	${PORTNAME}_project
USE_GITHUB=	yes
GH_ACCOUNT=	dandavison

CARGO_CRATES=	adler2-2.0.1 \
		aho-corasick-1.1.2 \
		android-tzdata-0.1.1 \
		android_system_properties-0.1.5 \
		ansi_colours-1.2.2 \
		ansi_term-0.12.1 \
		anstream-0.6.20 \
		anstyle-1.0.13 \
		anstyle-parse-0.2.3 \
		anstyle-query-1.0.2 \
		anstyle-wincon-3.0.11 \
		anyhow-1.0.102 \
		approx-0.5.1 \
		autocfg-1.1.0 \
		base64-0.22.1 \
		bat-0.26.1 \
		bincode-1.3.3 \
		bitflags-2.4.1 \
		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-0.4.31 \
		chrono-humanize-0.2.3 \
		clap-4.5.60 \
		clap_builder-4.5.60 \
		clap_complete-4.4.6 \
		clap_derive-4.5.55 \
		clap_lex-1.0.0 \
		clircle-0.6.1 \
		colorchoice-1.0.0 \
		console-0.15.7 \
		console-0.16.2 \
		content_inspector-0.2.4 \
		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_winapi-0.9.1 \
		ctrlc-3.4.2 \
		darling-0.21.3 \
		darling_core-0.21.3 \
		darling_macro-0.21.3 \
		deranged-0.3.11 \
		diff-0.1.13 \
		dirs-6.0.0 \
		dirs-sys-0.5.0 \
		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 \
		etcetera-0.11.0 \
		fast-srgb8-1.0.0 \
		find-msvc-tools-0.1.4 \
		flate2-1.1.9 \
		fnv-1.0.7 \
		form_urlencoded-1.2.1 \
		futures-0.3.30 \
		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 \
		getrandom-0.2.11 \
		git2-0.20.0 \
		glob-0.3.1 \
		globset-0.4.18 \
		grep-cli-0.1.12 \
		hashbrown-0.16.1 \
		heck-0.5.0 \
		iana-time-zone-0.1.59 \
		iana-time-zone-haiku-0.1.2 \
		ident_case-1.0.1 \
		idna-0.5.0 \
		indexmap-2.13.0 \
		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 \
		lazy_static-1.4.0 \
		libc-0.2.182 \
		libgit2-sys-0.18.0+1.9.0 \
		libredox-0.1.10 \
		libz-sys-1.1.12 \
		linked-hash-map-0.5.6 \
		linux-raw-sys-0.12.1 \
		lock_api-0.4.14 \
		log-0.4.20 \
		memchr-2.7.1 \
		miniz_oxide-0.8.9 \
		minus-5.6.1 \
		mio-0.8.11 \
		mio-1.0.3 \
		nix-0.27.1 \
		ntapi-0.4.1 \
		nu-ansi-term-0.50.3 \
		num-conv-0.1.0 \
		num-traits-0.2.17 \
		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 \
		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.1 \
		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 \
		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 \
		quote-1.0.44 \
		rand-0.8.5 \
		rand_core-0.6.4 \
		redox_syscall-0.5.18 \
		redox_users-0.5.2 \
		regex-1.12.3 \
		regex-automata-0.4.14 \
		regex-syntax-0.8.10 \
		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 \
		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.111 \
		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-0.3.18 \
		signal-hook-mio-0.2.5 \
		signal-hook-registry-1.4.8 \
		simd-adler32-0.3.8 \
		similar-2.5.0 \
		siphasher-0.3.11 \
		slab-0.4.9 \
		smallvec-1.15.1 \
		smol_str-0.1.24 \
		std_prelude-0.2.12 \
		strsim-0.11.1 \
		syn-2.0.111 \
		syntect-5.3.0 \
		sysinfo-0.29.11 \
		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-1.0.56 \
		thiserror-2.0.17 \
		thiserror-impl-1.0.56 \
		thiserror-impl-2.0.17 \
		time-0.3.36 \
		time-core-0.1.2 \
		time-macros-0.2.18 \
		tinyvec-1.6.0 \
		tinyvec_macros-0.1.1 \
		toml-0.9.12+spec-1.1.0 \
		toml_datetime-0.6.6 \
		toml_datetime-0.7.5+spec-1.1.0 \
		toml_edit-0.21.1 \
		toml_parser-1.0.9+spec-1.1.0 \
		toml_writer-1.0.6+spec-1.1.0 \
		unicode-bidi-0.3.14 \
		unicode-ident-1.0.12 \
		unicode-normalization-0.1.22 \
		unicode-segmentation-1.12.0 \
		unicode-width-0.1.14 \
		unicode-width-0.2.2 \
		unsafe-libyaml-0.2.10 \
		url-2.5.0 \
		utf8parse-0.2.1 \
		vcpkg-0.2.15 \
		walkdir-2.5.0 \
		wasi-0.11.0+wasi-snapshot-preview1 \
		wasm-bindgen-0.2.89 \
		wasm-bindgen-backend-0.2.89 \
		wasm-bindgen-macro-0.2.89 \
		wasm-bindgen-macro-support-0.2.89 \
		wasm-bindgen-shared-0.2.89 \
		wild-2.2.0 \
		winapi-0.3.9 \
		winapi-i686-pc-windows-gnu-0.4.0 \
		winapi-util-0.1.6 \
		winapi-x86_64-pc-windows-gnu-0.4.0 \
		windows-0.56.0 \
		windows-core-0.52.0 \
		windows-core-0.56.0 \
		windows-implement-0.56.0 \
		windows-interface-0.56.0 \
		windows-link-0.2.1 \
		windows-result-0.1.2 \
		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_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 \
		xdg-2.5.2 \
		xterm-color-1.0.1 \
		yaml-rust-0.4.5 \
		yansi-1.0.1

CONFLICTS_INSTALL=	delta
PLIST_FILES=		bin/delta

OPTIONS_DEFINE=		BASH
OPTIONS_DEFAULT=	BASH
BASH_PLIST_FILES=	etc/bash_completion.d/_delta.bash

NO_TEST=	yes

do-install-BASH-on:
	${MKDIR} ${FAKE_DESTDIR}${LOCALBASE}/etc/bash_completion.d
	${INSTALL_DATA} ${WRKSRC}/etc/completion/completion.bash \
			${FAKE_DESTDIR}${LOCALBASE}/etc/bash_completion.d/_delta.bash
post-install:
	${STRIP_CMD} ${PREFIX}/bin/delta

.include <bsd.port.mk>
