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

# Autogenerated by pycargoebuild 0.14.0

EAPI=8

CRATES=""

RUST_MIN_VER="1.87.0"

inherit cargo desktop xdg

DESCRIPTION="Microsoft edit"
HOMEPAGE="https://github.com/microsoft/edit"
SRC_URI="
	https://github.com/microsoft/edit/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/freijon/edit/releases/download/v${PV}/${P}-crates.tar.xz
"

LICENSE="MIT"
# Dependent crate licenses
LICENSE+=" Apache-2.0 MIT Unicode-3.0"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="
	dev-libs/icu
"
RDEPEND="${DEPEND}"
BDEPEND="
	virtual/pkgconfig
"

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

src_configure() {
		# high magic to allow system-libs
		export PKG_CONFIG_ALLOW_CROSS=1

		export RUSTC_BOOTSTRAP=1

		cargo_src_configure
}

src_install() {
		cargo_src_install

		doicon -s scalable "assets/${PN}.svg"
		domenu "assets/com.microsoft.${PN}.desktop"
}
