summaryrefslogtreecommitdiff
path: root/app-misc/tealdeer/tealdeer-1.9.0.ebuild
blob: a15fe0f7e631e408d60a1b17b2ecb1ce8238c809 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# Copyright 2020-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CRATES="
	adler2@2.0.1
	aho-corasick@1.1.5
	anstream@1.0.0
	anstyle-parse@1.0.0
	anstyle-query@1.1.5
	anstyle-wincon@3.0.11
	anstyle@1.0.14
	anyhow@1.0.104
	arbitrary@1.4.2
	assert_cmd@2.2.2
	autocfg@1.5.1
	base64@0.23.1
	base64ct@1.8.3
	bitflags@1.3.2
	bitflags@2.13.1
	bstr@1.13.1
	bumpalo@3.20.3
	byteorder@1.5.0
	bytes@1.12.1
	cc@1.4.3
	cfg-if@1.0.4
	clap@4.6.6
	clap_builder@4.6.6
	clap_derive@4.6.4
	clap_lex@1.1.0
	colorchoice@1.0.5
	combine@4.6.7
	core-foundation-sys@0.8.7
	core-foundation@0.10.1
	crc32fast@1.5.0
	defmt-macros@1.1.1
	defmt-parser@1.0.0
	defmt@1.1.1
	der@0.8.1
	derive_arbitrary@1.4.2
	difflib@0.4.0
	env_filter@2.0.0
	env_logger@0.11.11
	equivalent@1.0.2
	errno-dragonfly@0.1.2
	errno@0.2.8
	errno@0.3.14
	escargot@0.5.15
	etcetera@0.11.0
	fastrand@2.5.0
	filetime@0.2.29
	find-msvc-tools@0.1.11
	flate2@1.1.9
	float-cmp@0.10.0
	foreign-types-shared@0.1.1
	foreign-types@0.3.2
	getrandom@0.2.17
	getrandom@0.4.3
	hashbrown@0.17.1
	heck@0.5.0
	http@1.5.0
	httparse@1.10.1
	indexmap@2.14.0
	is_terminal_polyfill@1.70.2
	itoa@1.0.18
	jiff-core@0.1.0
	jiff-static@0.2.35
	jiff@0.2.35
	jni-macros@0.22.4
	jni-sys-macros@0.4.1
	jni-sys@0.4.1
	jni@0.22.4
	libc@0.2.189
	linux-raw-sys@0.12.1
	log@0.4.33
	memchr@2.8.3
	miniz_oxide@0.8.9
	native-tls@0.2.18
	normalize-line-endings@0.3.0
	num-traits@0.2.19
	once_cell@1.21.4
	once_cell_polyfill@1.70.2
	openssl-macros@0.1.1
	openssl-probe@0.2.1
	openssl-sys@0.9.117
	openssl@0.10.81
	pager@0.16.1
	pem-rfc7468@1.0.0
	percent-encoding@2.3.2
	pkg-config@0.3.34
	portable-atomic-util@0.2.7
	portable-atomic@1.15.0
	predicates-core@1.0.10
	predicates-tree@1.0.13
	predicates@3.1.4
	proc-macro2@1.0.107
	quote@1.0.47
	r-efi@6.0.0
	regex-automata@0.4.18
	regex-syntax@0.8.11
	regex@1.13.1
	ring@0.17.14
	rustc_version@0.4.1
	rustix@1.1.4
	rustls-native-certs@0.8.4
	rustls-pki-types@1.15.1
	rustls-platform-verifier-android@0.1.1
	rustls-platform-verifier@0.7.0
	rustls-webpki@0.103.14
	rustls@0.23.43
	same-file@1.0.6
	schannel@0.1.29
	security-framework-sys@2.17.0
	security-framework@3.7.0
	semver@1.0.28
	serde@1.0.229
	serde_core@1.0.229
	serde_derive@1.0.229
	serde_json@1.0.151
	serde_spanned@1.1.1
	shlex@2.0.1
	simd-adler32@0.3.10
	simd_cesu8@1.2.0
	simdutf8@0.1.5
	socks@0.3.4
	subtle@2.6.1
	syn@2.0.119
	syn@3.0.3
	tempfile@3.27.0
	terminal_size@0.4.4
	termtree@0.5.1
	thiserror-impl@2.0.20
	thiserror@2.0.20
	toml@1.1.4+spec-1.1.0
	toml_datetime@1.1.1+spec-1.1.0
	toml_parser@1.1.3+spec-1.1.0
	toml_writer@1.1.2+spec-1.1.0
	unicode-ident@1.0.24
	untrusted@0.9.0
	ureq-proto@0.6.1
	ureq@3.4.0
	utf8-zero@0.8.1
	utf8parse@0.2.2
	vcpkg@0.2.15
	wait-timeout@0.2.1
	walkdir@2.5.0
	wasi@0.11.1+wasi-snapshot-preview1
	webpki-root-certs@1.0.9
	webpki-roots@1.0.9
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.11
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-link@0.2.1
	windows-sys@0.52.0
	windows-sys@0.61.2
	windows-targets@0.52.6
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.52.6
	winnow@1.0.4
	yansi@1.0.1
	zeroize@1.9.0
	zip@5.1.1
	zlib-rs@0.6.7
	zmij@1.0.23
	zopfli@0.8.3
