summaryrefslogtreecommitdiff
path: root/app-misc/tealdeer/tealdeer-9999.ebuild
blob: 9b7edd9ca76ed8181c4350672900378f4c18f167 (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
# Copyright 2020-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CRATES="
"

RUST_MIN_VER="1.88.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_invalid_page_name'
		'test_list_broken_pipe'
		'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_seed_config_with_non_utf8_path'
		'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
}