mirror of
https://github.com/gentoo-mirror/gentoo-zh.git
synced 2025-04-17 23:18:49 -04:00
app-shells/gitstatus:Git status for Bash and Zsh prompt
Signed-off-by: Yachen Wang <OriPoin@outlook.com>
This commit is contained in:
parent
700bc52cbb
commit
d33cecbfa7
1
app-shells/gitstatus/Manifest
Normal file
1
app-shells/gitstatus/Manifest
Normal file
@ -0,0 +1 @@
|
||||
DIST gitstatus-1.5.0.tar.gz 90427 SHA512 a267b9bd4e6fb62dd20414b2133c0cce7697160d74a04ee58a369601833c8516a77f959eb53e1f9671d93bb9c7c5501d0136c976df2a2c5c04ecbcfe865562d5
|
101
app-shells/gitstatus/gitstatus-1.5.0.ebuild
Normal file
101
app-shells/gitstatus/gitstatus-1.5.0.ebuild
Normal file
@ -0,0 +1,101 @@
|
||||
# Copyright 2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit cmake flag-o-matic git-r3
|
||||
|
||||
DESCRIPTION="Git status for Bash and Zsh prompt"
|
||||
HOMEPAGE="https://github.com/romkatv/gitstatus"
|
||||
SRC_URI="${HOMEPAGE}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
# LIBGIT2_TAG depends on pkgver. They must be updated together. See libgit2_version in:
|
||||
# https://raw.githubusercontent.com/romkatv/gitstatus/v${pkgver}/build.info
|
||||
LIBGIT2_TAG="tag-82cefe2b42300224ad3c148f8b1a569757cc617a"
|
||||
EGIT_REPO_URI="https://github.com/romkatv/libgit2"
|
||||
EGIT_COMMIT="${LIBGIT2_TAG}"
|
||||
EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/deps"
|
||||
BUILD_DIR="${EGIT_CHECKOUT_DIR}_BUILD"
|
||||
CMAKE_USE_DIR="${EGIT_CHECKOUT_DIR}"
|
||||
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 ~x86"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="${DEPEND}"
|
||||
BDEPEND=""
|
||||
|
||||
src_unpack() {
|
||||
if [[ -n ${A} ]]; then
|
||||
unpack ${A}
|
||||
fi
|
||||
git-r3_fetch
|
||||
git-r3_checkout
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
mycmakeargs=(
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DZERO_NSEC=ON
|
||||
-DTHREADSAFE=ON
|
||||
-DUSE_BUNDLED_ZLIB=ON
|
||||
-DREGEX_BACKEND=builtin
|
||||
-DUSE_HTTP_PARSER=builtin
|
||||
-DUSE_SSH=OFF
|
||||
-DUSE_HTTPS=OFF
|
||||
-DBUILD_CLAR=OFF
|
||||
-DUSE_GSSAPI=OFF
|
||||
-DUSE_NTLMCLIENT=OFF
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
)
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
append-cflags $(test-flags-CC -fno-plt)
|
||||
|
||||
cmake_src_compile
|
||||
|
||||
local cxxflags=(
|
||||
"-I${EGIT_CHECKOUT_DIR}/include"
|
||||
-DGITSTATUS_ZERO_NSEC
|
||||
-D_GNU_SOURCE
|
||||
)
|
||||
local ldflags=(
|
||||
"-L${BUILD_DIR}"
|
||||
-static
|
||||
)
|
||||
|
||||
append-cxxflags "${cxxflags[@]}"
|
||||
append-ldflags "${ldflags[@]}"
|
||||
emake all
|
||||
GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=${S}/usrbin ./install
|
||||
for file in *.zsh install; do
|
||||
zsh -fc "emulate zsh -o no_aliases && zcompile -R -- $file.zwc $file" || die "Couldn't zcompile"
|
||||
done
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto "/usr/share/${PN}"
|
||||
exeinto "${_}"
|
||||
|
||||
doins gitstatus.*.{sh,zsh{,.zwc}} *.info
|
||||
doexe install
|
||||
|
||||
exeinto "/usr/libexec/${PN}"
|
||||
doexe usrbin/gitstatusd
|
||||
|
||||
dosym "../../../libexec/${PN}/gitstatusd" \
|
||||
"/usr/share/${PN}/usrbin/gitstatusd"
|
||||
|
||||
dodoc {README,docs/listdir}.md
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
elog "The easiest way to take advantage of gitstatus from Zsh is to use a theme"
|
||||
elog "that's already integrated with it. For example: app-shells/zsh-theme-powerlevel10k"
|
||||
elog "The easiest way to take advantage of gitstatus from Bash is via gitstatus.prompt.sh."
|
||||
elog "Follow this guide: https://github.com/romkatv/gitstatus#using-from-bash"
|
||||
}
|
||||
|
8
app-shells/gitstatus/metadata.xml
Normal file
8
app-shells/gitstatus/metadata.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>OriPoin@outlook.com</email>
|
||||
<name>Yachen Wang</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
Loading…
x
Reference in New Issue
Block a user