# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Autogenerated by pycargoebuild 0.15.2
# from ./lychee-bin in project directory
# crates tarball as suggested by ebuild warnings (many crates)
EAPI=8
RUST_MIN_VER="1.88.0"
inherit cargo shell-completion
DESCRIPTION="A fast, async link checker"
HOMEPAGE="https://github.com/lycheeverse/lychee"
SRC_URI="
https://github.com/lycheeverse/lychee/archive/refs/tags/lychee-v${PV}.tar.gz
mirror://jacksonchen666/${P}-crates.tar.xz
"
# double lychee: tags are prefixed with "lychee-"
# lychee-bin: the binary is in there, the project root is not really
# anything
S="${WORKDIR}/lychee-lychee-v${PV}/lychee-bin/"
LICENSE="|| ( Apache-2.0 MIT )"
# Dependent crate licenses
LICENSE+="
Apache-2.0 BSD-2 BSD CDLA-Permissive-2.0 ISC MIT MPL-2.0 openssl
Unicode-3.0 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"
src_compile() {
cargo_src_compile
# from Makefile's completion thing, and seeing --generate args
# only includes shell-completion.eclass supported stuff
# the binary is at the workspace root, that's why it's ../
../target/release/lychee --generate complete-bash > lychee.bash || die
../target/release/lychee --generate complete-zsh > _lychee || die
../target/release/lychee --generate complete-fish > lychee.fish || die
../target/release/lychee --generate man > lychee.1 || die
}
src_install() {
cargo_src_install
newbashcomp lychee.bash lychee
dozshcomp _lychee
newfishcomp lychee.fish lychee
doman lychee.1
}