"

RUST_MIN_VER="1.87.0"

inherit cargo flag-o-matic shell-completion

DESCRIPTION="A very fast implementation of tldr in Rust"
HOMEPAGE="https://github.com/tldr-pages/tldr
	https://github.com/tealdeer-rs/tealdeer"

if [[ "${PV}" == *9999* ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/tealdeer-rs/tealdeer.git"
else
	SRC_URI="https://github.com/tealdeer-rs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	SRC_URI+=" ${CARGO_CRATE_URIS}"
	KEYWORDS="~amd64"
	RESTRICT="mirror"
fi

LICENSE="Apache-2.0 ISC MIT MPL-2.0"
# Dependent crate licenses
LICENSE+=" Apache-2.0 BSD CDLA-Permissive-2.0 ISC MIT Unicode-3.0 ZLIB"
SLOT="0"

RDEPEND="!app-text/tldr"

QA_FLAGS_IGNORED="usr/bin/tldr"

# apply-crates-fixes start
DEPEND="
	dev-libs/openssl
"
# apply-crates-fixes end

src_unpack() {
	if [[ "${PV}" == *9999* ]]; then
		git-r3_src_unpack
		cargo_live_src_unpack
	else
		cargo_src_unpack
	fi
}

src_configure() {
	filter-flags '-flto*' # ring crate fails compile with lto
	cargo_src_configure
}
# apply-crates-fixes start
src_compile(){
	export OPENSSL_NO_VENDOR=1 # fix for openssl-sys
	cargo_src_compile
}
# apply-crates-fixes end

src_test(){
	# network related tests that will indefinitely hang #{{{
	local CARGO_SKIP_TESTS=(
		placeholder_format::cli
		placeholder_format::config
		placeholder_format::default_long
		test_autoupdate_cache
		test_cache_location_not_a_directory
		test_cache_location_permission_denied
		test_cache_location_source
		test_cannot_build_without_tls_feature
		test_clear_only_pages_directory
		test_common_platform_is_used_as_fallback
		test_config_platforms
		test_correct_rendering_v1
		test_correct_rendering_v2
		test_correct_rendering_with_config
		test_create_cache_directory_path
		test_custom_page_overwrites
		test_custom_pages_dir_is_not_dir
		test_custom_patch_appends_to_common
		test_custom_patch_does_not_append_to_custom
		test_edit_page
		test_edit_patch
		test_fail_on_custom_config_path_is_directory
		test_failure_on_unknown_field_in_config
		test_failure_on_unknown_field_in_override_config
		test_list_flag_rendering
		test_load_the_correct_config
		test_lowercased_page_lookup
		test_macos_is_alias_for_osx
		test_markdown_rendering
		test_missing_cache
		test_multi_platform_list_flag_rendering
		test_multiple_platform_command_search
		test_multiple_platform_command_search_not_found
		test_no_auto_update_with_list
		test_os_specific_page
		test_pager_flag_enable
		test_quiet_cache
		test_quiet_failures
		test_quiet_missing_cache
		test_quiet_old_cache
		test_raw_render_file
		test_recreate_dir
		test_rendering_color_auto
		test_rendering_color_never
		test_rendering_i18n
		test_rendering_with_indentation
		test_search_language_precedence
		test_setup_seed_config
		test_show_paths
		test_show_title_config
		test_spaces_find_command
		test_tealdeer_page_works_without_cache
		test_update_cache_default_features
		test_update_cache_native_tls
		test_update_cache_rustls_webpki
		test_update_language_arg
		test_warn_cache_age_never
		test_warn_invalid_tls_backend
	) # }}}
	cargo_src_test --no-fail-fast
}

src_install() {
	cargo_src_install
	einstalldocs

	newbashcomp completion/bash_tealdeer tldr

	newzshcomp completion/zsh_tealdeer _tldr

	newfishcomp completion/fish_tealdeer tldr.fish
}