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

# Autogenerated by pycargoebuild 0.15.0

EAPI=8

CRATES="
	addr2line@0.24.2
	adler2@2.0.0
	android-tzdata@0.1.1
	android_system_properties@0.1.5
	anstream@0.6.18
	anstyle-parse@0.2.6
	anstyle-query@1.1.2
	anstyle-wincon@3.0.7
	anstyle@1.0.10
	anyhow@1.0.98
	arraydeque@0.5.1
	arrayvec@0.7.6
	autocfg@1.4.0
	backtrace@0.3.75
	bitflags@1.3.2
	bitflags@2.9.1
	bumpalo@3.17.0
	bytemuck@1.23.0
	bytemuck_derive@1.9.3
	byteorder-lite@0.1.0
	byteorder@1.5.0
	bytes@1.10.1
	cairo-rs@0.20.10
	cairo-sys-rs@0.20.10
	cc@1.2.22
	cfg-expr@0.17.2
	cfg-if@1.0.0
	chrono@0.4.41
	clap@4.5.38
	clap_builder@4.5.38
	clap_complete@4.5.50
	clap_complete_fig@4.5.2
	clap_complete_nushell@4.5.5
	clap_derive@4.5.32
	clap_lex@0.7.4
	colorchoice@1.0.3
	core-foundation-sys@0.8.7
	core_maths@0.1.1
	crc32fast@1.4.2
	dlib@0.5.2
	endi@1.1.0
	epoxy@0.1.0
	equivalent@1.0.2
	femtovg@0.14.0
	field-offset@0.3.6
	flate2@1.1.1
	flume@0.11.1
	fnv@1.0.7
	fontconfig@0.9.0
	fragile@2.0.1
	futures-channel@0.3.31
	futures-core@0.3.31
	futures-executor@0.3.31
	futures-io@0.3.31
	futures-macro@0.3.31
	futures-sink@0.3.31
	futures-task@0.3.31
	futures-util@0.3.31
	futures@0.3.31
	gdk-pixbuf-sys@0.20.10
	gdk-pixbuf@0.20.10
	gdk4-sys@0.9.6
	gdk4@0.9.6
	getrandom@0.2.16
	gimli@0.31.1
	gio-sys@0.20.10
	gio@0.20.10
	gl_generator@0.9.0
	glib-macros@0.20.10
	glib-sys@0.20.10
	glib@0.20.10
	glow@0.16.0
	gobject-sys@0.20.10
	graphene-rs@0.20.10
	graphene-sys@0.20.10
	gsk4-sys@0.9.6
	gsk4@0.9.6
	gtk4-macros@0.9.5
	gtk4-sys@0.9.6
	gtk4@0.9.6
	gvdb@0.6.1
	hashbrown@0.15.3
	heck@0.5.0
	hex_color@3.0.0
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.63
	image@0.25.6
	imgref@1.11.0
	indexmap@2.9.0
	is_terminal_polyfill@1.70.1
	itoa@1.0.15
	js-sys@0.3.77
	keycode@1.0.0
	keycode_macro@1.0.0
	khronos_api@2.2.0
	lazy_static@1.5.0
	libadwaita-sys@0.7.2
	libadwaita@0.7.2
	libc@0.2.172
	libloading@0.8.7
	libm@0.2.15
	lock_api@0.4.12
	log@0.4.27
	lru@0.12.5
	memchr@2.7.4
	memoffset@0.9.1
	miniz_oxide@0.8.8
	mio@1.0.3
	nanorand@0.7.0
	num-traits@0.2.19
	object@0.36.7
	once_cell@1.21.3
	pango-sys@0.20.10
	pango@0.20.10
	parking_lot@0.12.3
	parking_lot_core@0.9.10
	pin-project-lite@0.2.16
	pin-utils@0.1.0
	pkg-config@0.3.32
	ppv-lite86@0.2.21
	proc-macro-crate@3.3.0
	proc-macro2@1.0.95
	quick-xml@0.31.0
	quote@1.0.40
	rand@0.8.5
	rand_chacha@0.3.1
	rand_core@0.6.4
	redox_syscall@0.5.12
	relm4-css@0.9.0
	relm4-icons@0.9.0
	relm4-macros@0.9.1
	relm4@0.9.1
	resource@0.6.0
	resource_list_proc_macro@0.6.0
	rgb@0.8.50
	rustc-demangle@0.1.24
	rustc_version@0.4.1
	rustversion@1.0.20
	rustybuzz@0.20.1
	ryu@1.0.20
	safe-transmute@0.11.3
	same-file@1.0.6
	scopeguard@1.2.0
	semver@1.0.26
	serde@1.0.219
	serde_derive@1.0.219
	serde_json@1.0.140
	serde_spanned@0.6.8
	shared_library@0.1.9
	shlex@1.3.0
	signal-hook-registry@1.4.5
	slab@0.4.9
	slotmap@1.0.7
	smallvec@1.15.0
	socket2@0.5.9
	spin@0.9.8
	static_assertions@1.1.0
	strsim@0.11.1
	syn@2.0.101
	system-deps@7.0.3
	target-lexicon@0.12.16
	thiserror-impl@2.0.12
	thiserror@2.0.12
	tokio-macros@2.5.0
	tokio@1.45.0
	toml@0.8.22
	toml_datetime@0.6.9
	toml_edit@0.22.26
	toml_write@0.1.1
	tracing-attributes@0.1.28
	tracing-core@0.1.33
	tracing@0.1.41
	ttf-parser@0.25.1
	unicode-bidi-mirroring@0.4.0
	unicode-bidi@0.3.18
	unicode-ccc@0.4.0
	unicode-ident@1.0.18
	unicode-properties@0.1.3
	unicode-script@0.5.7
	unicode-segmentation@1.12.0
	utf8parse@0.2.2
	version-compare@0.2.0
	version_check@0.9.5
	walkdir@2.5.0
	wasi@0.11.0+wasi-snapshot-preview1
	wasm-bindgen-backend@0.2.100
	wasm-bindgen-macro-support@0.2.100
	wasm-bindgen-macro@0.2.100
	wasm-bindgen-shared@0.2.100
	wasm-bindgen@0.2.100
	web-sys@0.3.77
	winapi-util@0.1.9
	windows-core@0.61.0
	windows-implement@0.60.0
	windows-interface@0.59.1
	windows-link@0.1.1
	windows-result@0.3.2
	windows-strings@0.4.0
	windows-sys@0.52.0
	windows-sys@0.59.0
	windows-targets@0.52.6
	windows-targets@0.53.0
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_gnullvm@0.53.0
	windows_aarch64_msvc@0.52.6
	windows_aarch64_msvc@0.53.0
	windows_i686_gnu@0.52.6
	windows_i686_gnu@0.53.0
	windows_i686_gnullvm@0.52.6
	windows_i686_gnullvm@0.53.0
	windows_i686_msvc@0.52.6
	windows_i686_msvc@0.53.0
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnu@0.53.0
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_gnullvm@0.53.0
	windows_x86_64_msvc@0.52.6
	windows_x86_64_msvc@0.53.0
	winnow@0.7.10
	xdg@3.0.0
	xml-rs@0.7.0
	yeslogic-fontconfig-sys@6.0.0
	zerocopy-derive@0.8.25
	zerocopy@0.8.25
	zvariant@4.2.0
	zvariant_derive@4.2.0
	zvariant_utils@2.1.0
