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

# Autogenerated by pycargoebuild 0.15.0

EAPI=8

RUST_MIN_VER="1.85.0"

CRATES="
"

inherit cargo

DESCRIPTION="mdbook typst pdf backend"
HOMEPAGE=""
SRC_URI="
	https://github.com/KaiserY/mdbook-typst-pdf/archive/refs/tags/v${PV}.tar.gz
                -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"
if [[ ${PKGBUMPING} != ${PVR} ]]; then
        SRC_URI+="
        https://git.millerson.name/alex/gentoo-artifacts/releases/download/${P}-crates/${P}-crates.tar.xz
        "
fi

LICENSE="|| ( Apache-2.0 MIT )"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 BSD-2 BSD CC0-1.0 ISC MIT MPL-2.0 Unicode-3.0 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"

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

src_compile() {
        cargo_src_compile
}

src_test() {
        local skip=(
                # fails with usersandbox
                --skip test_ignore_canonical
        )

        cargo_src_test -- "${skip[@]}"
}

src_install() {
        cargo_src_install

        dodoc README.md
}