summaryrefslogtreecommitdiff
path: root/app-shells/starship/starship-1.22.1.ebuild
blob: 366397127267ad4f04db7c85ca5fedf7525ae855 (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
# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CRATES=""
RUST_MIN_VER="1.80.0"
inherit cargo optfeature shell-completion

DESCRIPTION="The minimal, blazing-fast, and infinitely customizable prompt for any shell"
HOMEPAGE="https://starship.rs/"
SRC_URI="
	https://github.com/starship/starship/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}"
SRC_URI+=" https://dev.gentoo.org/~arthurzam/distfiles/app-shells/${PN}/${P}-crates.tar.xz"

LICENSE="ISC"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 BSD CC0-1.0 ISC MIT MPL-2.0 Unicode-3.0 Unlicense WTFPL-2
	ZLIB
"

SLOT="0"
KEYWORDS="~amd64 ~arm64"

BDEPEND="
	dev-build/cmake
"

QA_FLAGS_IGNORED="usr/bin/starship"

src_prepare() {
	sed -e '/strip/s/true/false/' -i Cargo.toml || die # bug 866133
	default
}

src_configure() {
	export PKG_CONFIG_ALLOW_CROSS=1
	export OPENSSL_NO_VENDOR=true

	cargo_src_configure
}

src_compile() {
	cargo_src_compile

	local STARSHIP_BIN="$(cargo_target_dir)/${PN}"

	# Prepare shell completion generation
	mkdir "${T}/completions" || die
	local shell
	for shell in bash fish zsh; do
		"${STARSHIP_BIN}" completions ${shell} > "${T}/completions/${shell}" || die
	done
}

src_install() {
	dobin "$(cargo_target_dir)/${PN}"
	dodoc README.md

	newbashcomp "${T}/completions/bash" "${PN}"
	newzshcomp "${T}/completions/zsh" "${PN}"
	newfishcomp "${T}/completions/fish" "${PN}.fish"
}

pkg_postinst() {
	optfeature "font support" media-fonts/iosevka media-fonts/noto-emoji
}