1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake flag-o-matic
8 DESCRIPTION="Git status for Bash and Zsh prompt"
9 HOMEPAGE="https://github.com/romkatv/gitstatus"
10 SRC_URI="https://github.com/romkatv/gitstatus/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12 # LIBGIT2_TAG depends on pkgver. They must be updated together. See libgit2_version in:
13 # https://raw.githubusercontent.com/romkatv/gitstatus/v${pkgver}/build.info
14 LIBGIT2_TAG="tag-5860a42d19bcd226cb6eff2dcbfcbf155d570c73"
15 SRC_URI+=" https://github.com/romkatv/libgit2/archive/refs/tags/${LIBGIT2_TAG}.tar.gz -> libgit2-${LIBGIT2_TAG}.tar.gz"
16 CMAKE_USE_DIR="${S}/deps/libgit2"
17 BUILD_DIR="${CMAKE_USE_DIR}_BUILD"
23 KEYWORDS="~amd64 ~x86"
25 DEPEND="zsh-completion? ( app-shells/zsh )"
30 mv -v "${WORKDIR}/libgit2-${LIBGIT2_TAG}" "${S}/deps/libgit2" || die
35 -DCMAKE_BUILD_TYPE=Release
39 -DREGEX_BACKEND=builtin
40 -DUSE_HTTP_PARSER=builtin
46 -DBUILD_SHARED_LIBS=OFF
52 append-cflags $(test-flags-CC -fno-plt)
57 "-I${CMAKE_USE_DIR}/include"
66 append-cxxflags "${cxxflags[@]}"
67 append-ldflags "${ldflags[@]}"
69 GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=${S}/usrbin ./install
70 if use zsh-completion; then
71 for file in *.zsh install; do
72 zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" || die "Couldn't zcompile"
78 insinto "/usr/share/${PN}"
81 doins gitstatus.*.sh *.info
83 if use zsh-completion; then
84 doins gitstatus.*.zsh{,.zwc}
89 exeinto "/usr/libexec/${PN}"
90 doexe usrbin/gitstatusd
92 dosym "../../../libexec/${PN}/gitstatusd" \
93 "/usr/share/${PN}/usrbin/gitstatusd"
95 dodoc {README,docs/listdir}.md
99 elog "The easiest way to take advantage of gitstatus from Zsh is to use a theme"
100 elog "that's already integrated with it. For example: app-shells/zsh-theme-powerlevel10k"
101 elog "The easiest way to take advantage of gitstatus from Bash is via gitstatus.prompt.sh."
102 elog "Follow this guide: https://github.com/romkatv/gitstatus#using-from-bash"