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

EAPI=8

CRATES="
	ab_glyph_rasterizer@0.1.8
	adler@1.0.2
	aho-corasick@1.0.5
	ansi_term@0.12.1
	anyhow@1.0.75
	approx@0.5.1
	arbitrary@0.4.7
	arg_enum_proc_macro@0.3.4
	arrayvec@0.7.4
	atty@0.2.14
	autocfg@1.1.0
	av-metrics@0.9.0
	av1-grain@0.2.2
	avif-serialize@0.8.1
	bit_field@0.10.2
	bitflags@1.3.2
	bitflags@2.4.0
	bitstream-io@1.7.0
	block-buffer@0.10.4
	bstr@1.6.2
	built@0.5.2
	bumpalo@3.14.0
	bytemuck@1.14.0
	byteorder@1.4.3
	cargo-lock@8.0.3
	cc@1.0.83
	cfg-expr@0.15.5
	cfg-if@1.0.0
	clap@2.34.0
	clap@4.0.32
	clap_complete@4.0.7
	clap_derive@4.0.21
	clap_lex@0.3.3
	color_quant@1.1.0
	console@0.15.7
	conv@0.3.3
	cpufeatures@0.2.9
	crc32fast@1.3.2
	crossbeam-channel@0.5.8
	crossbeam-deque@0.8.3
	crossbeam-epoch@0.9.15
	crossbeam-queue@0.3.8
	crossbeam-utils@0.8.16
	crossbeam@0.8.2
	crunchy@0.2.2
	crypto-common@0.1.6
	custom_derive@0.1.7
	digest@0.10.7
	either@1.9.0
	encode_unicode@0.3.6
	equivalent@1.0.1
	errno-dragonfly@0.1.2
	errno@0.3.3
	exr@1.7.0
	fdeflate@0.3.0
	fern@0.6.2
	flate2@1.0.27
	flume@0.10.14
	fnv@1.0.7
	form_urlencoded@1.2.0
	futures-core@0.3.28
	futures-sink@0.3.28
	generic-array@0.14.7
	getrandom@0.1.16
	getrandom@0.2.10
	gif@0.12.0
	git2@0.15.0
	glob@0.3.1
	globset@0.4.13
	globwalk@0.8.1
	half@2.2.1
	hashbrown@0.12.3
	hashbrown@0.14.0
	heck@0.4.1
	hermit-abi@0.1.19
	hermit-abi@0.3.2
	idna@0.4.0
	ignore@0.4.20
	image@0.24.7
	imageproc@0.23.0
	imgref@1.9.4
	indexmap@1.9.3
	indexmap@2.0.0
	interpolate_name@0.2.4
	io-lifetimes@1.0.11
	is-docker@0.2.0
	is-terminal@0.4.9
	is-wsl@0.4.0
	itertools@0.10.5
	ivf@0.1.1
	jobserver@0.1.26
	jpeg-decoder@0.3.0
	js-sys@0.3.64
	lab@0.11.0
	lazy_static@1.4.0
	lebe@0.5.2
	libc@0.2.148
	libfuzzer-sys@0.3.5
	libgit2-sys@0.14.2+1.5.1
	libwebp-sys@0.9.3
	libz-sys@1.1.12
	linux-raw-sys@0.3.8
	linux-raw-sys@0.4.7
	lock_api@0.4.10
	log@0.4.20
	loop9@0.1.3
	matrixmultiply@0.3.7
	maybe-rayon@0.1.1
	memchr@2.6.3
	memoffset@0.9.0
	minimal-lexical@0.2.1
	miniz_oxide@0.7.1
	nalgebra@0.30.1
	nanorand@0.7.0
	nasm-rs@0.2.5
	new_debug_unreachable@1.0.4
	nom@7.1.3
	noop_proc_macro@0.3.0
	num-bigint@0.4.4
	num-complex@0.4.4
	num-derive@0.3.3
	num-derive@0.4.0
	num-integer@0.1.45
	num-iter@0.1.43
	num-rational@0.4.1
	num-traits@0.2.16
	num@0.4.1
	num_cpus@1.16.0
	once_cell@1.18.0
	open@4.2.0
	os_str_bytes@6.5.1
	owned_ttf_parser@0.15.2
	parameterized-macro@1.0.1
	parameterized@1.0.1
	paste@1.0.14
	pathdiff@0.2.1
	percent-encoding@2.3.0
	pest@2.7.3
	pest_derive@2.7.3
	pest_generator@2.7.3
	pest_meta@2.7.3
	pin-project-internal@1.1.3
	pin-project@1.1.3
	pkg-config@0.3.27
	png@0.17.10
	ppv-lite86@0.2.17
	proc-macro-error-attr@1.0.4
	proc-macro-error@1.0.4
	proc-macro2@1.0.67
	qoi@0.4.1
	quick-error@2.0.1
	quote@1.0.33
	rand@0.7.3
	rand@0.8.5
	rand_chacha@0.2.2
	rand_chacha@0.3.1
	rand_core@0.5.1
	rand_core@0.6.4
	rand_distr@0.2.2
	rand_hc@0.2.0
	rav1e@0.6.6
	ravif@0.11.2
	rawpointer@0.2.1
	rayon-core@1.11.0
	rayon@1.7.0
	regex-automata@0.3.8
	regex-syntax@0.7.5
	regex@1.9.5
	rgb@0.8.36
	rust_hawktracer@0.7.0
	rust_hawktracer_normal_macro@0.4.1
	rust_hawktracer_proc_macro@0.4.1
	rustc_version@0.4.0
	rustix@0.37.23
	rustix@0.38.13
	rusttype@0.9.3
	rustversion@1.0.14
	safe_arch@0.7.1
	same-file@1.0.6
	scan_fmt@0.2.6
	scopeguard@1.2.0
	semver@1.0.18
	serde@1.0.188
	serde_derive@1.0.188
	serde_spanned@0.6.3
	sha2@0.10.7
	signal-hook-registry@1.4.1
	signal-hook@0.3.17
	simba@0.7.3
	simd-adler32@0.3.7
	simd_helpers@0.1.0
	smallvec@1.11.0
	spin@0.9.8
	strsim@0.8.0
	strum@0.25.0
	strum_macros@0.24.3
	syn@1.0.109
	syn@2.0.36
	system-deps@6.1.1
	target-lexicon@0.12.11
	termcolor@1.2.0
	terminal_size@0.2.6
	textwrap@0.11.0
	thiserror-impl@1.0.48
	thiserror@1.0.48
	thread_local@1.1.7
	tiff@0.9.0
	tinyvec@1.6.0
	tinyvec_macros@0.1.1
	toml@0.5.11
	toml@0.7.8
	toml_datetime@0.6.3
	toml_edit@0.19.15
	ttf-parser@0.15.2
	typenum@1.17.0
	ucd-trie@0.1.6
	unicode-bidi@0.3.13
	unicode-ident@1.0.12
	unicode-normalization@0.1.22
	unicode-width@0.1.10
	url@2.4.1
	v_frame@0.3.6
	vcpkg@0.2.15
	vec_map@0.8.2
	version-compare@0.1.1
	version_check@0.9.4
	walkdir@2.4.0
	wasi@0.11.0+wasi-snapshot-preview1
	wasi@0.9.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
	webp@0.2.5
	weezl@0.1.7
	wide@0.7.11
	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.5
	windows_aarch64_gnullvm@0.42.2
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_msvc@0.42.2
	windows_aarch64_msvc@0.48.5
	windows_i686_gnu@0.42.2
	windows_i686_gnu@0.48.5
	windows_i686_msvc@0.42.2
	windows_i686_msvc@0.48.5
	windows_x86_64_gnu@0.42.2
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnullvm@0.42.2
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_msvc@0.42.2
	windows_x86_64_msvc@0.48.5
	winnow@0.5.15
	y4m@0.8.0
	zune-inflate@0.2.54
"

inherit cargo toolchain-funcs

DESCRIPTION="Accessible image processing and conversion from the terminal tool."
HOMEPAGE="https://github.com/foresterre/sic"
SRC_URI="https://www.github.com/foresterre/sic/archive/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}"

LICENSE="|| ( Apache-2.0 MIT )"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD MIT
	Unicode-DFS-2016 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND=">=dev-lang/nasm-2.14.02"

QA_FLAGS_IGNORED="usr/bin/sic"

src_prepare() {
	default
	if ! tc-is-lto; then
		sed '/lto = true/d' -i Cargo.toml || die
	fi
}
