Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/git/
Date: Fri, 05 Oct 2018 20:26:09
Message-Id: 1538771154.6399cc08b915ef315bfeb3efa06428160e5e1d5b.robbat2@gentoo
1 commit: 6399cc08b915ef315bfeb3efa06428160e5e1d5b
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 5 20:24:58 2018 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 5 20:25:54 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6399cc08
7
8 dev-vcs/git: bump for CVE-2018-17456
9
10 CVE-2018-17456 is an attack via malicious .gitmodules when cloning
11 --recurse-submodules.
12
13 Ref: http://lkml.iu.edu/hypermail/linux/kernel/1810.0/05082.html
14 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
15 Package-Manager: Portage-2.3.49, Repoman-2.3.10
16
17 dev-vcs/git/Manifest | 9 +
18 dev-vcs/git/git-2.16.5.ebuild | 699 +++++++++++++++++++++++++++++++++++++++++
19 dev-vcs/git/git-2.18.1.ebuild | 715 ++++++++++++++++++++++++++++++++++++++++++
20 dev-vcs/git/git-2.19.1.ebuild | 706 +++++++++++++++++++++++++++++++++++++++++
21 4 files changed, 2129 insertions(+)
22
23 diff --git a/dev-vcs/git/Manifest b/dev-vcs/git/Manifest
24 index 5ce1cf3953e..e1ed51f8719 100644
25 --- a/dev-vcs/git/Manifest
26 +++ b/dev-vcs/git/Manifest
27 @@ -1,9 +1,18 @@
28 DIST git-2.16.4.tar.xz 4968252 BLAKE2B 77f76408bde02bfacdb99d22baca05893f63c96d1fb7508c7e92541f8f7ec9ced0dad650be788fd28a1e03b5d88b88708652d07a47bedaae60a9cbd4e2eec858 SHA512 f54e431e78289349dcb927ec34873dfb801c49a41cbb3d0138346d603af26bd7d86f9ac95e7a61a4831017f3503f33374510ccf68b0e62b0691fc5a43283f1ac
29 +DIST git-2.16.5.tar.xz 4968780 BLAKE2B 9987e15152cce334fdfe2f56705fb2d9d246652010e58879fefc79cb20c05f177f2ed0c4ef8955889684466d2d3fbf9a246351751d6c6d6c3c8b4adeb48fbf06 SHA512 96770035f370808b7b7f3752c938394522fcb699355ed821591a1ef5756903ad0e8830441d230cbead7718b42066ad4e33fedf8b8c948fbacc89c18f3d486e26
30 DIST git-2.18.0.tar.xz 5102264 BLAKE2B 94a8469a0e489d517136233301f1af622a3e612967316620800a771721f4e558dfb9159f158ddd07d294fce3ceb256038483f5a8c1fe6a84f661710857945dce SHA512 db19363c9c2042248322d49874a27c0614acfb912183725e5d4f0331d6b44cef66a9a7da6a49bd4a17e5d86d30c5fed6bef7527f386494184595a433c4060e46
31 +DIST git-2.18.1.tar.xz 5102812 BLAKE2B 43ec86d9aebc73a582f2117ef1c26a6dc820f81ff389a6239ed6e3ea5fd2be0bac54766c3ab8ad1cc9730978e5b73997bb20b24b9f3f43d6eef06bea8a9174c3 SHA512 06bdc54c4ff78b77667b917f2aa46a803bd6561236f4177f41b8730785b5f90f8ca705f028131f9365fb0aae2e51cd92c97380141e97c026c96a020e00b992e1
32 DIST git-2.19.0.tar.xz 5227124 BLAKE2B f917b9ca8325ffbdec7d8614fec3874a09b5d3c421a0179f6c77def7e11f5853d821933b13687087b05791531e194178e1e63f51739ece91e32dddb07a127a0b SHA512 305e51f8e22d96847fcdf4169340795aacaf5f4c5b8052cda860a668059d9ef35bb2840c278b7207f3b9f0e1c32915719649edc20bd3cd33b53e97a06159ceac
33 +DIST git-2.19.1.tar.xz 5227908 BLAKE2B 1702662d7eea2ea5fa9d697eece19bee8a451abb1e85b1c7b111b4126e97340ee0c5691faf37c2d9fbe13bdf4ea894d8a3e0e2f7208e7bce111e53d1da81ef5f SHA512 a1bc1032b1de9eb9ea8b7c385cd009f64247e13066e0a91e9682e35400ded05f88c23b523cca4782f57544060d6ba0f9d3bec944399cda5771a4945c38bb9b98
34 DIST git-htmldocs-2.16.4.tar.xz 1164256 BLAKE2B 88a7ab5b094f15bc2b6c0f4d4c3eae185f6e6c0f00f4aca75492f0cc964428d1bf53002e0e43468b60b62058af5f13b061231061247e19b32bc70c2c8adb04eb SHA512 8f4a8c51656559af81296fb064ecf0f88444952c7f8ee91b85e5a61b20d200267d7432f720ded12046bab986361cff48cf7a2f5d21e05c1ac7648cc3168a0049
35 +DIST git-htmldocs-2.16.5.tar.xz 1164600 BLAKE2B 303f5543a420a78b7731aee7b9977361130edfdcffbf67e3ad652ac1243a22aa13d883337466e95a186977e34a2989f5639af7acd7c0187219b200cf966a83ef SHA512 00ed040e665e817a0543768bb290c47dd553581a18b136a59ca37e656c538f49716e79a533c5063c2a00f16f7ad021a5836f71b805200df07bb8a3923aacddfb
36 DIST git-htmldocs-2.18.0.tar.xz 1201076 BLAKE2B f5d592cadf1eb9a24b6d6fb3c68c1ead385a350e4bfc97eee775f1921c7bf47f8790d1eea803d69cde8e381d7aa0ae4c53aebeda464c32cdd7a6558a46a9c8e7 SHA512 e227673216b67cf0e5d0abacc305a3b2a30844a6fe31aab18e37643f27c0fce7d3628366732f1518784d095eb33c1bb60b4eb00024d9ccc662deca2962db5324
37 +DIST git-htmldocs-2.18.1.tar.xz 1201604 BLAKE2B ae33ac1ec8d2c95f95dbc5965d191f093628633c047c7d52371b7a3142807a4b878be5abcd13a934a453a5b35abb4a7e0ea49823e98c4a682040afc8d7c0817d SHA512 5310a846091bfa66609ce896bdce163bd84f40c14400a53eab662f0c28037b98fef4a8766a716694a5bf9549793a85b57cb665194dff5612277c6603452ea512
38 DIST git-htmldocs-2.19.0.tar.xz 1221804 BLAKE2B c3c1e91b05bb5fc777f97973941c97b8c093a94d4dc308527bc6bea7b6cc787bb939d4a5a978a69f1476da8e334f17393bf56a8de64b7e5bd88544d32f858f40 SHA512 61c6c1d64affa2f910c0c01a14f19f49ef496e1a09c223f7fb454031a6388dcd96c69c362e0da167a2e4bf1347d4c30e55d9c476076f1ab8e278f9af07053745
39 +DIST git-htmldocs-2.19.1.tar.xz 1222052 BLAKE2B 6d63364e0c5c700011ab0b7bc9c207560bc89e6d58e5f8025f30a188b7c90fa1ca58822e0ee129ff531c0702fc0a64e1612b8ff7b41102e5db21eadd0fd01ab9 SHA512 40417e80b291a935be78f143f070c68a9a865b6825f85cddd57cf926c25649630dd6612e7e52edb3ab4d1433aca31d38e3b9c95ff5d52827452d03c96e50e344
40 DIST git-manpages-2.16.4.tar.xz 417136 BLAKE2B 9a75913dae62fa2eb31cf48e77e266aa8d91c67b8a753c1740283b1d626dea1e9aa8d7cea06d9b97887f801b4d1f1b927014851105cefd3241ca7ab7330bfc8b SHA512 8029e9fac1eca542e809da1247f4eec3a2c81c0eb12d03aa816dcf120677011d3e409b06c28c8e7dbf41cbbcca873ec93846dc317bc73e57f4d4701ce7abf73d
41 +DIST git-manpages-2.16.5.tar.xz 417140 BLAKE2B f7b3255fe0ac7ea82273e0718d96e045854b7d3c7ad100befac47cd005139415e56b8e0dd85293bca26f2e1ff12f729c46bfd27ede5ecdda08a1533ed43a8b2f SHA512 38ec66e43055f7121bace4655350e9b617b5586271c4ae73d15966e52e56ac38bec2f5f7f128410d004a2a0db3db9954fcfec1d78eb49579a74a46b404b67396
42 DIST git-manpages-2.18.0.tar.xz 425516 BLAKE2B ff979aa0c99716da279cd4001d5907cec95e93ac93f1f2dc5dd79d456a185e0d8610a121b08b07c3c886132e94334114932881d78c7307ff287c256f993938e5 SHA512 8ae353083288e58752e6e6ff505cde6f4fa0be20465443c0517a87af28867d748eb29fc9d3dcb805b29c4e422cf4eae124b7fec5c339888ab4ebaff6360ada15
43 +DIST git-manpages-2.18.1.tar.xz 425568 BLAKE2B fc0f8aee3d80cba0f84c4ff4cfa342ea3c1ae155f3434b6d1771e03bb14956d5ffd78a5cadfee378534f6cf85265c37eeb1be27eb7801ae798cede249640c478 SHA512 6e6e663d985ef267d556539a43c192138b31dbbc80ffaa4331b8494f6e3e74b5cd4d958c2ae963143946eaa99bfce485ee3726b510b10eaab3599b5284b5fbc1
44 DIST git-manpages-2.19.0.tar.xz 431832 BLAKE2B b1493e88b3836cfdbd4f709058f7b287764df52237f2dee054668ce5cd9a547553fb36f2f474debd9bc2a511e73a9967307d8a3d174651d261ddd4176a8ec766 SHA512 463cacfc58dc16d69dc9e374fb840cd2859d69e2a74575437be72159e05cc85ad6c9e89dfe2c20963fce962b9add4ad9694e84ab5792b2c30034f68d52648117
45 +DIST git-manpages-2.19.1.tar.xz 431852 BLAKE2B e15be2e1680a28c3c57e7b6e022173ef4b006cf21b5464a32f7f7668ea2b8af2ac7ff7466d98ab627320895b92583840159e2fca613be95817656def2654edaa SHA512 1b42c39e39653906b44fbca65991da04493f08479e2162da5f593bee68dbfd3f3b8180f5a2721f1971e3218b0dc842a8a34918fc7724c032597f4fe4b2f506dc
46
47 diff --git a/dev-vcs/git/git-2.16.5.ebuild b/dev-vcs/git/git-2.16.5.ebuild
48 new file mode 100644
49 index 00000000000..b51710380b0
50 --- /dev/null
51 +++ b/dev-vcs/git/git-2.16.5.ebuild
52 @@ -0,0 +1,699 @@
53 +# Copyright 1999-2018 Gentoo Foundation
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=6
57 +
58 +GENTOO_DEPEND_ON_PERL=no
59 +
60 +# bug #329479: git-remote-testgit is not multiple-version aware
61 +PYTHON_COMPAT=( python2_7 )
62 +PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
63 +if [[ ${PV} == *9999 ]]; then
64 + SCM="git-r3"
65 + EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
66 + # Please ensure that all _four_ 9999 ebuilds get updated; they track the 4 upstream branches.
67 + # See https://git-scm.com/docs/gitworkflows#_graduation
68 + # In order of stability:
69 + # 9999-r0: maint
70 + # 9999-r1: master
71 + # 9999-r2: next
72 + # 9999-r3: pu
73 + case "${PVR}" in
74 + 9999) EGIT_BRANCH=maint ;;
75 + 9999-r1) EGIT_BRANCH=master ;;
76 + 9999-r2) EGIT_BRANCH=next;;
77 + 9999-r3) EGIT_BRANCH=pu ;;
78 + esac
79 +fi
80 +
81 +inherit toolchain-funcs eutils elisp-common l10n perl-module bash-completion-r1 python-single-r1 systemd ${SCM}
82 +
83 +MY_PV="${PV/_rc/.rc}"
84 +MY_P="${PN}-${MY_PV}"
85 +
86 +DOC_VER=${MY_PV}
87 +
88 +DESCRIPTION="stupid content tracker: distributed VCS designed for speed and efficiency"
89 +HOMEPAGE="https://www.git-scm.com/"
90 +if [[ ${PV} != *9999 ]]; then
91 + SRC_URI_SUFFIX="xz"
92 + SRC_URI_KORG="mirror://kernel/software/scm/git"
93 + [[ "${PV/rc}" != "${PV}" ]] && SRC_URI_KORG+='/testing'
94 + SRC_URI="${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
95 + ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
96 + doc? (
97 + ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
98 + )"
99 + [[ "${PV}" = *_rc* ]] || \
100 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
101 +fi
102 +
103 +LICENSE="GPL-2"
104 +SLOT="0"
105 +IUSE="+blksha1 +curl cgi doc emacs gnome-keyring +gpg highlight +iconv libressl mediawiki mediawiki-experimental +nls +pcre +pcre-jit +perl +python ppcsha1 tk +threads +webdav xinetd cvs subversion test"
106 +
107 +# Common to both DEPEND and RDEPEND
108 +CDEPEND="
109 + gnome-keyring? ( app-crypt/libsecret )
110 + !libressl? ( dev-libs/openssl:0= )
111 + libressl? ( dev-libs/libressl:= )
112 + sys-libs/zlib
113 + pcre? (
114 + pcre-jit? ( dev-libs/libpcre2[jit(+)] )
115 + !pcre-jit? ( dev-libs/libpcre )
116 + )
117 + perl? ( dev-lang/perl:=[-build(-)] )
118 + tk? ( dev-lang/tk:0= )
119 + curl? (
120 + net-misc/curl
121 + webdav? ( dev-libs/expat )
122 + )
123 + emacs? ( virtual/emacs )
124 +"
125 +
126 +RDEPEND="${CDEPEND}
127 + gpg? ( app-crypt/gnupg )
128 + mediawiki? (
129 + dev-perl/DateTime-Format-ISO8601
130 + dev-perl/HTML-Tree
131 + dev-perl/MediaWiki-API
132 + )
133 + perl? ( dev-perl/Error
134 + dev-perl/Net-SMTP-SSL
135 + dev-perl/Authen-SASL
136 + cgi? ( dev-perl/CGI highlight? ( app-text/highlight ) )
137 + cvs? ( >=dev-vcs/cvsps-2.1:0 dev-perl/DBI dev-perl/DBD-SQLite )
138 + subversion? ( dev-vcs/subversion[-dso,perl] dev-perl/libwww-perl dev-perl/TermReadKey )
139 + )
140 + python? ( ${PYTHON_DEPS} )
141 +"
142 +
143 +# This is how info docs are created with Git:
144 +# .txt/asciidoc --(asciidoc)---------> .xml/docbook
145 +# .xml/docbook --(docbook2texi.pl)--> .texi
146 +# .texi --(makeinfo)---------> .info
147 +DEPEND="${CDEPEND}
148 + doc? (
149 + app-text/asciidoc
150 + app-text/docbook2X
151 + sys-apps/texinfo
152 + app-text/xmlto
153 + )
154 + nls? ( sys-devel/gettext )
155 + test? ( app-crypt/gnupg )"
156 +
157 +# Live ebuild builds man pages and HTML docs, additionally
158 +if [[ ${PV} == *9999 ]]; then
159 + DEPEND="${DEPEND}
160 + app-text/asciidoc"
161 +fi
162 +
163 +SITEFILE=50${PN}-gentoo.el
164 +S="${WORKDIR}/${MY_P}"
165 +
166 +REQUIRED_USE="
167 + cgi? ( perl )
168 + cvs? ( perl )
169 + mediawiki? ( perl )
170 + mediawiki-experimental? ( mediawiki )
171 + subversion? ( perl )
172 + webdav? ( curl )
173 + pcre-jit? ( pcre )
174 + python? ( ${PYTHON_REQUIRED_USE} )
175 +"
176 +
177 +PATCHES=(
178 + # bug #350330 - automagic CVS when we don't want it is bad.
179 + "${FILESDIR}"/git-2.12.0-optional-cvs.patch
180 +
181 + # install mediawiki perl modules also in vendor_dir
182 + # hack, needs better upstream solution
183 + "${FILESDIR}"/git-1.8.5-mw-vendor.patch
184 +
185 + "${FILESDIR}"/git-2.2.0-svn-fe-linking.patch
186 +
187 + # Bug #493306, where FreeBSD 10.x merged libiconv into its libc.
188 + "${FILESDIR}"/git-2.5.1-freebsd-10.x-no-iconv.patch
189 +)
190 +
191 +pkg_setup() {
192 + if use subversion && has_version "dev-vcs/subversion[dso]"; then
193 + ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
194 + ewarn "with USE=dso, there may be weird crashes in git-svn. You"
195 + ewarn "have been warned."
196 + fi
197 + if use python ; then
198 + python-single-r1_pkg_setup
199 + fi
200 +}
201 +
202 +# This is needed because for some obscure reasons future calls to make don't
203 +# pick up these exports if we export them in src_unpack()
204 +exportmakeopts() {
205 + local myopts
206 +
207 + if use blksha1 ; then
208 + myopts+=" BLK_SHA1=YesPlease"
209 + elif use ppcsha1 ; then
210 + myopts+=" PPC_SHA1=YesPlease"
211 + fi
212 +
213 + if use curl ; then
214 + use webdav || myopts+=" NO_EXPAT=YesPlease"
215 + else
216 + myopts+=" NO_CURL=YesPlease"
217 + fi
218 +
219 + # broken assumptions, because of static build system ...
220 + myopts+=" NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease"
221 + myopts+=" INSTALL=install TAR=tar"
222 + myopts+=" SHELL_PATH=${EPREFIX}/bin/sh"
223 + myopts+=" SANE_TOOL_PATH="
224 + myopts+=" OLD_ICONV="
225 + myopts+=" NO_EXTERNAL_GREP="
226 +
227 + # For svn-fe
228 + extlibs="-lz -lssl ${S}/xdiff/lib.a $(usex threads -lpthread '')"
229 +
230 + # can't define this to null, since the entire makefile depends on it
231 + sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile
232 +
233 + use iconv \
234 + || myopts+=" NO_ICONV=YesPlease"
235 + use nls \
236 + || myopts+=" NO_GETTEXT=YesPlease"
237 + use tk \
238 + || myopts+=" NO_TCLTK=YesPlease"
239 + if use pcre; then
240 + if use pcre-jit; then
241 + myopts+=" USE_LIBPCRE2=YesPlease"
242 + extlibs+=" -lpcre2-8"
243 + else
244 + myopts+=" USE_LIBPCRE1=YesPlease"
245 + myopts+=" NO_LIBPCRE1_JIT=YesPlease"
246 + extlibs+=" -lpcre"
247 + fi
248 + fi
249 + use perl \
250 + && myopts+=" INSTALLDIRS=vendor" \
251 + || myopts+=" NO_PERL=YesPlease"
252 + use python \
253 + || myopts+=" NO_PYTHON=YesPlease"
254 + use subversion \
255 + || myopts+=" NO_SVN_TESTS=YesPlease"
256 + use threads \
257 + && myopts+=" THREADED_DELTA_SEARCH=YesPlease" \
258 + || myopts+=" NO_PTHREADS=YesPlease"
259 + use cvs \
260 + || myopts+=" NO_CVS=YesPlease"
261 + use elibc_musl \
262 + && myopts+=" NO_REGEX=YesPlease"
263 +# Disabled until ~m68k-mint can be keyworded again
264 +# if [[ ${CHOST} == *-mint* ]] ; then
265 +# myopts+=" NO_MMAP=YesPlease"
266 +# myopts+=" NO_IPV6=YesPlease"
267 +# myopts+=" NO_STRLCPY=YesPlease"
268 +# myopts+=" NO_MEMMEM=YesPlease"
269 +# myopts+=" NO_MKDTEMP=YesPlease"
270 +# myopts+=" NO_MKSTEMPS=YesPlease"
271 +# fi
272 + if [[ ${CHOST} == ia64-*-hpux* ]]; then
273 + myopts+=" NO_NSEC=YesPlease"
274 + fi
275 + if [[ ${CHOST} == *-*-aix* ]]; then
276 + myopts+=" NO_FNMATCH_CASEFOLD=YesPlease"
277 + fi
278 + if [[ ${CHOST} == *-solaris* ]]; then
279 + myopts+=" NEEDS_LIBICONV=YesPlease"
280 + myopts+=" HAVE_CLOCK_MONOTONIC=1"
281 + grep -q getdelim "${ROOT}"/usr/include/stdio.h && \
282 + myopts+=" HAVE_GETDELIM=1"
283 + fi
284 +
285 + has_version '>=app-text/asciidoc-8.0' \
286 + && myopts+=" ASCIIDOC8=YesPlease"
287 + myopts+=" ASCIIDOC_NO_ROFF=YesPlease"
288 +
289 + # Bug 290465:
290 + # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
291 + [[ "${CHOST}" == *-uclibc* ]] && \
292 + myopts+=" NO_NSEC=YesPlease"
293 +
294 + export MY_MAKEOPTS="${myopts}"
295 + export EXTLIBS="${extlibs}"
296 +}
297 +
298 +src_unpack() {
299 + if [[ ${PV} != *9999 ]]; then
300 + unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
301 + cd "${S}"
302 + unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
303 + use doc && \
304 + cd "${S}"/Documentation && \
305 + unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
306 + cd "${S}"
307 + else
308 + git-r3_src_unpack
309 + cd "${S}"
310 + #cp "${FILESDIR}"/GIT-VERSION-GEN .
311 + fi
312 +
313 +}
314 +
315 +src_prepare() {
316 + # add experimental patches to improve mediawiki support
317 + # see patches for origin
318 + if use mediawiki-experimental ; then
319 + PATCHES+=(
320 + "${FILESDIR}"/git-2.7.0-mediawiki-namespaces.patch
321 + "${FILESDIR}"/git-2.7.0-mediawiki-subpages.patch
322 + "${FILESDIR}"/git-2.7.0-mediawiki-500pages.patch
323 + )
324 + fi
325 +
326 + default
327 +
328 + sed -i \
329 + -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
330 + -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
331 + -e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
332 + -e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
333 + -e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
334 + -e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
335 + Makefile contrib/svn-fe/Makefile || die "sed failed"
336 +
337 + # Never install the private copy of Error.pm (bug #296310)
338 + sed -i \
339 + -e '/private-Error.pm/s,^,#,' \
340 + perl/Makefile.PL
341 +
342 + # Fix docbook2texi command
343 + sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
344 + Documentation/Makefile || die "sed failed"
345 +
346 + # Fix git-subtree missing DESTDIR
347 + sed -i \
348 + -e '/$(INSTALL)/s/ $(libexecdir)/ $(DESTDIR)$(libexecdir)/g' \
349 + -e '/$(INSTALL)/s/ $(man1dir)/ $(DESTDIR)$(man1dir)/g' \
350 + contrib/subtree/Makefile
351 +}
352 +
353 +git_emake() {
354 + # bug #320647: PYTHON_PATH
355 + PYTHON_PATH=""
356 + use python && PYTHON_PATH="${PYTHON}"
357 + emake ${MY_MAKEOPTS} \
358 + DESTDIR="${D}" \
359 + OPTCFLAGS="${CFLAGS}" \
360 + OPTLDFLAGS="${LDFLAGS}" \
361 + OPTCC="$(tc-getCC)" \
362 + OPTAR="$(tc-getAR)" \
363 + prefix="${EPREFIX}"/usr \
364 + htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
365 + sysconfdir="${EPREFIX}"/etc \
366 + PYTHON_PATH="${PYTHON_PATH}" \
367 + PERL_PATH="${EPREFIX}/usr/bin/perl" \
368 + PERL_MM_OPT="" \
369 + GIT_TEST_OPTS="--no-color" \
370 + V=1 \
371 + "$@"
372 +}
373 +
374 +src_configure() {
375 + exportmakeopts
376 +}
377 +
378 +src_compile() {
379 + if use perl ; then
380 + git_emake perl/PM.stamp || die "emake perl/PM.stamp failed"
381 + git_emake perl/perl.mak || die "emake perl/perl.mak failed"
382 + fi
383 + git_emake || die "emake failed"
384 +
385 + if use emacs ; then
386 + elisp-compile contrib/emacs/git{,-blame}.el
387 + fi
388 +
389 + if use perl && use cgi ; then
390 + git_emake \
391 + gitweb \
392 + || die "emake gitweb (cgi) failed"
393 + fi
394 +
395 + if [[ ${CHOST} == *-darwin* ]]; then
396 + cd "${S}"/contrib/credential/osxkeychain || die
397 + git_emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" \
398 + || die "emake credential-osxkeychain"
399 + fi
400 +
401 + cd "${S}"/Documentation
402 + if [[ ${PV} == *9999 ]] ; then
403 + git_emake man \
404 + || die "emake man failed"
405 + if use doc ; then
406 + git_emake info html \
407 + || die "emake info html failed"
408 + fi
409 + else
410 + if use doc ; then
411 + git_emake info \
412 + || die "emake info html failed"
413 + fi
414 + fi
415 +
416 + if use subversion ; then
417 + cd "${S}"/contrib/svn-fe
418 + # by defining EXTLIBS we override the detection for libintl and
419 + # libiconv, bug #516168
420 + local nlsiconv=
421 + use nls && use !elibc_glibc && nlsiconv+=" -lintl"
422 + use iconv && use !elibc_glibc && nlsiconv+=" -liconv"
423 + git_emake EXTLIBS="${EXTLIBS} ${nlsiconv}" || die "emake svn-fe failed"
424 + if use doc ; then
425 + git_emake svn-fe.{1,html} || die "emake svn-fe.1 svn-fe.html failed"
426 + fi
427 + cd "${S}"
428 + fi
429 +
430 + if use gnome-keyring ; then
431 + cd "${S}"/contrib/credential/libsecret
432 + git_emake || die "emake git-credential-libsecret failed"
433 + fi
434 +
435 + cd "${S}"/contrib/subtree || die
436 + git_emake
437 + use doc && git_emake doc
438 +
439 + cd "${S}"/contrib/diff-highlight || die
440 + git_emake
441 +
442 + if use mediawiki ; then
443 + cd "${S}"/contrib/mw-to-git
444 + git_emake
445 + fi
446 +}
447 +
448 +src_install() {
449 + git_emake \
450 + install || \
451 + die "make install failed"
452 +
453 + if [[ ${CHOST} == *-darwin* ]]; then
454 + dobin contrib/credential/osxkeychain/git-credential-osxkeychain
455 + fi
456 +
457 + # Depending on the tarball and manual rebuild of the documentation, the
458 + # manpages may exist in either OR both of these directories.
459 + find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
460 + find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
461 + dodoc README* Documentation/{SubmittingPatches,CodingGuidelines}
462 + use doc && dodir /usr/share/doc/${PF}/html
463 + for d in / /howto/ /technical/ ; do
464 + docinto ${d}
465 + dodoc Documentation${d}*.txt
466 + if use doc ; then
467 + docinto ${d}/html
468 + dodoc Documentation${d}*.html
469 + fi
470 + done
471 + docinto /
472 + # Upstream does not ship this pre-built :-(
473 + use doc && doinfo Documentation/{git,gitman}.info
474 +
475 + newbashcomp contrib/completion/git-completion.bash ${PN}
476 + bashcomp_alias git gitk
477 + # Not really a bash-completion file (bug #477920)
478 + # but still needed uncompressed (bug #507480)
479 + insinto /usr/share/${PN}
480 + doins contrib/completion/git-prompt.sh
481 +
482 + if use emacs ; then
483 + elisp-install ${PN} contrib/emacs/git.{el,elc}
484 + elisp-install ${PN} contrib/emacs/git-blame.{el,elc}
485 + #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc}
486 + # don't add automatically to the load-path, so the sitefile
487 + # can do a conditional loading
488 + touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
489 + elisp-site-file-install "${FILESDIR}"/${SITEFILE}
490 + fi
491 +
492 + #dobin contrib/fast-import/git-p4 # Moved upstream
493 + #dodoc contrib/fast-import/git-p4.txt # Moved upstream
494 + newbin contrib/fast-import/import-tars.perl import-tars
495 + exeinto /usr/libexec/git-core/
496 + newexe contrib/git-resurrect.sh git-resurrect
497 +
498 + # git-subtree
499 + cd "${S}"/contrib/subtree
500 + git_emake install || die "Failed to emake install git-subtree"
501 + if use doc ; then
502 + git_emake install-man install-doc || die "Failed to emake install-doc install-mangit-subtree"
503 + fi
504 + newdoc README README.git-subtree
505 + dodoc git-subtree.txt
506 + cd "${S}"
507 +
508 + if use mediawiki ; then
509 + cd "${S}"/contrib/mw-to-git
510 + git_emake install
511 + cd "${S}"
512 + fi
513 +
514 + # diff-highlight
515 + dobin contrib/diff-highlight/diff-highlight
516 + newdoc contrib/diff-highlight/README README.diff-highlight
517 +
518 + # git-jump
519 + exeinto /usr/libexec/git-core/
520 + doexe contrib/git-jump/git-jump
521 + newdoc contrib/git-jump/README git-jump.txt
522 +
523 + # git-contacts
524 + exeinto /usr/libexec/git-core/
525 + doexe contrib/contacts/git-contacts
526 + dodoc contrib/contacts/git-contacts.txt
527 +
528 + if use gnome-keyring ; then
529 + cd "${S}"/contrib/credential/libsecret
530 + dobin git-credential-libsecret
531 + fi
532 +
533 + if use subversion ; then
534 + cd "${S}"/contrib/svn-fe
535 + dobin svn-fe
536 + dodoc svn-fe.txt
537 + if use doc ; then
538 + doman svn-fe.1
539 + docinto html
540 + dodoc svn-fe.html
541 + fi
542 + cd "${S}"
543 + fi
544 +
545 + dodir /usr/share/${PN}/contrib
546 + # The following are excluded:
547 + # completion - installed above
548 + # diff-highlight - done above
549 + # emacs - installed above
550 + # examples - these are stuff that is not used in Git anymore actually
551 + # git-jump - done above
552 + # gitview - installed above
553 + # p4import - excluded because fast-import has a better one
554 + # patches - stuff the Git guys made to go upstream to other places
555 + # persistent-https - TODO
556 + # mw-to-git - TODO
557 + # subtree - build seperately
558 + # svnimport - use git-svn
559 + # thunderbird-patch-inline - fixes thunderbird
560 + local contrib_objects=(
561 + buildsystems
562 + fast-import
563 + hg-to-git
564 + hooks
565 + remotes2config.sh
566 + rerere-train.sh
567 + stats
568 + workdir
569 + )
570 + for i in "${contrib_objects[@]}" ; do
571 + cp -rf \
572 + "${S}"/contrib/${i} \
573 + "${ED}"/usr/share/${PN}/contrib \
574 + || die "Failed contrib ${i}"
575 + done
576 +
577 + if use perl && use cgi ; then
578 + # We used to install in /usr/share/${PN}/gitweb
579 + # but upstream installs in /usr/share/gitweb
580 + # so we will install a symlink and use their location for compat with other
581 + # distros
582 + dosym /usr/share/gitweb /usr/share/${PN}/gitweb
583 +
584 + # INSTALL discusses configuration issues, not just installation
585 + docinto /
586 + newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
587 + newdoc "${S}"/gitweb/README README.gitweb
588 +
589 + for d in "${ED}"/usr/lib{64,}/perl5/ ; do
590 + if test -d "$d" ; then find "$d" \
591 + -name .packlist \
592 + -delete || die
593 + fi
594 + done
595 + else
596 + rm -rf "${ED}"/usr/share/gitweb
597 + fi
598 +
599 + if ! use subversion ; then
600 + rm -f "${ED}"/usr/libexec/git-core/git-svn \
601 + "${ED}"/usr/share/man/man1/git-svn.1*
602 + fi
603 +
604 + if use xinetd ; then
605 + insinto /etc/xinetd.d
606 + newins "${FILESDIR}"/git-daemon.xinetd git-daemon
607 + fi
608 +
609 + if use !prefix ; then
610 + newinitd "${FILESDIR}"/git-daemon-r1.initd git-daemon
611 + newconfd "${FILESDIR}"/git-daemon.confd git-daemon
612 + systemd_newunit "${FILESDIR}/git-daemon_at-r1.service" "git-daemon@.service"
613 + systemd_dounit "${FILESDIR}/git-daemon.socket"
614 + fi
615 +
616 + perl_delete_localpod
617 +
618 + # Remove disabled linguas
619 + # we could remove sources in src_prepare, but install does not
620 + # handle missing locale dir well
621 + rm_loc() {
622 + if [[ -e "${ED}/usr/share/locale/${1}" ]]; then
623 + rm -r "${ED}/usr/share/locale/${1}" || die
624 + fi
625 + }
626 + l10n_for_each_disabled_locale_do rm_loc
627 +}
628 +
629 +src_test() {
630 + local disabled=""
631 + local tests_cvs="t9200-git-cvsexportcommit.sh \
632 + t9400-git-cvsserver-server.sh \
633 + t9401-git-cvsserver-crlf.sh \
634 + t9402-git-cvsserver-refs.sh \
635 + t9600-cvsimport.sh \
636 + t9601-cvsimport-vendor-branch.sh \
637 + t9602-cvsimport-branches-tags.sh \
638 + t9603-cvsimport-patchsets.sh \
639 + t9604-cvsimport-timestamps.sh"
640 + local tests_perl="t3701-add-interactive.sh \
641 + t5502-quickfetch.sh \
642 + t5512-ls-remote.sh \
643 + t5520-pull.sh \
644 + t7106-reset-unborn-branch.sh \
645 + t7501-commit.sh"
646 + # Bug #225601 - t0004 is not suitable for root perm
647 + # Bug #219839 - t1004 is not suitable for root perm
648 + # t0001-init.sh - check for init notices EPERM* fails
649 + local tests_nonroot="t0001-init.sh \
650 + t0004-unwritable.sh \
651 + t0070-fundamental.sh \
652 + t1004-read-tree-m-u-wf.sh \
653 + t3700-add.sh \
654 + t7300-clean.sh"
655 + # t9100 still fails with symlinks in SVN 1.7
656 + local test_svn="t9100-git-svn-basic.sh"
657 +
658 + # Unzip is used only for the testcase code, not by any normal parts of Git.
659 + if ! has_version app-arch/unzip ; then
660 + einfo "Disabling tar-tree tests"
661 + disabled+=" t5000-tar-tree.sh"
662 + fi
663 +
664 + cvs=0
665 + use cvs && let cvs=$cvs+1
666 + if [[ ${EUID} -eq 0 ]]; then
667 + if [[ $cvs -eq 1 ]]; then
668 + ewarn "Skipping CVS tests because CVS does not work as root!"
669 + ewarn "You should retest with FEATURES=userpriv!"
670 + disabled+=" ${tests_cvs}"
671 + fi
672 + einfo "Skipping other tests that require being non-root"
673 + disabled+=" ${tests_nonroot}"
674 + else
675 + [[ $cvs -gt 0 ]] && \
676 + has_version dev-vcs/cvs && \
677 + let cvs=$cvs+1
678 + [[ $cvs -gt 1 ]] && \
679 + has_version "dev-vcs/cvs[server]" && \
680 + let cvs=$cvs+1
681 + if [[ $cvs -lt 3 ]]; then
682 + einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
683 + disabled+=" ${tests_cvs}"
684 + fi
685 + fi
686 +
687 + if ! use perl ; then
688 + einfo "Disabling tests that need Perl"
689 + disabled+=" ${tests_perl}"
690 + fi
691 +
692 + einfo "Disabling tests that fail with SVN 1.7"
693 + disabled+=" ${test_svn}"
694 +
695 + # Reset all previously disabled tests
696 + cd "${S}/t"
697 + for i in *.sh.DISABLED ; do
698 + [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
699 + done
700 + einfo "Disabled tests:"
701 + for i in ${disabled} ; do
702 + [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
703 + done
704 +
705 + # Avoid the test system removing the results because we want them ourselves
706 + sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
707 + -i "${S}"/t/Makefile
708 +
709 + # Clean old results first, must always run
710 + cd "${S}/t"
711 + nonfatal git_emake clean
712 +
713 + # Now run the tests, keep going if we hit an error, and don't terminate on
714 + # failure
715 + cd "${S}"
716 + einfo "Start test run"
717 + #MAKEOPTS=-j1
718 + nonfatal git_emake --keep-going test
719 + rc=$?
720 +
721 + # Display nice results, now print the results
722 + cd "${S}/t"
723 + nonfatal git_emake aggregate-results
724 +
725 + # And bail if there was a problem
726 + [ $rc -eq 0 ] || die "tests failed. Please file a bug."
727 +}
728 +
729 +showpkgdeps() {
730 + local pkg=$1
731 + shift
732 + elog " $(printf "%-17s:" ${pkg}) ${@}"
733 +}
734 +
735 +pkg_postinst() {
736 + use emacs && elisp-site-regen
737 + elog "Please read /usr/share/bash-completion/git for Git bash command completion"
738 + elog "Please read /usr/share/git/git-prompt.sh for Git bash prompt"
739 + elog "Note that the prompt bash code is now in that separate script"
740 + elog "These additional scripts need some dependencies:"
741 + echo
742 + showpkgdeps git-quiltimport "dev-util/quilt"
743 + showpkgdeps git-instaweb \
744 + "|| ( www-servers/lighttpd www-servers/apache www-servers/nginx )"
745 + echo
746 + use mediawiki-experimental && ewarn "Using experimental git-mediawiki patches. The stability of cloned wiki filesystems is not guaranteed."
747 +}
748 +
749 +pkg_postrm() {
750 + use emacs && elisp-site-regen
751 +}
752
753 diff --git a/dev-vcs/git/git-2.18.1.ebuild b/dev-vcs/git/git-2.18.1.ebuild
754 new file mode 100644
755 index 00000000000..2f2de4ae7ec
756 --- /dev/null
757 +++ b/dev-vcs/git/git-2.18.1.ebuild
758 @@ -0,0 +1,715 @@
759 +# Copyright 1999-2018 Gentoo Authors
760 +# Distributed under the terms of the GNU General Public License v2
761 +
762 +EAPI=6
763 +
764 +GENTOO_DEPEND_ON_PERL=no
765 +
766 +# bug #329479: git-remote-testgit is not multiple-version aware
767 +PYTHON_COMPAT=( python2_7 )
768 +PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
769 +if [[ ${PV} == *9999 ]]; then
770 + SCM="git-r3"
771 + EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
772 + # Please ensure that all _four_ 9999 ebuilds get updated; they track the 4 upstream branches.
773 + # See https://git-scm.com/docs/gitworkflows#_graduation
774 + # In order of stability:
775 + # 9999-r0: maint
776 + # 9999-r1: master
777 + # 9999-r2: next
778 + # 9999-r3: pu
779 + case "${PVR}" in
780 + 9999) EGIT_BRANCH=maint ;;
781 + 9999-r1) EGIT_BRANCH=master ;;
782 + 9999-r2) EGIT_BRANCH=next;;
783 + 9999-r3) EGIT_BRANCH=pu ;;
784 + esac
785 +fi
786 +
787 +inherit toolchain-funcs eutils elisp-common l10n perl-module bash-completion-r1 python-single-r1 systemd ${SCM}
788 +
789 +MY_PV="${PV/_rc/.rc}"
790 +MY_P="${PN}-${MY_PV}"
791 +
792 +DOC_VER=${MY_PV}
793 +
794 +DESCRIPTION="stupid content tracker: distributed VCS designed for speed and efficiency"
795 +HOMEPAGE="https://www.git-scm.com/"
796 +if [[ ${PV} != *9999 ]]; then
797 + SRC_URI_SUFFIX="xz"
798 + SRC_URI_KORG="mirror://kernel/software/scm/git"
799 + [[ "${PV/rc}" != "${PV}" ]] && SRC_URI_KORG+='/testing'
800 + SRC_URI="${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
801 + ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
802 + doc? (
803 + ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
804 + )"
805 + [[ "${PV}" = *_rc* ]] || \
806 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
807 +fi
808 +
809 +LICENSE="GPL-2"
810 +SLOT="0"
811 +IUSE="+blksha1 +curl cgi doc emacs gnome-keyring +gpg highlight +iconv libressl mediawiki mediawiki-experimental +nls +pcre +pcre-jit +perl +python ppcsha1 tk +threads +webdav xinetd cvs subversion test"
812 +
813 +# Common to both DEPEND and RDEPEND
814 +CDEPEND="
815 + gnome-keyring? ( app-crypt/libsecret )
816 + !libressl? ( dev-libs/openssl:0= )
817 + libressl? ( dev-libs/libressl:= )
818 + sys-libs/zlib
819 + pcre? (
820 + pcre-jit? ( dev-libs/libpcre2[jit(+)] )
821 + !pcre-jit? ( dev-libs/libpcre )
822 + )
823 + perl? ( dev-lang/perl:=[-build(-)] )
824 + tk? ( dev-lang/tk:0= )
825 + curl? (
826 + net-misc/curl
827 + webdav? ( dev-libs/expat )
828 + )
829 + emacs? ( virtual/emacs )
830 +"
831 +
832 +RDEPEND="${CDEPEND}
833 + gpg? ( app-crypt/gnupg )
834 + perl? (
835 + dev-perl/Error
836 + dev-perl/MailTools
837 + dev-perl/Net-SMTP-SSL
838 + dev-perl/Authen-SASL
839 + cgi? (
840 + dev-perl/CGI
841 + highlight? ( app-text/highlight )
842 + )
843 + cvs? (
844 + >=dev-vcs/cvsps-2.1:0
845 + dev-perl/DBI
846 + dev-perl/DBD-SQLite
847 + )
848 + mediawiki? (
849 + dev-perl/DateTime-Format-ISO8601
850 + dev-perl/HTML-Tree
851 + dev-perl/MediaWiki-API
852 + )
853 + subversion? (
854 + dev-vcs/subversion[-dso,perl]
855 + dev-perl/libwww-perl
856 + dev-perl/TermReadKey
857 + )
858 + )
859 + python? ( ${PYTHON_DEPS} )
860 +"
861 +
862 +# This is how info docs are created with Git:
863 +# .txt/asciidoc --(asciidoc)---------> .xml/docbook
864 +# .xml/docbook --(docbook2texi.pl)--> .texi
865 +# .texi --(makeinfo)---------> .info
866 +DEPEND="${CDEPEND}
867 + doc? (
868 + app-text/asciidoc
869 + app-text/docbook2X
870 + sys-apps/texinfo
871 + app-text/xmlto
872 + )
873 + nls? ( sys-devel/gettext )
874 + test? ( app-crypt/gnupg )"
875 +
876 +# Live ebuild builds man pages and HTML docs, additionally
877 +if [[ ${PV} == *9999 ]]; then
878 + DEPEND="${DEPEND}
879 + app-text/asciidoc"
880 +fi
881 +
882 +SITEFILE="50${PN}-gentoo.el"
883 +S="${WORKDIR}/${MY_P}"
884 +
885 +REQUIRED_USE="
886 + cgi? ( perl )
887 + cvs? ( perl )
888 + mediawiki? ( perl )
889 + mediawiki-experimental? ( mediawiki )
890 + subversion? ( perl )
891 + webdav? ( curl )
892 + pcre-jit? ( pcre )
893 + python? ( ${PYTHON_REQUIRED_USE} )
894 +"
895 +
896 +PATCHES=(
897 + # bug #350330 - automagic CVS when we don't want it is bad.
898 + "${FILESDIR}"/git-2.18.0_rc1-optional-cvs.patch
899 +
900 + "${FILESDIR}"/git-2.2.0-svn-fe-linking.patch
901 +
902 + # Bug #493306, where FreeBSD 10.x merged libiconv into its libc.
903 + "${FILESDIR}"/git-2.5.1-freebsd-10.x-no-iconv.patch
904 +)
905 +
906 +pkg_setup() {
907 + if use subversion && has_version "dev-vcs/subversion[dso]"; then
908 + ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
909 + ewarn "with USE=dso, there may be weird crashes in git-svn. You"
910 + ewarn "have been warned."
911 + fi
912 + if use python ; then
913 + python-single-r1_pkg_setup
914 + fi
915 +}
916 +
917 +# This is needed because for some obscure reasons future calls to make don't
918 +# pick up these exports if we export them in src_unpack()
919 +exportmakeopts() {
920 + local myopts=(
921 + ASCIIDOC_NO_ROFF=YesPlease
922 + $(usex cvs '' NO_CVS=YesPlease)
923 + $(usex elibc_musl NO_REGEX=YesPlease '')
924 + $(usex iconv '' NO_ICONV=YesPlease)
925 + $(usex nls '' NO_GETTEXT=YesPlease)
926 + $(usex perl 'INSTALLDIRS=vendor NO_PERL_CPAN_FALLBACKS=YesPlease' NO_PERL=YesPlease)
927 + $(usex python '' NO_PYTHON=YesPlease)
928 + $(usex subversion '' NO_SVN_TESTS=YesPlease)
929 + $(usex threads THREADED_DELTA_SEARCH=YesPlease NO_PTHREAD=YesPlease)
930 + $(usex tk '' NO_TCLTK=YesPlease)
931 + )
932 +
933 + if use blksha1 ; then
934 + myopts+=( BLK_SHA1=YesPlease )
935 + elif use ppcsha1 ; then
936 + myopts+=( PPC_SHA1=YesPlease )
937 + fi
938 +
939 + if use curl ; then
940 + use webdav || myopts+=( NO_EXPAT=YesPlease )
941 + else
942 + myopts+=( NO_CURL=YesPlease )
943 + fi
944 +
945 + # broken assumptions, because of static build system ...
946 + myopts+=(
947 + NO_FINK=YesPlease
948 + NO_DARWIN_PORTS=YesPlease
949 + INSTALL=install
950 + TAR=tar
951 + SHELL_PATH="${EPREFIX}/bin/sh"
952 + SANE_TOOL_PATH=
953 + OLD_ICONV=
954 + NO_EXTERNAL_GREP=
955 + )
956 +
957 + # For svn-fe
958 + extlibs="-lz -lssl ${S}/xdiff/lib.a $(usex threads -lpthread '')"
959 +
960 + # can't define this to null, since the entire makefile depends on it
961 + sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile || die
962 +
963 + if use pcre; then
964 + if use pcre-jit; then
965 + myopts+=( USE_LIBPCRE2=YesPlease )
966 + extlibs+=" -lpcre2-8"
967 + else
968 + myopts+=(
969 + USE_LIBPCRE1=YesPlease
970 + NO_LIBPCRE1_JIT=YesPlease
971 + )
972 + extlibs+=" -lpcre"
973 + fi
974 + fi
975 +# Disabled until ~m68k-mint can be keyworded again
976 +# if [[ ${CHOST} == *-mint* ]] ; then
977 +# myopts+=(
978 +# NO_MMAP=YesPlease
979 +# NO_IPV6=YesPlease
980 +# NO_STRLCPY=YesPlease
981 +# NO_MEMMEM=YesPlease
982 +# NO_MKDTEMP=YesPlease
983 +# NO_MKSTEMPS=YesPlease
984 +# )
985 +# fi
986 + if [[ ${CHOST} == ia64-*-hpux* ]]; then
987 + myopts+=( NO_NSEC=YesPlease )
988 + fi
989 + if [[ ${CHOST} == *-*-aix* ]]; then
990 + myopts+=( NO_FNMATCH_CASEFOLD=YesPlease )
991 + fi
992 + if [[ ${CHOST} == *-solaris* ]]; then
993 + myopts+=(
994 + NEEDS_LIBICONV=YesPlease
995 + HAVE_CLOCK_MONOTONIC=1
996 + )
997 + grep -q getdelim "${ROOT}"/usr/include/stdio.h && \
998 + myopts+=( HAVE_GETDELIM=1 )
999 + fi
1000 +
1001 + has_version '>=app-text/asciidoc-8.0' \
1002 + && myopts+=( ASCIIDOC8=YesPlease )
1003 +
1004 + # Bug 290465:
1005 + # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
1006 + [[ "${CHOST}" == *-uclibc* ]] && \
1007 + myopts+=( NO_NSEC=YesPlease )
1008 +
1009 + export MY_MAKEOPTS="${myopts[@]}"
1010 + export EXTLIBS="${extlibs}"
1011 +}
1012 +
1013 +src_unpack() {
1014 + if [[ ${PV} != *9999 ]]; then
1015 + unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
1016 + cd "${S}" || die
1017 + unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
1018 + if use doc ; then
1019 + pushd "${S}"/Documentation &>/dev/null || die
1020 + unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
1021 + popd &>/dev/null || die
1022 + fi
1023 + else
1024 + git-r3_src_unpack
1025 + #cp "${FILESDIR}"/GIT-VERSION-GEN .
1026 + fi
1027 +
1028 +}
1029 +
1030 +src_prepare() {
1031 + # add experimental patches to improve mediawiki support
1032 + # see patches for origin
1033 + if use mediawiki-experimental ; then
1034 + PATCHES+=(
1035 + "${FILESDIR}"/git-2.7.0-mediawiki-namespaces.patch
1036 + "${FILESDIR}"/git-2.7.0-mediawiki-subpages.patch
1037 + "${FILESDIR}"/git-2.7.0-mediawiki-500pages.patch
1038 + )
1039 + fi
1040 +
1041 + default
1042 +
1043 + sed -i \
1044 + -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
1045 + -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
1046 + -e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
1047 + -e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
1048 + -e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
1049 + -e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
1050 + Makefile contrib/svn-fe/Makefile || die
1051 +
1052 + # Fix docbook2texi command
1053 + sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
1054 + Documentation/Makefile || die
1055 +
1056 + # Fix git-subtree missing DESTDIR
1057 + sed -i \
1058 + -e '/$(INSTALL)/s/ $(libexecdir)/ $(DESTDIR)$(libexecdir)/g' \
1059 + -e '/$(INSTALL)/s/ $(man1dir)/ $(DESTDIR)$(man1dir)/g' \
1060 + contrib/subtree/Makefile || die
1061 +}
1062 +
1063 +git_emake() {
1064 + # bug #320647: PYTHON_PATH
1065 + local PYTHON_PATH=""
1066 + use python && PYTHON_PATH="${PYTHON}"
1067 + emake ${MY_MAKEOPTS} \
1068 + prefix="${EPREFIX}"/usr \
1069 + htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
1070 + perllibdir="$(perl_get_raw_vendorlib)" \
1071 + sysconfdir="${EPREFIX}"/etc \
1072 + DESTDIR="${D}" \
1073 + GIT_TEST_OPTS="--no-color" \
1074 + OPTAR="$(tc-getAR)" \
1075 + OPTCC="$(tc-getCC)" \
1076 + OPTCFLAGS="${CFLAGS}" \
1077 + OPTLDFLAGS="${LDFLAGS}" \
1078 + PERL_PATH="${EPREFIX}/usr/bin/perl" \
1079 + PERL_MM_OPT="" \
1080 + PYTHON_PATH="${PYTHON_PATH}" \
1081 + V=1 \
1082 + "$@"
1083 +}
1084 +
1085 +src_configure() {
1086 + exportmakeopts
1087 +}
1088 +
1089 +src_compile() {
1090 + git_emake || die "emake failed"
1091 +
1092 + if use emacs ; then
1093 + elisp-compile contrib/emacs/git{,-blame}.el
1094 + fi
1095 +
1096 + if use perl && use cgi ; then
1097 + git_emake \
1098 + gitweb \
1099 + || die "emake gitweb (cgi) failed"
1100 + fi
1101 +
1102 + if [[ ${CHOST} == *-darwin* ]]; then
1103 + pushd contrib/credential/osxkeychain &>/dev/null || die
1104 + git_emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" \
1105 + || die "emake credential-osxkeychain"
1106 + popd &>/dev/null || die
1107 + fi
1108 +
1109 + pushd Documentation &>/dev/null || die
1110 + if [[ ${PV} == *9999 ]] ; then
1111 + git_emake man \
1112 + || die "emake man failed"
1113 + if use doc ; then
1114 + git_emake info html \
1115 + || die "emake info html failed"
1116 + fi
1117 + else
1118 + if use doc ; then
1119 + git_emake info \
1120 + || die "emake info html failed"
1121 + fi
1122 + fi
1123 + popd &>/dev/null || die
1124 +
1125 + if use subversion ; then
1126 + pushd contrib/svn-fe &>/dev/null || die
1127 + # by defining EXTLIBS we override the detection for libintl and
1128 + # libiconv, bug #516168
1129 + local nlsiconv=
1130 + use nls && use !elibc_glibc && nlsiconv+=" -lintl"
1131 + use iconv && use !elibc_glibc && nlsiconv+=" -liconv"
1132 + git_emake EXTLIBS="${EXTLIBS} ${nlsiconv}" || die "emake svn-fe failed"
1133 + if use doc ; then
1134 + git_emake svn-fe.{1,html} || die "emake svn-fe.1 svn-fe.html failed"
1135 + fi
1136 + popd &>/dev/null || die
1137 + fi
1138 +
1139 + if use gnome-keyring ; then
1140 + pushd contrib/credential/libsecret &>/dev/null || die
1141 + git_emake || die "emake git-credential-libsecret failed"
1142 + popd &>/dev/null || die
1143 + fi
1144 +
1145 + pushd contrib/subtree &>/dev/null || die
1146 + git_emake
1147 + use doc && git_emake doc
1148 + popd &>/dev/null || die
1149 +
1150 + pushd contrib/diff-highlight &>/dev/null || die
1151 + git_emake
1152 + popd &>/dev/null || die
1153 +
1154 + if use mediawiki ; then
1155 + pushd contrib/mw-to-git &>/dev/null || die
1156 + git_emake
1157 + popd &>/dev/null || die
1158 +
1159 + fi
1160 +}
1161 +
1162 +src_install() {
1163 + git_emake \
1164 + install || \
1165 + die "make install failed"
1166 +
1167 + if [[ ${CHOST} == *-darwin* ]]; then
1168 + dobin contrib/credential/osxkeychain/git-credential-osxkeychain
1169 + fi
1170 +
1171 + # Depending on the tarball and manual rebuild of the documentation, the
1172 + # manpages may exist in either OR both of these directories.
1173 + find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
1174 + find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
1175 + dodoc README* Documentation/{SubmittingPatches,CodingGuidelines}
1176 + use doc && dodir /usr/share/doc/${PF}/html
1177 + for d in / /howto/ /technical/ ; do
1178 + docinto ${d}
1179 + dodoc Documentation${d}*.txt
1180 + if use doc ; then
1181 + docinto ${d}/html
1182 + dodoc Documentation${d}*.html
1183 + fi
1184 + done
1185 + docinto /
1186 + # Upstream does not ship this pre-built :-(
1187 + use doc && doinfo Documentation/{git,gitman}.info
1188 +
1189 + newbashcomp contrib/completion/git-completion.bash ${PN}
1190 + bashcomp_alias git gitk
1191 + # Not really a bash-completion file (bug #477920)
1192 + # but still needed uncompressed (bug #507480)
1193 + insinto /usr/share/${PN}
1194 + doins contrib/completion/git-prompt.sh
1195 +
1196 + if use emacs ; then
1197 + elisp-install ${PN} contrib/emacs/git.{el,elc}
1198 + elisp-install ${PN} contrib/emacs/git-blame.{el,elc}
1199 + #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc}
1200 + # don't add automatically to the load-path, so the sitefile
1201 + # can do a conditional loading
1202 + touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
1203 + elisp-site-file-install "${FILESDIR}"/${SITEFILE}
1204 + fi
1205 +
1206 + #dobin contrib/fast-import/git-p4 # Moved upstream
1207 + #dodoc contrib/fast-import/git-p4.txt # Moved upstream
1208 + newbin contrib/fast-import/import-tars.perl import-tars
1209 + exeinto /usr/libexec/git-core/
1210 + newexe contrib/git-resurrect.sh git-resurrect
1211 +
1212 + # git-subtree
1213 + pushd contrib/subtree &>/dev/null || die
1214 + git_emake install || die "Failed to emake install git-subtree"
1215 + if use doc ; then
1216 + git_emake install-man install-doc || die "Failed to emake install-doc install-mangit-subtree"
1217 + fi
1218 + newdoc README README.git-subtree
1219 + dodoc git-subtree.txt
1220 + popd &>/dev/null || die
1221 +
1222 + if use mediawiki ; then
1223 + pushd contrib/mw-to-git &>/dev/null || die
1224 + git_emake install
1225 + popd &>/dev/null || die
1226 + fi
1227 +
1228 + # diff-highlight
1229 + dobin contrib/diff-highlight/diff-highlight
1230 + newdoc contrib/diff-highlight/README README.diff-highlight
1231 +
1232 + # git-jump
1233 + exeinto /usr/libexec/git-core/
1234 + doexe contrib/git-jump/git-jump
1235 + newdoc contrib/git-jump/README git-jump.txt
1236 +
1237 + # git-contacts
1238 + exeinto /usr/libexec/git-core/
1239 + doexe contrib/contacts/git-contacts
1240 + dodoc contrib/contacts/git-contacts.txt
1241 +
1242 + if use gnome-keyring ; then
1243 + pushd contrib/credential/libsecret &>/dev/null || die
1244 + dobin git-credential-libsecret
1245 + popd &>/dev/null || die
1246 + fi
1247 +
1248 + if use subversion ; then
1249 + pushd contrib/svn-fe &>/dev/null || die
1250 + dobin svn-fe
1251 + dodoc svn-fe.txt
1252 + if use doc ; then
1253 + doman svn-fe.1
1254 + docinto html
1255 + dodoc svn-fe.html
1256 + fi
1257 + popd &>/dev/null || die
1258 + fi
1259 +
1260 + dodir /usr/share/${PN}/contrib
1261 + # The following are excluded:
1262 + # completion - installed above
1263 + # diff-highlight - done above
1264 + # emacs - installed above
1265 + # examples - these are stuff that is not used in Git anymore actually
1266 + # git-jump - done above
1267 + # gitview - installed above
1268 + # p4import - excluded because fast-import has a better one
1269 + # patches - stuff the Git guys made to go upstream to other places
1270 + # persistent-https - TODO
1271 + # mw-to-git - TODO
1272 + # subtree - build seperately
1273 + # svnimport - use git-svn
1274 + # thunderbird-patch-inline - fixes thunderbird
1275 + local contrib_objects=(
1276 + buildsystems
1277 + fast-import
1278 + hg-to-git
1279 + hooks
1280 + remotes2config.sh
1281 + rerere-train.sh
1282 + stats
1283 + workdir
1284 + )
1285 + for i in "${contrib_objects[@]}" ; do
1286 + cp -rf \
1287 + "${S}"/contrib/${i} \
1288 + "${ED%/}"/usr/share/${PN}/contrib \
1289 + || die "Failed contrib ${i}"
1290 + done
1291 +
1292 + if use perl && use cgi ; then
1293 + # We used to install in /usr/share/${PN}/gitweb
1294 + # but upstream installs in /usr/share/gitweb
1295 + # so we will install a symlink and use their location for compat with other
1296 + # distros
1297 + dosym /usr/share/gitweb /usr/share/${PN}/gitweb
1298 +
1299 + # INSTALL discusses configuration issues, not just installation
1300 + docinto /
1301 + newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
1302 + newdoc "${S}"/gitweb/README README.gitweb
1303 +
1304 + for d in "${ED%/}"/usr/lib{,64}/perl5/ ; do
1305 + if test -d "$d" ; then find "$d" \
1306 + -name .packlist \
1307 + -delete || die
1308 + fi
1309 + done
1310 + else
1311 + rm -rf "${ED%/}"/usr/share/gitweb
1312 + fi
1313 +
1314 + if ! use subversion ; then
1315 + rm -f "${ED%/}"/usr/libexec/git-core/git-svn \
1316 + "${ED%/}"/usr/share/man/man1/git-svn.1*
1317 + fi
1318 +
1319 + if use xinetd ; then
1320 + insinto /etc/xinetd.d
1321 + newins "${FILESDIR}"/git-daemon.xinetd git-daemon
1322 + fi
1323 +
1324 + if use !prefix ; then
1325 + newinitd "${FILESDIR}"/git-daemon-r1.initd git-daemon
1326 + newconfd "${FILESDIR}"/git-daemon.confd git-daemon
1327 + systemd_newunit "${FILESDIR}/git-daemon_at-r1.service" "git-daemon@.service"
1328 + systemd_dounit "${FILESDIR}/git-daemon.socket"
1329 + fi
1330 +
1331 + perl_delete_localpod
1332 +
1333 + # Remove disabled linguas
1334 + # we could remove sources in src_prepare, but install does not
1335 + # handle missing locale dir well
1336 + rm_loc() {
1337 + if [[ -e "${ED%/}/usr/share/locale/${1}" ]]; then
1338 + rm -r "${ED%/}/usr/share/locale/${1}" || die
1339 + fi
1340 + }
1341 + l10n_for_each_disabled_locale_do rm_loc
1342 +}
1343 +
1344 +src_test() {
1345 + local disabled=()
1346 + local tests_cvs=(
1347 + t9200-git-cvsexportcommit.sh
1348 + t9400-git-cvsserver-server.sh
1349 + t9401-git-cvsserver-crlf.sh
1350 + t9402-git-cvsserver-refs.sh
1351 + t9600-cvsimport.sh
1352 + t9601-cvsimport-vendor-branch.sh
1353 + t9602-cvsimport-branches-tags.sh
1354 + t9603-cvsimport-patchsets.sh
1355 + t9604-cvsimport-timestamps.sh
1356 + )
1357 + local tests_perl=(
1358 + t3701-add-interactive.sh
1359 + t5502-quickfetch.sh
1360 + t5512-ls-remote.sh
1361 + t5520-pull.sh
1362 + t7106-reset-unborn-branch.sh
1363 + t7501-commit.sh
1364 + )
1365 + # Bug #225601 - t0004 is not suitable for root perm
1366 + # Bug #219839 - t1004 is not suitable for root perm
1367 + # t0001-init.sh - check for init notices EPERM* fails
1368 + local tests_nonroot=(
1369 + t0001-init.sh
1370 + t0004-unwritable.sh
1371 + t0070-fundamental.sh
1372 + t1004-read-tree-m-u-wf.sh
1373 + t3700-add.sh
1374 + t7300-clean.sh
1375 + )
1376 + # t9100 still fails with symlinks in SVN 1.7
1377 + local test_svn=( t9100-git-svn-basic.sh )
1378 +
1379 + # Unzip is used only for the testcase code, not by any normal parts of Git.
1380 + if ! has_version app-arch/unzip ; then
1381 + einfo "Disabling tar-tree tests"
1382 + disabled+=( t5000-tar-tree.sh )
1383 + fi
1384 +
1385 + local cvs=0
1386 + use cvs && let cvs=${cvs}+1
1387 + if [[ ${EUID} -eq 0 ]]; then
1388 + if [[ ${cvs} -eq 1 ]]; then
1389 + ewarn "Skipping CVS tests because CVS does not work as root!"
1390 + ewarn "You should retest with FEATURES=userpriv!"
1391 + disabled+=( ${tests_cvs[@]} )
1392 + fi
1393 + einfo "Skipping other tests that require being non-root"
1394 + disabled+=( ${tests_nonroot[@]} )
1395 + else
1396 + [[ ${cvs} -gt 0 ]] && \
1397 + has_version dev-vcs/cvs && \
1398 + let cvs=${cvs}+1
1399 + [[ ${cvs} -gt 1 ]] && \
1400 + has_version "dev-vcs/cvs[server]" && \
1401 + let cvs=${cvs}+1
1402 + if [[ ${cvs} -lt 3 ]]; then
1403 + einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
1404 + disabled+=( ${tests_cvs[@]} )
1405 + fi
1406 + fi
1407 +
1408 + if ! use perl ; then
1409 + einfo "Disabling tests that need Perl"
1410 + disabled+=( ${tests_perl[@]} )
1411 + fi
1412 +
1413 + einfo "Disabling tests that fail with SVN 1.7"
1414 + disabled+=( ${test_svn[@]} )
1415 +
1416 + # Reset all previously disabled tests
1417 + pushd t &>/dev/null || die
1418 + local i
1419 + for i in *.sh.DISABLED ; do
1420 + [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
1421 + done
1422 + einfo "Disabled tests:"
1423 + for i in ${disabled[@]} ; do
1424 + [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled ${i}"
1425 + done
1426 +
1427 + # Avoid the test system removing the results because we want them ourselves
1428 + sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
1429 + -i Makefile || die
1430 +
1431 + # Clean old results first, must always run
1432 + nonfatal git_emake clean
1433 + popd &>/dev/null || die
1434 +
1435 + # Now run the tests, keep going if we hit an error, and don't terminate on
1436 + # failure
1437 + local rc
1438 + einfo "Start test run"
1439 + #MAKEOPTS=-j1
1440 + nonfatal git_emake --keep-going test
1441 + rc=$?
1442 +
1443 + # Display nice results, now print the results
1444 + pushd t &>/dev/null || die
1445 + nonfatal git_emake aggregate-results
1446 +
1447 + # And bail if there was a problem
1448 + [ ${rc} -eq 0 ] || die "tests failed. Please file a bug."
1449 +}
1450 +
1451 +showpkgdeps() {
1452 + local pkg=$1
1453 + shift
1454 + elog " $(printf "%-17s:" ${pkg}) ${@}"
1455 +}
1456 +
1457 +pkg_postinst() {
1458 + use emacs && elisp-site-regen
1459 + elog "Please read /usr/share/bash-completion/git for Git bash command completion"
1460 + elog "Please read /usr/share/git/git-prompt.sh for Git bash prompt"
1461 + elog "Note that the prompt bash code is now in that separate script"
1462 + elog "These additional scripts need some dependencies:"
1463 + echo
1464 + showpkgdeps git-quiltimport "dev-util/quilt"
1465 + showpkgdeps git-instaweb \
1466 + "|| ( www-servers/lighttpd www-servers/apache www-servers/nginx )"
1467 + echo
1468 + use mediawiki-experimental && ewarn "Using experimental git-mediawiki patches. The stability of cloned wiki filesystems is not guaranteed."
1469 +}
1470 +
1471 +pkg_postrm() {
1472 + use emacs && elisp-site-regen
1473 +}
1474
1475 diff --git a/dev-vcs/git/git-2.19.1.ebuild b/dev-vcs/git/git-2.19.1.ebuild
1476 new file mode 100644
1477 index 00000000000..f26b6776b94
1478 --- /dev/null
1479 +++ b/dev-vcs/git/git-2.19.1.ebuild
1480 @@ -0,0 +1,706 @@
1481 +# Copyright 1999-2018 Gentoo Foundation
1482 +# Distributed under the terms of the GNU General Public License v2
1483 +
1484 +EAPI=6
1485 +
1486 +GENTOO_DEPEND_ON_PERL=no
1487 +
1488 +# bug #329479: git-remote-testgit is not multiple-version aware
1489 +PYTHON_COMPAT=( python2_7 )
1490 +PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
1491 +if [[ ${PV} == *9999 ]]; then
1492 + SCM="git-r3"
1493 + EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
1494 + # Please ensure that all _four_ 9999 ebuilds get updated; they track the 4 upstream branches.
1495 + # See https://git-scm.com/docs/gitworkflows#_graduation
1496 + # In order of stability:
1497 + # 9999-r0: maint
1498 + # 9999-r1: master
1499 + # 9999-r2: next
1500 + # 9999-r3: pu
1501 + case "${PVR}" in
1502 + 9999) EGIT_BRANCH=maint ;;
1503 + 9999-r1) EGIT_BRANCH=master ;;
1504 + 9999-r2) EGIT_BRANCH=next;;
1505 + 9999-r3) EGIT_BRANCH=pu ;;
1506 + esac
1507 +fi
1508 +
1509 +inherit toolchain-funcs eutils elisp-common l10n perl-module bash-completion-r1 python-single-r1 systemd ${SCM}
1510 +
1511 +MY_PV="${PV/_rc/.rc}"
1512 +MY_P="${PN}-${MY_PV}"
1513 +
1514 +DOC_VER=${MY_PV}
1515 +
1516 +DESCRIPTION="stupid content tracker: distributed VCS designed for speed and efficiency"
1517 +HOMEPAGE="https://www.git-scm.com/"
1518 +if [[ ${PV} != *9999 ]]; then
1519 + SRC_URI_SUFFIX="xz"
1520 + SRC_URI_KORG="mirror://kernel/software/scm/git"
1521 + [[ "${PV/rc}" != "${PV}" ]] && SRC_URI_KORG+='/testing'
1522 + SRC_URI="${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
1523 + ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
1524 + doc? (
1525 + ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
1526 + )"
1527 + [[ "${PV}" = *_rc* ]] || \
1528 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1529 +fi
1530 +
1531 +LICENSE="GPL-2"
1532 +SLOT="0"
1533 +IUSE="+blksha1 +curl cgi doc emacs gnome-keyring +gpg highlight +iconv libressl mediawiki mediawiki-experimental +nls +pcre +pcre-jit +perl +python ppcsha1 tk +threads +webdav xinetd cvs subversion test"
1534 +
1535 +# Common to both DEPEND and RDEPEND
1536 +CDEPEND="
1537 + gnome-keyring? ( app-crypt/libsecret )
1538 + !libressl? ( dev-libs/openssl:0= )
1539 + libressl? ( dev-libs/libressl:= )
1540 + sys-libs/zlib
1541 + pcre? (
1542 + pcre-jit? ( dev-libs/libpcre2[jit(+)] )
1543 + !pcre-jit? ( dev-libs/libpcre )
1544 + )
1545 + perl? ( dev-lang/perl:=[-build(-)] )
1546 + tk? ( dev-lang/tk:0= )
1547 + curl? (
1548 + net-misc/curl
1549 + webdav? ( dev-libs/expat )
1550 + )
1551 + emacs? ( virtual/emacs )
1552 +"
1553 +
1554 +RDEPEND="${CDEPEND}
1555 + gpg? ( app-crypt/gnupg )
1556 + perl? (
1557 + dev-perl/Error
1558 + dev-perl/MailTools
1559 + dev-perl/Net-SMTP-SSL
1560 + dev-perl/Authen-SASL
1561 + cgi? (
1562 + dev-perl/CGI
1563 + highlight? ( app-text/highlight )
1564 + )
1565 + cvs? (
1566 + >=dev-vcs/cvsps-2.1:0
1567 + dev-perl/DBI
1568 + dev-perl/DBD-SQLite
1569 + )
1570 + mediawiki? (
1571 + dev-perl/DateTime-Format-ISO8601
1572 + dev-perl/HTML-Tree
1573 + dev-perl/MediaWiki-API
1574 + )
1575 + subversion? (
1576 + dev-vcs/subversion[-dso,perl]
1577 + dev-perl/libwww-perl
1578 + dev-perl/TermReadKey
1579 + )
1580 + )
1581 + python? ( ${PYTHON_DEPS} )
1582 +"
1583 +
1584 +# This is how info docs are created with Git:
1585 +# .txt/asciidoc --(asciidoc)---------> .xml/docbook
1586 +# .xml/docbook --(docbook2texi.pl)--> .texi
1587 +# .texi --(makeinfo)---------> .info
1588 +DEPEND="${CDEPEND}
1589 + doc? (
1590 + app-text/asciidoc
1591 + app-text/docbook2X
1592 + sys-apps/texinfo
1593 + app-text/xmlto
1594 + )
1595 + nls? ( sys-devel/gettext )
1596 + test? ( app-crypt/gnupg )"
1597 +
1598 +# Live ebuild builds man pages and HTML docs, additionally
1599 +if [[ ${PV} == *9999 ]]; then
1600 + DEPEND="${DEPEND}
1601 + app-text/asciidoc"
1602 +fi
1603 +
1604 +SITEFILE="50${PN}-gentoo.el"
1605 +S="${WORKDIR}/${MY_P}"
1606 +
1607 +REQUIRED_USE="
1608 + cgi? ( perl )
1609 + cvs? ( perl )
1610 + mediawiki? ( perl )
1611 + mediawiki-experimental? ( mediawiki )
1612 + subversion? ( perl )
1613 + webdav? ( curl )
1614 + pcre-jit? ( pcre )
1615 + python? ( ${PYTHON_REQUIRED_USE} )
1616 +"
1617 +
1618 +PATCHES=(
1619 + # bug #350330 - automagic CVS when we don't want it is bad.
1620 + "${FILESDIR}"/git-2.18.0_rc1-optional-cvs.patch
1621 +
1622 + "${FILESDIR}"/git-2.2.0-svn-fe-linking.patch
1623 +)
1624 +
1625 +pkg_setup() {
1626 + if use subversion && has_version "dev-vcs/subversion[dso]"; then
1627 + ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
1628 + ewarn "with USE=dso, there may be weird crashes in git-svn. You"
1629 + ewarn "have been warned."
1630 + fi
1631 + if use python ; then
1632 + python-single-r1_pkg_setup
1633 + fi
1634 +}
1635 +
1636 +# This is needed because for some obscure reasons future calls to make don't
1637 +# pick up these exports if we export them in src_unpack()
1638 +exportmakeopts() {
1639 + local myopts=(
1640 + ASCIIDOC_NO_ROFF=YesPlease
1641 + $(usex cvs '' NO_CVS=YesPlease)
1642 + $(usex elibc_musl NO_REGEX=YesPlease '')
1643 + $(usex iconv '' NO_ICONV=YesPlease)
1644 + $(usex nls '' NO_GETTEXT=YesPlease)
1645 + $(usex perl 'INSTALLDIRS=vendor NO_PERL_CPAN_FALLBACKS=YesPlease' NO_PERL=YesPlease)
1646 + $(usex python '' NO_PYTHON=YesPlease)
1647 + $(usex subversion '' NO_SVN_TESTS=YesPlease)
1648 + $(usex threads THREADED_DELTA_SEARCH=YesPlease NO_PTHREAD=YesPlease)
1649 + $(usex tk '' NO_TCLTK=YesPlease)
1650 + )
1651 +
1652 + if use blksha1 ; then
1653 + myopts+=( BLK_SHA1=YesPlease )
1654 + elif use ppcsha1 ; then
1655 + myopts+=( PPC_SHA1=YesPlease )
1656 + fi
1657 +
1658 + if use curl ; then
1659 + use webdav || myopts+=( NO_EXPAT=YesPlease )
1660 + else
1661 + myopts+=( NO_CURL=YesPlease )
1662 + fi
1663 +
1664 + # broken assumptions, because of static build system ...
1665 + myopts+=(
1666 + NO_FINK=YesPlease
1667 + NO_DARWIN_PORTS=YesPlease
1668 + INSTALL=install
1669 + TAR=tar
1670 + SHELL_PATH="${EPREFIX}/bin/sh"
1671 + SANE_TOOL_PATH=
1672 + OLD_ICONV=
1673 + NO_EXTERNAL_GREP=
1674 + )
1675 +
1676 + # For svn-fe
1677 + extlibs="-lz -lssl ${S}/xdiff/lib.a $(usex threads -lpthread '')"
1678 +
1679 + # can't define this to null, since the entire makefile depends on it
1680 + sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile || die
1681 +
1682 + if use pcre; then
1683 + if use pcre-jit; then
1684 + myopts+=( USE_LIBPCRE2=YesPlease )
1685 + extlibs+=" -lpcre2-8"
1686 + else
1687 + myopts+=(
1688 + USE_LIBPCRE1=YesPlease
1689 + NO_LIBPCRE1_JIT=YesPlease
1690 + )
1691 + extlibs+=" -lpcre"
1692 + fi
1693 + fi
1694 +# Disabled until ~m68k-mint can be keyworded again
1695 +# if [[ ${CHOST} == *-mint* ]] ; then
1696 +# myopts+=(
1697 +# NO_MMAP=YesPlease
1698 +# NO_IPV6=YesPlease
1699 +# NO_STRLCPY=YesPlease
1700 +# NO_MEMMEM=YesPlease
1701 +# NO_MKDTEMP=YesPlease
1702 +# NO_MKSTEMPS=YesPlease
1703 +# )
1704 +# fi
1705 + if [[ ${CHOST} == ia64-*-hpux* ]]; then
1706 + myopts+=( NO_NSEC=YesPlease )
1707 + fi
1708 + if [[ ${CHOST} == *-*-aix* ]]; then
1709 + myopts+=( NO_FNMATCH_CASEFOLD=YesPlease )
1710 + fi
1711 + if [[ ${CHOST} == *-solaris* ]]; then
1712 + myopts+=(
1713 + NEEDS_LIBICONV=YesPlease
1714 + HAVE_CLOCK_MONOTONIC=1
1715 + )
1716 + grep -q getdelim "${ROOT}"/usr/include/stdio.h && \
1717 + myopts+=( HAVE_GETDELIM=1 )
1718 + fi
1719 +
1720 + has_version '>=app-text/asciidoc-8.0' \
1721 + && myopts+=( ASCIIDOC8=YesPlease )
1722 +
1723 + # Bug 290465:
1724 + # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
1725 + [[ "${CHOST}" == *-uclibc* ]] && \
1726 + myopts+=( NO_NSEC=YesPlease )
1727 +
1728 + export MY_MAKEOPTS="${myopts[@]}"
1729 + export EXTLIBS="${extlibs}"
1730 +}
1731 +
1732 +src_unpack() {
1733 + if [[ ${PV} != *9999 ]]; then
1734 + unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
1735 + cd "${S}" || die
1736 + unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
1737 + if use doc ; then
1738 + pushd "${S}"/Documentation &>/dev/null || die
1739 + unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
1740 + popd &>/dev/null || die
1741 + fi
1742 + else
1743 + git-r3_src_unpack
1744 + #cp "${FILESDIR}"/GIT-VERSION-GEN .
1745 + fi
1746 +
1747 +}
1748 +
1749 +src_prepare() {
1750 + # add experimental patches to improve mediawiki support
1751 + # see patches for origin
1752 + if use mediawiki-experimental ; then
1753 + PATCHES+=(
1754 + "${FILESDIR}"/git-2.7.0-mediawiki-namespaces.patch
1755 + "${FILESDIR}"/git-2.7.0-mediawiki-subpages.patch
1756 + "${FILESDIR}"/git-2.7.0-mediawiki-500pages.patch
1757 + )
1758 + fi
1759 +
1760 + default
1761 +
1762 + sed -i \
1763 + -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
1764 + -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
1765 + -e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
1766 + -e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
1767 + -e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
1768 + -e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
1769 + Makefile contrib/svn-fe/Makefile || die
1770 +
1771 + # Fix docbook2texi command
1772 + sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
1773 + Documentation/Makefile || die
1774 +}
1775 +
1776 +git_emake() {
1777 + # bug #320647: PYTHON_PATH
1778 + local PYTHON_PATH=""
1779 + use python && PYTHON_PATH="${PYTHON}"
1780 + emake ${MY_MAKEOPTS} \
1781 + prefix="${EPREFIX}"/usr \
1782 + htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
1783 + perllibdir="$(perl_get_raw_vendorlib)" \
1784 + sysconfdir="${EPREFIX}"/etc \
1785 + DESTDIR="${D}" \
1786 + GIT_TEST_OPTS="--no-color" \
1787 + OPTAR="$(tc-getAR)" \
1788 + OPTCC="$(tc-getCC)" \
1789 + OPTCFLAGS="${CFLAGS}" \
1790 + OPTLDFLAGS="${LDFLAGS}" \
1791 + PERL_PATH="${EPREFIX}/usr/bin/perl" \
1792 + PERL_MM_OPT="" \
1793 + PYTHON_PATH="${PYTHON_PATH}" \
1794 + V=1 \
1795 + "$@"
1796 +}
1797 +
1798 +src_configure() {
1799 + exportmakeopts
1800 +}
1801 +
1802 +src_compile() {
1803 + git_emake || die "emake failed"
1804 +
1805 + if use emacs ; then
1806 + elisp-compile contrib/emacs/git{,-blame}.el
1807 + fi
1808 +
1809 + if use perl && use cgi ; then
1810 + git_emake \
1811 + gitweb \
1812 + || die "emake gitweb (cgi) failed"
1813 + fi
1814 +
1815 + if [[ ${CHOST} == *-darwin* ]]; then
1816 + pushd contrib/credential/osxkeychain &>/dev/null || die
1817 + git_emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" \
1818 + || die "emake credential-osxkeychain"
1819 + popd &>/dev/null || die
1820 + fi
1821 +
1822 + pushd Documentation &>/dev/null || die
1823 + if [[ ${PV} == *9999 ]] ; then
1824 + git_emake man \
1825 + || die "emake man failed"
1826 + if use doc ; then
1827 + git_emake info html \
1828 + || die "emake info html failed"
1829 + fi
1830 + else
1831 + if use doc ; then
1832 + git_emake info \
1833 + || die "emake info html failed"
1834 + fi
1835 + fi
1836 + popd &>/dev/null || die
1837 +
1838 + if use subversion ; then
1839 + pushd contrib/svn-fe &>/dev/null || die
1840 + # by defining EXTLIBS we override the detection for libintl and
1841 + # libiconv, bug #516168
1842 + local nlsiconv=
1843 + use nls && use !elibc_glibc && nlsiconv+=" -lintl"
1844 + use iconv && use !elibc_glibc && nlsiconv+=" -liconv"
1845 + git_emake EXTLIBS="${EXTLIBS} ${nlsiconv}" || die "emake svn-fe failed"
1846 + if use doc ; then
1847 + git_emake svn-fe.{1,html} || die "emake svn-fe.1 svn-fe.html failed"
1848 + fi
1849 + popd &>/dev/null || die
1850 + fi
1851 +
1852 + if use gnome-keyring ; then
1853 + pushd contrib/credential/libsecret &>/dev/null || die
1854 + git_emake || die "emake git-credential-libsecret failed"
1855 + popd &>/dev/null || die
1856 + fi
1857 +
1858 + pushd contrib/subtree &>/dev/null || die
1859 + git_emake
1860 + use doc && git_emake doc
1861 + popd &>/dev/null || die
1862 +
1863 + pushd contrib/diff-highlight &>/dev/null || die
1864 + git_emake
1865 + popd &>/dev/null || die
1866 +
1867 + if use mediawiki ; then
1868 + pushd contrib/mw-to-git &>/dev/null || die
1869 + git_emake
1870 + popd &>/dev/null || die
1871 +
1872 + fi
1873 +}
1874 +
1875 +src_install() {
1876 + git_emake \
1877 + install || \
1878 + die "make install failed"
1879 +
1880 + if [[ ${CHOST} == *-darwin* ]]; then
1881 + dobin contrib/credential/osxkeychain/git-credential-osxkeychain
1882 + fi
1883 +
1884 + # Depending on the tarball and manual rebuild of the documentation, the
1885 + # manpages may exist in either OR both of these directories.
1886 + find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
1887 + find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
1888 + dodoc README* Documentation/{SubmittingPatches,CodingGuidelines}
1889 + use doc && dodir /usr/share/doc/${PF}/html
1890 + for d in / /howto/ /technical/ ; do
1891 + docinto ${d}
1892 + dodoc Documentation${d}*.txt
1893 + if use doc ; then
1894 + docinto ${d}/html
1895 + dodoc Documentation${d}*.html
1896 + fi
1897 + done
1898 + docinto /
1899 + # Upstream does not ship this pre-built :-(
1900 + use doc && doinfo Documentation/{git,gitman}.info
1901 +
1902 + newbashcomp contrib/completion/git-completion.bash ${PN}
1903 + bashcomp_alias git gitk
1904 + # Not really a bash-completion file (bug #477920)
1905 + # but still needed uncompressed (bug #507480)
1906 + insinto /usr/share/${PN}
1907 + doins contrib/completion/git-prompt.sh
1908 +
1909 + if use emacs ; then
1910 + elisp-install ${PN} contrib/emacs/git.{el,elc}
1911 + elisp-install ${PN} contrib/emacs/git-blame.{el,elc}
1912 + #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc}
1913 + # don't add automatically to the load-path, so the sitefile
1914 + # can do a conditional loading
1915 + touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
1916 + elisp-site-file-install "${FILESDIR}"/${SITEFILE}
1917 + fi
1918 +
1919 + #dobin contrib/fast-import/git-p4 # Moved upstream
1920 + #dodoc contrib/fast-import/git-p4.txt # Moved upstream
1921 + newbin contrib/fast-import/import-tars.perl import-tars
1922 + exeinto /usr/libexec/git-core/
1923 + newexe contrib/git-resurrect.sh git-resurrect
1924 +
1925 + # git-subtree
1926 + pushd contrib/subtree &>/dev/null || die
1927 + git_emake install || die "Failed to emake install git-subtree"
1928 + if use doc ; then
1929 + git_emake install-man install-doc || die "Failed to emake install-doc install-mangit-subtree"
1930 + fi
1931 + newdoc README README.git-subtree
1932 + dodoc git-subtree.txt
1933 + popd &>/dev/null || die
1934 +
1935 + if use mediawiki ; then
1936 + pushd contrib/mw-to-git &>/dev/null || die
1937 + git_emake install
1938 + popd &>/dev/null || die
1939 + fi
1940 +
1941 + # diff-highlight
1942 + dobin contrib/diff-highlight/diff-highlight
1943 + newdoc contrib/diff-highlight/README README.diff-highlight
1944 +
1945 + # git-jump
1946 + exeinto /usr/libexec/git-core/
1947 + doexe contrib/git-jump/git-jump
1948 + newdoc contrib/git-jump/README git-jump.txt
1949 +
1950 + # git-contacts
1951 + exeinto /usr/libexec/git-core/
1952 + doexe contrib/contacts/git-contacts
1953 + dodoc contrib/contacts/git-contacts.txt
1954 +
1955 + if use gnome-keyring ; then
1956 + pushd contrib/credential/libsecret &>/dev/null || die
1957 + dobin git-credential-libsecret
1958 + popd &>/dev/null || die
1959 + fi
1960 +
1961 + if use subversion ; then
1962 + pushd contrib/svn-fe &>/dev/null || die
1963 + dobin svn-fe
1964 + dodoc svn-fe.txt
1965 + if use doc ; then
1966 + doman svn-fe.1
1967 + docinto html
1968 + dodoc svn-fe.html
1969 + fi
1970 + popd &>/dev/null || die
1971 + fi
1972 +
1973 + dodir /usr/share/${PN}/contrib
1974 + # The following are excluded:
1975 + # completion - installed above
1976 + # diff-highlight - done above
1977 + # emacs - installed above
1978 + # examples - these are stuff that is not used in Git anymore actually
1979 + # git-jump - done above
1980 + # gitview - installed above
1981 + # p4import - excluded because fast-import has a better one
1982 + # patches - stuff the Git guys made to go upstream to other places
1983 + # persistent-https - TODO
1984 + # mw-to-git - TODO
1985 + # subtree - build seperately
1986 + # svnimport - use git-svn
1987 + # thunderbird-patch-inline - fixes thunderbird
1988 + local contrib_objects=(
1989 + buildsystems
1990 + fast-import
1991 + hg-to-git
1992 + hooks
1993 + remotes2config.sh
1994 + rerere-train.sh
1995 + stats
1996 + workdir
1997 + )
1998 + for i in "${contrib_objects[@]}" ; do
1999 + cp -rf \
2000 + "${S}"/contrib/${i} \
2001 + "${ED%/}"/usr/share/${PN}/contrib \
2002 + || die "Failed contrib ${i}"
2003 + done
2004 +
2005 + if use perl && use cgi ; then
2006 + # We used to install in /usr/share/${PN}/gitweb
2007 + # but upstream installs in /usr/share/gitweb
2008 + # so we will install a symlink and use their location for compat with other
2009 + # distros
2010 + dosym /usr/share/gitweb /usr/share/${PN}/gitweb
2011 +
2012 + # INSTALL discusses configuration issues, not just installation
2013 + docinto /
2014 + newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
2015 + newdoc "${S}"/gitweb/README README.gitweb
2016 +
2017 + for d in "${ED%/}"/usr/lib{,64}/perl5/ ; do
2018 + if test -d "$d" ; then find "$d" \
2019 + -name .packlist \
2020 + -delete || die
2021 + fi
2022 + done
2023 + else
2024 + rm -rf "${ED%/}"/usr/share/gitweb
2025 + fi
2026 +
2027 + if ! use subversion ; then
2028 + rm -f "${ED%/}"/usr/libexec/git-core/git-svn \
2029 + "${ED%/}"/usr/share/man/man1/git-svn.1*
2030 + fi
2031 +
2032 + if use xinetd ; then
2033 + insinto /etc/xinetd.d
2034 + newins "${FILESDIR}"/git-daemon.xinetd git-daemon
2035 + fi
2036 +
2037 + if use !prefix ; then
2038 + newinitd "${FILESDIR}"/git-daemon-r1.initd git-daemon
2039 + newconfd "${FILESDIR}"/git-daemon.confd git-daemon
2040 + systemd_newunit "${FILESDIR}/git-daemon_at-r1.service" "git-daemon@.service"
2041 + systemd_dounit "${FILESDIR}/git-daemon.socket"
2042 + fi
2043 +
2044 + perl_delete_localpod
2045 +
2046 + # Remove disabled linguas
2047 + # we could remove sources in src_prepare, but install does not
2048 + # handle missing locale dir well
2049 + rm_loc() {
2050 + if [[ -e "${ED%/}/usr/share/locale/${1}" ]]; then
2051 + rm -r "${ED%/}/usr/share/locale/${1}" || die
2052 + fi
2053 + }
2054 + l10n_for_each_disabled_locale_do rm_loc
2055 +}
2056 +
2057 +src_test() {
2058 + local disabled=()
2059 + local tests_cvs=(
2060 + t9200-git-cvsexportcommit.sh
2061 + t9400-git-cvsserver-server.sh
2062 + t9401-git-cvsserver-crlf.sh
2063 + t9402-git-cvsserver-refs.sh
2064 + t9600-cvsimport.sh
2065 + t9601-cvsimport-vendor-branch.sh
2066 + t9602-cvsimport-branches-tags.sh
2067 + t9603-cvsimport-patchsets.sh
2068 + t9604-cvsimport-timestamps.sh
2069 + )
2070 + local tests_perl=(
2071 + t3701-add-interactive.sh
2072 + t5502-quickfetch.sh
2073 + t5512-ls-remote.sh
2074 + t5520-pull.sh
2075 + t7106-reset-unborn-branch.sh
2076 + t7501-commit.sh
2077 + )
2078 + # Bug #225601 - t0004 is not suitable for root perm
2079 + # Bug #219839 - t1004 is not suitable for root perm
2080 + # t0001-init.sh - check for init notices EPERM* fails
2081 + local tests_nonroot=(
2082 + t0001-init.sh
2083 + t0004-unwritable.sh
2084 + t0070-fundamental.sh
2085 + t1004-read-tree-m-u-wf.sh
2086 + t3700-add.sh
2087 + t7300-clean.sh
2088 + )
2089 + # t9100 still fails with symlinks in SVN 1.7
2090 + local test_svn=( t9100-git-svn-basic.sh )
2091 +
2092 + # Unzip is used only for the testcase code, not by any normal parts of Git.
2093 + if ! has_version app-arch/unzip ; then
2094 + einfo "Disabling tar-tree tests"
2095 + disabled+=( t5000-tar-tree.sh )
2096 + fi
2097 +
2098 + local cvs=0
2099 + use cvs && let cvs=${cvs}+1
2100 + if [[ ${EUID} -eq 0 ]]; then
2101 + if [[ ${cvs} -eq 1 ]]; then
2102 + ewarn "Skipping CVS tests because CVS does not work as root!"
2103 + ewarn "You should retest with FEATURES=userpriv!"
2104 + disabled+=( ${tests_cvs[@]} )
2105 + fi
2106 + einfo "Skipping other tests that require being non-root"
2107 + disabled+=( ${tests_nonroot[@]} )
2108 + else
2109 + [[ ${cvs} -gt 0 ]] && \
2110 + has_version dev-vcs/cvs && \
2111 + let cvs=${cvs}+1
2112 + [[ ${cvs} -gt 1 ]] && \
2113 + has_version "dev-vcs/cvs[server]" && \
2114 + let cvs=${cvs}+1
2115 + if [[ ${cvs} -lt 3 ]]; then
2116 + einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
2117 + disabled+=( ${tests_cvs[@]} )
2118 + fi
2119 + fi
2120 +
2121 + if ! use perl ; then
2122 + einfo "Disabling tests that need Perl"
2123 + disabled+=( ${tests_perl[@]} )
2124 + fi
2125 +
2126 + einfo "Disabling tests that fail with SVN 1.7"
2127 + disabled+=( ${test_svn[@]} )
2128 +
2129 + # Reset all previously disabled tests
2130 + pushd t &>/dev/null || die
2131 + local i
2132 + for i in *.sh.DISABLED ; do
2133 + [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
2134 + done
2135 + einfo "Disabled tests:"
2136 + for i in ${disabled[@]} ; do
2137 + [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled ${i}"
2138 + done
2139 +
2140 + # Avoid the test system removing the results because we want them ourselves
2141 + sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
2142 + -i Makefile || die
2143 +
2144 + # Clean old results first, must always run
2145 + nonfatal git_emake clean
2146 + popd &>/dev/null || die
2147 +
2148 + # Now run the tests, keep going if we hit an error, and don't terminate on
2149 + # failure
2150 + local rc
2151 + einfo "Start test run"
2152 + #MAKEOPTS=-j1
2153 + nonfatal git_emake --keep-going test
2154 + rc=$?
2155 +
2156 + # Display nice results, now print the results
2157 + pushd t &>/dev/null || die
2158 + nonfatal git_emake aggregate-results
2159 +
2160 + # And bail if there was a problem
2161 + [ ${rc} -eq 0 ] || die "tests failed. Please file a bug."
2162 +}
2163 +
2164 +showpkgdeps() {
2165 + local pkg=$1
2166 + shift
2167 + elog " $(printf "%-17s:" ${pkg}) ${@}"
2168 +}
2169 +
2170 +pkg_postinst() {
2171 + use emacs && elisp-site-regen
2172 + elog "Please read /usr/share/bash-completion/git for Git bash command completion"
2173 + elog "Please read /usr/share/git/git-prompt.sh for Git bash prompt"
2174 + elog "Note that the prompt bash code is now in that separate script"
2175 + elog "These additional scripts need some dependencies:"
2176 + echo
2177 + showpkgdeps git-quiltimport "dev-util/quilt"
2178 + showpkgdeps git-instaweb \
2179 + "|| ( www-servers/lighttpd www-servers/apache www-servers/nginx )"
2180 + echo
2181 + use mediawiki-experimental && ewarn "Using experimental git-mediawiki patches. The stability of cloned wiki filesystems is not guaranteed."
2182 +}
2183 +
2184 +pkg_postrm() {
2185 + use emacs && elisp-site-regen
2186 +}