summaryrefslogtreecommitdiff
path: root/app-text/tinymist/tinymist-0.15.4.ebuild
blob: a4b1aabbaf7f6c02b23ab6bd761a292dc9b1107c (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# 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.92.0"

CRATES=" "

TYPST_HASH="391c2dcd698aabf2917db0336868d16f197057d9"
TYPST_TS_HASH="bd58ec034584828c272fac1b842acad5b1d79e61"
XILEM_HASH="abe7da9eae473d4f09a7e69a058c31cfe6d3b2e3"

declare -A GIT_CRATES=(
	[docx-rs]="https://github.com/Myriad-Dreamin/docx-rs;db49a729f68dbdb9e8e91857fbb1c3d414209871;docx-rs-%commit%/docx-core"
	[linebender_include_doc_path]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/include_doc_path"
	[masonry]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/masonry"
	[masonry_core]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/masonry_core"
	[masonry_testing]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/masonry_testing"
	[masonry_winit]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/masonry_winit"
	[tree_arena]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/tree_arena"
	[xilem]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/xilem"
	[xilem_core]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/xilem_core"
	[xilem_masonry]="https://github.com/Myriad-dreamin/xilem;${XILEM_HASH};xilem-%commit%/xilem_masonry"
	[reflexo-typst2vec]="https://github.com/Myriad-Dreamin/typst.ts;${TYPST_TS_HASH};typst.ts-%commit%/crates/conversion/typst2vec"
	[reflexo-typst]="https://github.com/Myriad-Dreamin/typst.ts;${TYPST_TS_HASH};typst.ts-%commit%/crates/reflexo-typst"
	[reflexo-vec2svg]="https://github.com/Myriad-Dreamin/typst.ts;${TYPST_TS_HASH};typst.ts-%commit%/crates/conversion/vec2svg"
	[reflexo]="https://github.com/Myriad-Dreamin/typst.ts;${TYPST_TS_HASH};typst.ts-%commit%/crates/reflexo"
	[typst-bundle]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-bundle"
	[typst-eval]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-eval"
	[typst-html]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-html"
	[typst-layout]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-layout"
	[typst-library]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-library"
	[typst-macros]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-macros"
	[typst-pdf]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-pdf"
	[typst-realize]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-realize"
	[typst-render]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-render"
	[typst-svg]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-svg"
	[typst-syntax]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-syntax"
	[typst-timing]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-timing"
	[typst-utils]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst-utils"
	[typst]="https://github.com/Myriad-Dreamin/typst;${TYPST_HASH};typst-%commit%/crates/typst"
	[typstfmt]="https://github.com/Myriad-Dreamin/typstfmt;cdfe44ed065a90d80040c3b29dee7ed431a710ee;typstfmt-%commit%"
	[typst-ansi-hl]="https://github.com/Myriad-Dreamin/typst-ansi-hl;3867cb7229ec6b3e3c8f5b1222af96f98bba9bff;typst-ansi-hl-%commit%/lib"
	[typstyle-core]="https://github.com/Myriad-Dreamin/typstyle;992f36112200bc0ea61df8a7c2af6d9ae56781dd;typstyle-%commit%/crates/typstyle-core"
	[typst-dev-assets]="https://github.com/typst/typst-dev-assets;29753d6069349e7fe4e5f75dcb2e77ff1adc5fac;typst-dev-assets-%commit%"
	[wasm-minimal-protocol]="https://github.com/astrale-sharp/wasm-minimal-protocol;c51acd43095fe9da8fa943e064618e486fd2b58d;wasm-minimal-protocol-%commit%/crates/macro"
)

inherit cargo shell-completion

DESCRIPTION="An integrated language service for Typst"
HOMEPAGE="https://github.com/Myriad-Dreamin/tinymist"
SRC_URI="
	https://github.com/Myriad-Dreamin/tinymist/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/TimovVeen/tinymist/releases/download/v${PV}/tinymist-${PV}-crates.tar.xz
	${CARGO_CRATE_URIS}
"

LICENSE="Apache-2.0"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD Boost-1.0
	CC0-1.0 CDLA-Permissive-2.0 EUPL-1.2 ISC LGPL-3+ MIT MPL-2.0
	Unicode-3.0 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"

# e2e tests hang
RESTRICT="test"

QA_FLAGS_IGNORED="usr/bin/tinymist"

src_prepare() {
	default

	# Taken from app-laptop/framework_tool::gentoo,
	# adapted to also remove the tag field
	# Upstream uses [patch] on some dependencies in Cargo.toml,
	# which are not patched by cargo.eclass's ${ECARGO_HOME}/config
	local crate commit crate_uri crate_dir
	local -a sed_scripts
	for crate in "${!GIT_CRATES[@]}"; do
		IFS=';' read -r \
			crate_uri commit crate_dir <<< "${GIT_CRATES[${crate}]}"
		sed_scripts+=(
			"s|^(${crate}[[:space:]]*=[[:space:]]*[{].*)([[:space:]]*git[[:space:]]*=[[:space:]]*['\"][[:graph:]]+['\"][[:space:]]*)(.*[}])|\1path = '${WORKDIR}/${crate_dir//%commit%/${commit}}'\3|;"
			"s|^(${crate}[[:space:]]*=[[:space:]]*[{].*)([,][[:space:]]*branch[[:space:]]*=[[:space:]]*['\"][[:graph:]]+['\"][[:space:]]*)(.*[}])|\1\3|;"
			"s|^(${crate}[[:space:]]*=[[:space:]]*[{].*)([,][[:space:]]*tag[[:space:]]*=[[:space:]]*['\"][[:graph:]]+['\"][[:space:]]*)(.*[}])|\1\3|;"
			"s|^(${crate}[[:space:]]*=[[:space:]]*[{].*)([,][[:space:]]*rev[[:space:]]*=[[:space:]]*['\"][[:graph:]]+['\"][[:space:]]*)(.*[}])|\1\3|;"
		)
	done
	sed -i -E -e "${sed_scripts[*]}" Cargo.toml ||
		die "Failed to override dependencies in Cargo.toml"
}

src_configure() {
	cargo_src_configure --bin tinymist
}

src_compile() {
	cargo_src_compile

	"$(cargo_target_dir)"/tinymist completion bash > tinymist || die
	"$(cargo_target_dir)"/tinymist completion fish > tinymist.fish || die
	"$(cargo_target_dir)"/tinymist completion zsh > _tinymist || die
}

src_install() {
	cargo_src_install --path ./crates/tinymist-cli

	dobashcomp tinymist
	dofishcomp tinymist.fish
	dozshcomp _tinymist
}