blob: 3072b2705737f7f33f4aefc333e29531d0eaf9c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# Copyright 2021-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cargo toolchain-funcs
DESCRIPTION="Create a book from markdown files"
HOMEPAGE="https://rust-lang.github.io/mdBook/"
SRC_URI="
https://github.com/rust-lang/mdBook/archive/refs/tags/v${PV}.tar.gz
-> ${P}.tar.gz
https://dev.gentoo.org/~ionen/distfiles/${P}-vendor.tar.xz
"
S=${WORKDIR}/${P/b/B}
# CC-BY-4.0/OFL-1.1: embeds fonts inside the executable
LICENSE="MPL-2.0 CC-BY-4.0 OFL-1.1"
LICENSE+=" Apache-2.0 CC0-1.0 ISC MIT Unicode-3.0" # crates
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="doc"
QA_FLAGS_IGNORED="usr/bin/${PN}"
src_compile() {
cargo_src_compile
if use doc; then
if tc-is-cross-compiler; then
ewarn "html docs were skipped due to cross-compilation"
else
"$(cargo_target_dir)"/${PN} build -d html guide || die
fi
fi
}
src_test() {
local skip=(
# fails with usersandbox
--skip test_ignore_canonical
)
cargo_src_test -- "${skip[@]}"
}
src_install() {
cargo_src_install
dodoc CHANGELOG.md README.md
use doc && ! tc-is-cross-compiler && dodoc -r guide/html
}
|