"

inherit cargo desktop xdg

DESCRIPTION="A screenshot annotation tool inspired by Swappy and Flameshot."
HOMEPAGE="https://github.com/gabm/satty"

if [[ "${PV}" == 9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/gabm/Satty.git"
else
	SRC_URI="
		https://github.com/gabm/Satty/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
		${CARGO_CRATE_URIS}
	"
	M_PN=Satty
	S="${WORKDIR}/${M_PN}-${PV}"
	KEYWORDS="~amd64"
fi

LICENSE="MPL-2.0"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions CC0-1.0 ISC MIT
	Unicode-3.0 ZLIB
"
SLOT="0"

RDEPEND="
	dev-libs/glib:2
	media-libs/fontconfig
	media-libs/libepoxy
	media-libs/mesa[opengl]
	media-libs/graphene
	gui-libs/libadwaita
	gui-libs/gtk:4
	x11-libs/cairo
	x11-libs/gdk-pixbuf:2
	x11-libs/pango
"

QA_FLAGS_IGNORED="usr/bin/${PN}"

src_unpack() {
	if [[ "${PV}" == 9999 ]]; then
		git-r3_src_unpack
		cargo_live_src_unpack
	else
		cargo_src_unpack
	fi
}

src_install() {
	dodoc README.md

	dobin "$(cargo_target_dir)"/satty
	#Just add the icon and desktop file
	doicon "${S}/assets/satty.svg"
	domenu "${S}/satty.desktop"
}