blob: 21597d7497f95ac806ea923e63394578f004931a (
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
|
# Copyright 2024-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CRATES=""
RUST_MIN_VER="1.76"
inherit cargo desktop shell-completion xdg
DESCRIPTION="A post-modern text editor"
HOMEPAGE="
https://helix-editor.com/
https://github.com/helix-editor/helix
"
SRC_URI="https://github.com/helix-editor/${PN}/releases/download/${PV}/${P}-source.tar.xz -> ${P}.tar.xz"
DEPS_URI="https://github.com/freijon/${PN}/releases/download/${PV}/${P}-crates.tar.xz"
SRC_URI+=" ${DEPS_URI}"
S="${WORKDIR}"
LICENSE="MPL-2.0"
# Dependent crate licenses
LICENSE+="
Apache-2.0 BSD Boost-1.0 ISC MIT MPL-2.0 MPL-2.0 Unicode-DFS-2016
ZLIB
"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+grammar"
RDEPEND="dev-vcs/git"
pkg_setup() {
QA_FLAGS_IGNORED="
usr/bin/hx
/usr/$(get_libdir)/helix/.*\.so
"
export HELIX_DEFAULT_RUNTIME="${EPREFIX}/usr/share/${PN}/runtime"
use grammar || export HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1
rust_pkg_setup
}
src_install() {
cargo_src_install --path helix-term
insinto "/usr/$(get_libdir)/${PN}"
use grammar && doins runtime/grammars/*.so
rm -r runtime/grammars || die
use grammar && dosym "../../../$(get_libdir)/${PN}" "${EPREFIX}/usr/share/${PN}/runtime/grammars"
insinto /usr/share/helix
doins -r runtime
doicon -s 256x256 contrib/${PN}.png
domenu contrib/Helix.desktop
insinto /usr/share/metainfo
doins contrib/Helix.appdata.xml
newbashcomp contrib/completion/hx.bash hx
newzshcomp contrib/completion/hx.zsh _hx
dofishcomp contrib/completion/hx.fish
DOCS=(
README.md
CHANGELOG.md
docs/
)
HTML_DOCS=(
book/
)
einstalldocs
}
pkg_postinst() {
if ! use grammar ; then
einfo "Grammars are not installed yet. To fetch them, run:"
einfo ""
einfo " hx --grammar fetch && hx --grammar build"
fi
xdg_desktop_database_update
xdg_icon_cache_update
}
pkg_postrm() {
xdg_desktop_database_update
xdg_icon_cache_update
}
|