-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitstatus-1.5.5-r1.ebuild
109 lines (87 loc) · 2.35 KB
/
gitstatus-1.5.5-r1.ebuild
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
# Copyright 2021-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake flag-o-matic toolchain-funcs
LIBGIT_TAG=tag-2ecf33948a4df9ef45a66c68b8ef24a5e60eaac6
LIBGIT_P="libgit2-romkatv-${LIBGIT_TAG}"
LIBGIT_DIR="${LIBGIT_P/-romkatv/}"
CMAKE_USE_DIR="${WORKDIR}/${LIBGIT_DIR}"
BUILD_DIR="${CMAKE_USE_DIR}_build"
DESCRIPTION="Git status for Bash and Zsh prompt"
HOMEPAGE="
https://github.com/romkatv/gitstatus
https://github.com/romkatv/libgit2
"
SRC_URI="
https://github.com/romkatv/${PN}/archive/v${PV}.tar.gz
-> ${P}.tar.gz
https://github.com/romkatv/libgit2/archive/${LIBGIT_TAG}.tar.gz
-> ${LIBGIT_P}.tar.gz
"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
pkg_pretend() {
tc-is-clang || return 0
ewarn 'if you are using sys-libs/libcxx to compile this,'
ewarn 'please make sure to compile sys-libs/libcxx with static-libs'
ewarn 'echo "sys-libs/libcxx static-libs" >> /etc/portage/package.use/libcxx'
}
src_prepare() {
# there are few vulnerabilities from libgit2 that is present in romkatv fork,
# but it looks like vulnerable parts of code not used by gitstatus
#
# https://github.com/libgit2/libgit2/security
# https://github.com/romkatv/libgit2/issues/5
(
cd "${CMAKE_USE_DIR}"
# this patch replaces vulnerable parts with `assert(false)`
eapply "${FILESDIR}/${P}-abort-on-vulnerable-libgit2-funcions.patch"
)
cmake_src_prepare
}
src_configure() {
mycmakeargs=(
-DUSE_SSH=OFF
-DZERO_NSEC=ON
-DTHREADSAFE=ON
-DUSE_HTTPS=OFF
-DBUILD_CLAR=OFF
-DUSE_GSSAPI=OFF
-DUSE_NTLMCLIENT=OFF
-DUSE_BUNDLED_ZLIB=ON
-DBUILD_SHARED_LIBS=OFF
-DREGEX_BACKEND=builtin
-DUSE_HTTP_PARSER=builtin
-DENABLE_REPRODUCIBLE_BUILDS=ON
)
cmake_src_configure
}
src_compile() {
append-cflags $(test-flags-CC -fno-plt)
cmake_src_compile
local cxxflags=(
"-I${CMAKE_USE_DIR}/include"
-DGITSTATUS_ZERO_NSEC
-D_GNU_SOURCE
)
local ldflags=(
"-L${BUILD_DIR}"
-static
)
append-cxxflags "${cxxflags[@]}"
append-ldflags "${ldflags[@]}"
emake all pkg
}
src_install() {
local DOCS=( {README,docs/listdir}.md )
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"
einstalldocs
}