Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-vcs/git/
Date: Tue, 02 Apr 2019 13:25:56
Message-Id: 1554211542.233b86a44bece29adeaf5baa86208f02b1b7cf06.polynomial-c@gentoo
1 commit: 233b86a44bece29adeaf5baa86208f02b1b7cf06
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 2 13:23:34 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 2 13:25:42 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=233b86a4
7
8 dev-vcs/git: Revbump adding python3 support
9
10 Closes: https://bugs.gentoo.org/677518
11 Package-Manager: Portage-2.3.62, Repoman-2.3.12
12 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
13
14 dev-vcs/git/git-2.21.0-r1.ebuild | 711 +++++++++++++++++++++++++++++++++++++++
15 1 file changed, 711 insertions(+)
16
17 diff --git a/dev-vcs/git/git-2.21.0-r1.ebuild b/dev-vcs/git/git-2.21.0-r1.ebuild
18 new file mode 100644
19 index 00000000000..dfeadcd4118
20 --- /dev/null
21 +++ b/dev-vcs/git/git-2.21.0-r1.ebuild
22 @@ -0,0 +1,711 @@
23 +# Copyright 1999-2019 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +
28 +GENTOO_DEPEND_ON_PERL=no
29 +
30 +# bug #329479: git-remote-testgit is not multiple-version aware
31 +PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
32 +PLOCALES="bg ca de es fr is it ko pt_PT ru sv vi zh_CN"
33 +if [[ ${PV} == *9999 ]]; then
34 + SCM="git-r3"
35 + EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
36 + # Please ensure that all _four_ 9999 ebuilds get updated; they track the 4 upstream branches.
37 + # See https://git-scm.com/docs/gitworkflows#_graduation
38 + # In order of stability:
39 + # 9999-r0: maint
40 + # 9999-r1: master
41 + # 9999-r2: next
42 + # 9999-r3: pu
43 + case "${PVR}" in
44 + 9999) EGIT_BRANCH=maint ;;
45 + 9999-r1) EGIT_BRANCH=master ;;
46 + 9999-r2) EGIT_BRANCH=next;;
47 + 9999-r3) EGIT_BRANCH=pu ;;
48 + esac
49 +fi
50 +
51 +inherit toolchain-funcs elisp-common l10n perl-module bash-completion-r1 python-single-r1 systemd ${SCM}
52 +
53 +MY_PV="${PV/_rc/.rc}"
54 +MY_P="${PN}-${MY_PV}"
55 +
56 +DOC_VER="${MY_PV}"
57 +
58 +DESCRIPTION="stupid content tracker: distributed VCS designed for speed and efficiency"
59 +HOMEPAGE="https://www.git-scm.com/"
60 +if [[ ${PV} != *9999 ]]; then
61 + SRC_URI_SUFFIX="xz"
62 + SRC_URI_KORG="mirror://kernel/software/scm/git"
63 + [[ "${PV/rc}" != "${PV}" ]] && SRC_URI_KORG+='/testing'
64 + SRC_URI="${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
65 + ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
66 + doc? (
67 + ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
68 + )"
69 + [[ "${PV}" = *_rc* ]] || \
70 + 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"
71 +fi
72 +
73 +LICENSE="GPL-2"
74 +SLOT="0"
75 +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"
76 +
77 +# Common to both DEPEND and RDEPEND
78 +CDEPEND="
79 + gnome-keyring? ( app-crypt/libsecret )
80 + !libressl? ( dev-libs/openssl:0= )
81 + libressl? ( dev-libs/libressl:= )
82 + sys-libs/zlib
83 + pcre? (
84 + pcre-jit? ( dev-libs/libpcre2[jit(+)] )
85 + !pcre-jit? ( dev-libs/libpcre )
86 + )
87 + perl? ( dev-lang/perl:=[-build(-)] )
88 + tk? ( dev-lang/tk:0= )
89 + curl? (
90 + net-misc/curl
91 + webdav? ( dev-libs/expat )
92 + )
93 + emacs? ( virtual/emacs )
94 +"
95 +
96 +RDEPEND="${CDEPEND}
97 + gpg? ( app-crypt/gnupg )
98 + perl? (
99 + dev-perl/Error
100 + dev-perl/MailTools
101 + dev-perl/Net-SMTP-SSL
102 + dev-perl/Authen-SASL
103 + cgi? (
104 + dev-perl/CGI
105 + highlight? ( app-text/highlight )
106 + )
107 + cvs? (
108 + >=dev-vcs/cvsps-2.1:0
109 + dev-perl/DBI
110 + dev-perl/DBD-SQLite
111 + )
112 + mediawiki? (
113 + dev-perl/DateTime-Format-ISO8601
114 + dev-perl/HTML-Tree
115 + dev-perl/MediaWiki-API
116 + )
117 + subversion? (
118 + dev-vcs/subversion[-dso,perl]
119 + dev-perl/libwww-perl
120 + dev-perl/TermReadKey
121 + )
122 + )
123 + python? ( ${PYTHON_DEPS} )
124 +"
125 +
126 +# This is how info docs are created with Git:
127 +# .txt/asciidoc --(asciidoc)---------> .xml/docbook
128 +# .xml/docbook --(docbook2texi.pl)--> .texi
129 +# .texi --(makeinfo)---------> .info
130 +DEPEND="${CDEPEND}
131 + doc? (
132 + app-text/asciidoc
133 + app-text/docbook2X
134 + sys-apps/texinfo
135 + app-text/xmlto
136 + )
137 + nls? ( sys-devel/gettext )
138 + test? ( app-crypt/gnupg )"
139 +
140 +# Live ebuild builds man pages and HTML docs, additionally
141 +if [[ ${PV} == *9999 ]]; then
142 + DEPEND="${DEPEND}
143 + app-text/asciidoc"
144 +fi
145 +
146 +SITEFILE="50${PN}-gentoo.el"
147 +S="${WORKDIR}/${MY_P}"
148 +
149 +REQUIRED_USE="
150 + cgi? ( perl )
151 + cvs? ( perl )
152 + mediawiki? ( perl )
153 + mediawiki-experimental? ( mediawiki )
154 + subversion? ( perl )
155 + webdav? ( curl )
156 + pcre-jit? ( pcre )
157 + python? ( ${PYTHON_REQUIRED_USE} )
158 +"
159 +
160 +PATCHES=(
161 + # bug #350330 - automagic CVS when we don't want it is bad.
162 + "${FILESDIR}"/git-2.18.0_rc1-optional-cvs.patch
163 +
164 + "${FILESDIR}"/git-2.2.0-svn-fe-linking.patch
165 +)
166 +
167 +pkg_setup() {
168 + if use subversion && has_version "dev-vcs/subversion[dso]"; then
169 + ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
170 + ewarn "with USE=dso, there may be weird crashes in git-svn. You"
171 + ewarn "have been warned."
172 + fi
173 + if use python ; then
174 + python-single-r1_pkg_setup
175 + fi
176 +}
177 +
178 +# This is needed because for some obscure reasons future calls to make don't
179 +# pick up these exports if we export them in src_unpack()
180 +exportmakeopts() {
181 + local myopts=(
182 + ASCIIDOC_NO_ROFF=YesPlease
183 + $(usex cvs '' NO_CVS=YesPlease)
184 + $(usex elibc_musl NO_REGEX=YesPlease '')
185 + $(usex iconv '' NO_ICONV=YesPlease)
186 + $(usex nls '' NO_GETTEXT=YesPlease)
187 + $(usex perl 'INSTALLDIRS=vendor NO_PERL_CPAN_FALLBACKS=YesPlease' NO_PERL=YesPlease)
188 + $(usex python '' NO_PYTHON=YesPlease)
189 + $(usex subversion '' NO_SVN_TESTS=YesPlease)
190 + $(usex threads THREADED_DELTA_SEARCH=YesPlease NO_PTHREAD=YesPlease)
191 + $(usex tk '' NO_TCLTK=YesPlease)
192 + )
193 +
194 + if use blksha1 ; then
195 + myopts+=( BLK_SHA1=YesPlease )
196 + elif use ppcsha1 ; then
197 + myopts+=( PPC_SHA1=YesPlease )
198 + fi
199 +
200 + if use curl ; then
201 + use webdav || myopts+=( NO_EXPAT=YesPlease )
202 + else
203 + myopts+=( NO_CURL=YesPlease )
204 + fi
205 +
206 + # broken assumptions, because of static build system ...
207 + myopts+=(
208 + NO_FINK=YesPlease
209 + NO_DARWIN_PORTS=YesPlease
210 + INSTALL=install
211 + TAR=tar
212 + SHELL_PATH="${EPREFIX}/bin/sh"
213 + SANE_TOOL_PATH=
214 + OLD_ICONV=
215 + NO_EXTERNAL_GREP=
216 + )
217 +
218 + # For svn-fe
219 + extlibs=( -lz -lssl ${S}/xdiff/lib.a $(usex threads -lpthread '') )
220 +
221 + # can't define this to null, since the entire makefile depends on it
222 + sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile || die
223 +
224 + if use pcre; then
225 + if use pcre-jit; then
226 + myopts+=( USE_LIBPCRE2=YesPlease )
227 + extlibs+=( -lpcre2-8 )
228 + else
229 + myopts+=(
230 + USE_LIBPCRE1=YesPlease
231 + NO_LIBPCRE1_JIT=YesPlease
232 + )
233 + extlibs+=( -lpcre )
234 + fi
235 + fi
236 +# Disabled until ~m68k-mint can be keyworded again
237 +# if [[ ${CHOST} == *-mint* ]] ; then
238 +# myopts+=(
239 +# NO_MMAP=YesPlease
240 +# NO_IPV6=YesPlease
241 +# NO_STRLCPY=YesPlease
242 +# NO_MEMMEM=YesPlease
243 +# NO_MKDTEMP=YesPlease
244 +# NO_MKSTEMPS=YesPlease
245 +# )
246 +# fi
247 + if [[ ${CHOST} == ia64-*-hpux* ]]; then
248 + myopts+=( NO_NSEC=YesPlease )
249 + fi
250 + if [[ ${CHOST} == *-*-aix* ]]; then
251 + myopts+=( NO_FNMATCH_CASEFOLD=YesPlease )
252 + fi
253 + if [[ ${CHOST} == *-solaris* ]]; then
254 + myopts+=(
255 + NEEDS_LIBICONV=YesPlease
256 + HAVE_CLOCK_MONOTONIC=1
257 + )
258 + grep -q getdelim "${ROOT%/}"/usr/include/stdio.h && \
259 + myopts+=( HAVE_GETDELIM=1 )
260 + fi
261 +
262 + has_version '>=app-text/asciidoc-8.0' \
263 + && myopts+=( ASCIIDOC8=YesPlease )
264 +
265 + # Bug 290465:
266 + # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
267 + [[ "${CHOST}" == *-uclibc* ]] && \
268 + myopts+=( NO_NSEC=YesPlease )
269 +
270 + export MY_MAKEOPTS="${myopts[@]}"
271 + export EXTLIBS="${extlibs[@]}"
272 +}
273 +
274 +src_unpack() {
275 + if [[ ${PV} != *9999 ]]; then
276 + unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
277 + cd "${S}" || die
278 + unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
279 + if use doc ; then
280 + pushd "${S}"/Documentation &>/dev/null || die
281 + unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
282 + popd &>/dev/null || die
283 + fi
284 + else
285 + git-r3_src_unpack
286 + #cp "${FILESDIR}"/GIT-VERSION-GEN .
287 + fi
288 +
289 +}
290 +
291 +src_prepare() {
292 + # add experimental patches to improve mediawiki support
293 + # see patches for origin
294 + if use mediawiki-experimental ; then
295 + PATCHES+=(
296 + "${FILESDIR}"/git-2.7.0-mediawiki-namespaces.patch
297 + "${FILESDIR}"/git-2.7.0-mediawiki-subpages.patch
298 + "${FILESDIR}"/git-2.7.0-mediawiki-500pages.patch
299 + )
300 + fi
301 +
302 + default
303 +
304 + sed -i \
305 + -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
306 + -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \
307 + -e 's:^\(CC[[:space:]]* =\).*$:\1$(OPTCC):' \
308 + -e 's:^\(AR[[:space:]]* =\).*$:\1$(OPTAR):' \
309 + -e "s:\(PYTHON_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
310 + -e "s:\(PERL_PATH[[:space:]]\+=[[:space:]]\+\)\(.*\)$:\1${EPREFIX}\2:" \
311 + Makefile contrib/svn-fe/Makefile || die
312 +
313 + # Fix docbook2texi command
314 + sed -r -i 's/DOCBOOK2X_TEXI[[:space:]]*=[[:space:]]*docbook2x-texi/DOCBOOK2X_TEXI = docbook2texi.pl/' \
315 + Documentation/Makefile || die
316 +}
317 +
318 +git_emake() {
319 + # bug #320647: PYTHON_PATH
320 + local PYTHON_PATH=""
321 + use python && PYTHON_PATH="${PYTHON}"
322 + emake ${MY_MAKEOPTS} \
323 + prefix="${EPREFIX}"/usr \
324 + htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
325 + perllibdir="$(use perl && perl_get_raw_vendorlib)" \
326 + sysconfdir="${EPREFIX}"/etc \
327 + DESTDIR="${D}" \
328 + GIT_TEST_OPTS="--no-color" \
329 + OPTAR="$(tc-getAR)" \
330 + OPTCC="$(tc-getCC)" \
331 + OPTCFLAGS="${CFLAGS}" \
332 + OPTLDFLAGS="${LDFLAGS}" \
333 + PERL_PATH="${EPREFIX}/usr/bin/perl" \
334 + PERL_MM_OPT="" \
335 + PYTHON_PATH="${PYTHON_PATH}" \
336 + V=1 \
337 + "$@"
338 +}
339 +
340 +src_configure() {
341 + exportmakeopts
342 +}
343 +
344 +src_compile() {
345 + git_emake || die "emake failed"
346 +
347 + if use emacs ; then
348 + elisp-compile contrib/emacs/git{,-blame}.el
349 + fi
350 +
351 + if use perl && use cgi ; then
352 + git_emake \
353 + gitweb \
354 + || die "emake gitweb (cgi) failed"
355 + fi
356 +
357 + if [[ ${CHOST} == *-darwin* ]]; then
358 + pushd contrib/credential/osxkeychain &>/dev/null || die
359 + git_emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" \
360 + || die "emake credential-osxkeychain"
361 + popd &>/dev/null || die
362 + fi
363 +
364 + pushd Documentation &>/dev/null || die
365 + if [[ ${PV} == *9999 ]] ; then
366 + git_emake man \
367 + || die "emake man failed"
368 + if use doc ; then
369 + git_emake info html \
370 + || die "emake info html failed"
371 + fi
372 + else
373 + if use doc ; then
374 + git_emake info \
375 + || die "emake info html failed"
376 + fi
377 + fi
378 + popd &>/dev/null || die
379 +
380 + if use subversion ; then
381 + pushd contrib/svn-fe &>/dev/null || die
382 + # by defining EXTLIBS we override the detection for libintl and
383 + # libiconv, bug #516168
384 + local nlsiconv=()
385 + use nls && use !elibc_glibc && nlsiconv+=( -lintl )
386 + use iconv && use !elibc_glibc && nlsiconv+=( -liconv )
387 + git_emake EXTLIBS="${EXTLIBS} ${nlsiconv[@]}" \
388 + || die "emake svn-fe failed"
389 + if use doc ; then
390 + git_emake svn-fe.{1,html} \
391 + || die "emake svn-fe.1 svn-fe.html failed"
392 + fi
393 + popd &>/dev/null || die
394 + fi
395 +
396 + if use gnome-keyring ; then
397 + pushd contrib/credential/libsecret &>/dev/null || die
398 + git_emake || die "emake git-credential-libsecret failed"
399 + popd &>/dev/null || die
400 + fi
401 +
402 + pushd contrib/subtree &>/dev/null || die
403 + git_emake
404 + use doc && git_emake doc
405 + popd &>/dev/null || die
406 +
407 + pushd contrib/diff-highlight &>/dev/null || die
408 + git_emake
409 + popd &>/dev/null || die
410 +
411 + if use mediawiki ; then
412 + pushd contrib/mw-to-git &>/dev/null || die
413 + git_emake
414 + popd &>/dev/null || die
415 +
416 + fi
417 +}
418 +
419 +src_install() {
420 + git_emake \
421 + install || \
422 + die "make install failed"
423 +
424 + if [[ ${CHOST} == *-darwin* ]]; then
425 + dobin contrib/credential/osxkeychain/git-credential-osxkeychain
426 + fi
427 +
428 + # Depending on the tarball and manual rebuild of the documentation, the
429 + # manpages may exist in either OR both of these directories.
430 + find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
431 + find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
432 + dodoc README* Documentation/{SubmittingPatches,CodingGuidelines}
433 + use doc && dodir /usr/share/doc/${PF}/html
434 + local d
435 + for d in / /howto/ /technical/ ; do
436 + docinto ${d}
437 + dodoc Documentation${d}*.txt
438 + if use doc ; then
439 + docinto ${d}/html
440 + dodoc Documentation${d}*.html
441 + fi
442 + done
443 + docinto /
444 + # Upstream does not ship this pre-built :-(
445 + use doc && doinfo Documentation/{git,gitman}.info
446 +
447 + newbashcomp contrib/completion/git-completion.bash ${PN}
448 + bashcomp_alias git gitk
449 + # Not really a bash-completion file (bug #477920)
450 + # but still needed uncompressed (bug #507480)
451 + insinto /usr/share/${PN}
452 + doins contrib/completion/git-prompt.sh
453 +
454 + if use emacs ; then
455 + elisp-install ${PN} contrib/emacs/git.{el,elc}
456 + elisp-install ${PN} contrib/emacs/git-blame.{el,elc}
457 + #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc}
458 + # don't add automatically to the load-path, so the sitefile
459 + # can do a conditional loading
460 + touch "${ED%/}${SITELISP}/${PN}/compat/.nosearch"
461 + elisp-site-file-install "${FILESDIR}"/${SITEFILE}
462 + fi
463 +
464 + #dobin contrib/fast-import/git-p4 # Moved upstream
465 + #dodoc contrib/fast-import/git-p4.txt # Moved upstream
466 + newbin contrib/fast-import/import-tars.perl import-tars
467 + exeinto /usr/libexec/git-core/
468 + newexe contrib/git-resurrect.sh git-resurrect
469 +
470 + # git-subtree
471 + pushd contrib/subtree &>/dev/null || die
472 + git_emake install || die "Failed to emake install git-subtree"
473 + if use doc ; then
474 + git_emake install-man install-doc || die "Failed to emake install-doc install-mangit-subtree"
475 + fi
476 + newdoc README README.git-subtree
477 + dodoc git-subtree.txt
478 + popd &>/dev/null || die
479 +
480 + if use mediawiki ; then
481 + pushd contrib/mw-to-git &>/dev/null || die
482 + git_emake install
483 + popd &>/dev/null || die
484 + fi
485 +
486 + # diff-highlight
487 + dobin contrib/diff-highlight/diff-highlight
488 + newdoc contrib/diff-highlight/README README.diff-highlight
489 +
490 + # git-jump
491 + exeinto /usr/libexec/git-core/
492 + doexe contrib/git-jump/git-jump
493 + newdoc contrib/git-jump/README git-jump.txt
494 +
495 + # git-contacts
496 + exeinto /usr/libexec/git-core/
497 + doexe contrib/contacts/git-contacts
498 + dodoc contrib/contacts/git-contacts.txt
499 +
500 + if use gnome-keyring ; then
501 + pushd contrib/credential/libsecret &>/dev/null || die
502 + dobin git-credential-libsecret
503 + popd &>/dev/null || die
504 + fi
505 +
506 + if use subversion ; then
507 + pushd contrib/svn-fe &>/dev/null || die
508 + dobin svn-fe
509 + dodoc svn-fe.txt
510 + if use doc ; then
511 + doman svn-fe.1
512 + docinto html
513 + dodoc svn-fe.html
514 + fi
515 + popd &>/dev/null || die
516 + fi
517 +
518 + dodir /usr/share/${PN}/contrib
519 + # The following are excluded:
520 + # completion - installed above
521 + # diff-highlight - done above
522 + # emacs - installed above
523 + # examples - these are stuff that is not used in Git anymore actually
524 + # git-jump - done above
525 + # gitview - installed above
526 + # p4import - excluded because fast-import has a better one
527 + # patches - stuff the Git guys made to go upstream to other places
528 + # persistent-https - TODO
529 + # mw-to-git - TODO
530 + # subtree - build seperately
531 + # svnimport - use git-svn
532 + # thunderbird-patch-inline - fixes thunderbird
533 + local contrib_objects=(
534 + buildsystems
535 + fast-import
536 + hg-to-git
537 + hooks
538 + remotes2config.sh
539 + rerere-train.sh
540 + stats
541 + workdir
542 + )
543 + local i
544 + for i in "${contrib_objects[@]}" ; do
545 + cp -rf \
546 + "${S}"/contrib/${i} \
547 + "${ED%/}"/usr/share/${PN}/contrib \
548 + || die "Failed contrib ${i}"
549 + done
550 +
551 + if use perl && use cgi ; then
552 + # We used to install in /usr/share/${PN}/gitweb
553 + # but upstream installs in /usr/share/gitweb
554 + # so we will install a symlink and use their location for compat with other
555 + # distros
556 + dosym /usr/share/gitweb /usr/share/${PN}/gitweb
557 +
558 + # INSTALL discusses configuration issues, not just installation
559 + docinto /
560 + newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
561 + newdoc "${S}"/gitweb/README README.gitweb
562 +
563 + for d in "${ED%/}"/usr/lib{,64}/perl5/ ; do
564 + if test -d "${d}" ; then find "${d}" \
565 + -name .packlist \
566 + -delete || die
567 + fi
568 + done
569 + else
570 + rm -rf "${ED%/}"/usr/share/gitweb
571 + fi
572 +
573 + if ! use subversion ; then
574 + rm -f "${ED%/}"/usr/libexec/git-core/git-svn \
575 + "${ED%/}"/usr/share/man/man1/git-svn.1*
576 + fi
577 +
578 + if use xinetd ; then
579 + insinto /etc/xinetd.d
580 + newins "${FILESDIR}"/git-daemon.xinetd git-daemon
581 + fi
582 +
583 + if use !prefix ; then
584 + newinitd "${FILESDIR}"/git-daemon-r1.initd git-daemon
585 + newconfd "${FILESDIR}"/git-daemon.confd git-daemon
586 + systemd_newunit "${FILESDIR}/git-daemon_at-r1.service" "git-daemon@.service"
587 + systemd_dounit "${FILESDIR}/git-daemon.socket"
588 + fi
589 +
590 + perl_delete_localpod
591 +
592 + # Remove disabled linguas
593 + # we could remove sources in src_prepare, but install does not
594 + # handle missing locale dir well
595 + rm_loc() {
596 + if [[ -e "${ED%/}/usr/share/locale/${1}" ]]; then
597 + rm -r "${ED%/}/usr/share/locale/${1}" || die
598 + fi
599 + }
600 + l10n_for_each_disabled_locale_do rm_loc
601 +}
602 +
603 +src_test() {
604 + local disabled=()
605 + local tests_cvs=(
606 + t9200-git-cvsexportcommit.sh
607 + t9400-git-cvsserver-server.sh
608 + t9401-git-cvsserver-crlf.sh
609 + t9402-git-cvsserver-refs.sh
610 + t9600-cvsimport.sh
611 + t9601-cvsimport-vendor-branch.sh
612 + t9602-cvsimport-branches-tags.sh
613 + t9603-cvsimport-patchsets.sh
614 + t9604-cvsimport-timestamps.sh
615 + )
616 + local tests_perl=(
617 + t3701-add-interactive.sh
618 + t5502-quickfetch.sh
619 + t5512-ls-remote.sh
620 + t5520-pull.sh
621 + t7106-reset-unborn-branch.sh
622 + t7501-commit.sh
623 + )
624 + # Bug #225601 - t0004 is not suitable for root perm
625 + # Bug #219839 - t1004 is not suitable for root perm
626 + # t0001-init.sh - check for init notices EPERM* fails
627 + local tests_nonroot=(
628 + t0001-init.sh
629 + t0004-unwritable.sh
630 + t0070-fundamental.sh
631 + t1004-read-tree-m-u-wf.sh
632 + t3700-add.sh
633 + t7300-clean.sh
634 + )
635 + # t9100 still fails with symlinks in SVN 1.7
636 + local test_svn=( t9100-git-svn-basic.sh )
637 +
638 + # Unzip is used only for the testcase code, not by any normal parts of Git.
639 + if ! has_version app-arch/unzip ; then
640 + einfo "Disabling tar-tree tests"
641 + disabled+=( t5000-tar-tree.sh )
642 + fi
643 +
644 + local cvs=0
645 + use cvs && let cvs=${cvs}+1
646 + if [[ ${EUID} -eq 0 ]]; then
647 + if [[ ${cvs} -eq 1 ]]; then
648 + ewarn "Skipping CVS tests because CVS does not work as root!"
649 + ewarn "You should retest with FEATURES=userpriv!"
650 + disabled+=( ${tests_cvs[@]} )
651 + fi
652 + einfo "Skipping other tests that require being non-root"
653 + disabled+=( ${tests_nonroot[@]} )
654 + else
655 + [[ ${cvs} -gt 0 ]] && \
656 + has_version dev-vcs/cvs && \
657 + let cvs=${cvs}+1
658 + [[ ${cvs} -gt 1 ]] && \
659 + has_version "dev-vcs/cvs[server]" && \
660 + let cvs=${cvs}+1
661 + if [[ ${cvs} -lt 3 ]]; then
662 + einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
663 + disabled+=( ${tests_cvs[@]} )
664 + fi
665 + fi
666 +
667 + if ! use perl ; then
668 + einfo "Disabling tests that need Perl"
669 + disabled+=( ${tests_perl[@]} )
670 + fi
671 +
672 + einfo "Disabling tests that fail with SVN 1.7"
673 + disabled+=( ${test_svn[@]} )
674 +
675 + # Reset all previously disabled tests
676 + pushd t &>/dev/null || die
677 + local i
678 + for i in *.sh.DISABLED ; do
679 + [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
680 + done
681 + einfo "Disabled tests:"
682 + for i in ${disabled[@]} ; do
683 + [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled ${i}"
684 + done
685 +
686 + # Avoid the test system removing the results because we want them ourselves
687 + sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
688 + -i Makefile || die
689 +
690 + # Clean old results first, must always run
691 + nonfatal git_emake clean
692 + popd &>/dev/null || die
693 +
694 + # Now run the tests, keep going if we hit an error, and don't terminate on
695 + # failure
696 + local rc
697 + einfo "Start test run"
698 + #MAKEOPTS=-j1
699 + nonfatal git_emake --keep-going test
700 + rc=$?
701 +
702 + # Display nice results, now print the results
703 + pushd t &>/dev/null || die
704 + nonfatal git_emake aggregate-results
705 +
706 + # And bail if there was a problem
707 + [ ${rc} -eq 0 ] || die "tests failed. Please file a bug."
708 +}
709 +
710 +showpkgdeps() {
711 + local pkg=$1
712 + shift
713 + elog " $(printf "%-17s:" ${pkg}) ${@}"
714 +}
715 +
716 +pkg_postinst() {
717 + use emacs && elisp-site-regen
718 + elog "Please read /usr/share/bash-completion/completions/git for Git bash command"
719 + elog "completion."
720 + elog "Please read /usr/share/git/git-prompt.sh for Git bash prompt"
721 + elog "Note that the prompt bash code is now in that separate script"
722 + elog "These additional scripts need some dependencies:"
723 + echo
724 + showpkgdeps git-quiltimport "dev-util/quilt"
725 + showpkgdeps git-instaweb \
726 + "|| ( www-servers/lighttpd www-servers/apache www-servers/nginx )"
727 + echo
728 + use mediawiki-experimental && ewarn "Using experimental git-mediawiki patches. The stability of cloned wiki filesystems is not guaranteed."
729 +}
730 +
731 +pkg_postrm() {
732 + use emacs && elisp-site-regen
733 +}