/[gentoo-x86]/dev-vcs/git/git-9999.ebuild
Gentoo

Contents of /dev-vcs/git/git-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.38 - (show annotations) (download)
Fri Nov 9 18:06:34 2012 UTC (2 years, 1 month ago) by grobian
Branch: MAIN
Changes since 1.37: +4 -1 lines
Fix linking on Solaris, it needs libiconv

(Portage version: 2.2.01.21313-prefix/cvs/Darwin i386, signed Manifest commit with key 0x5F75F607C5C74E89)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-vcs/git/git-9999.ebuild,v 1.37 2012/08/24 03:51:48 zmedico Exp $
4
5 EAPI=4
6
7 GENTOO_DEPEND_ON_PERL=no
8
9 # bug #329479: git-remote-testgit is not multiple-version aware
10 PYTHON_DEPEND="python? 2"
11 [[ ${PV} == *9999 ]] && SCM="git-2"
12 EGIT_REPO_URI="git://git.kernel.org/pub/scm/git/git.git"
13
14 inherit toolchain-funcs eutils elisp-common perl-module bash-completion-r1 python ${SCM}
15
16 MY_PV="${PV/_rc/.rc}"
17 MY_P="${PN}-${MY_PV}"
18
19 DOC_VER=${MY_PV}
20
21 DESCRIPTION="GIT - the stupid content tracker, the revision control system heavily used by the Linux kernel team"
22 HOMEPAGE="http://www.git-scm.com/"
23 if [[ ${PV} != *9999 ]]; then
24 SRC_URI_SUFFIX="gz"
25 SRC_URI_GOOG="http://git-core.googlecode.com/files"
26 SRC_URI_KORG="mirror://kernel/software/scm/git"
27 SRC_URI="${SRC_URI_GOOG}/${MY_P}.tar.${SRC_URI_SUFFIX}
28 ${SRC_URI_KORG}/${MY_P}.tar.${SRC_URI_SUFFIX}
29 ${SRC_URI_GOOG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
30 ${SRC_URI_KORG}/${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
31 doc? (
32 ${SRC_URI_KORG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
33 ${SRC_URI_GOOG}/${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
34 )"
35 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
36 else
37 SRC_URI=""
38 KEYWORDS=""
39 fi
40
41 LICENSE="GPL-2"
42 SLOT="0"
43 IUSE="+blksha1 +curl cgi doc emacs +gpg gtk highlight +iconv +nls +pcre +perl +python ppcsha1 tk +threads +webdav xinetd cvs subversion test"
44
45 # Common to both DEPEND and RDEPEND
46 CDEPEND="
47 !blksha1? ( dev-libs/openssl )
48 sys-libs/zlib
49 pcre? ( dev-libs/libpcre )
50 perl? ( dev-lang/perl[-build] )
51 tk? ( dev-lang/tk )
52 curl? (
53 net-misc/curl
54 webdav? ( dev-libs/expat )
55 )
56 emacs? ( virtual/emacs )"
57
58 RDEPEND="${CDEPEND}
59 gpg? ( app-crypt/gnupg )
60 perl? ( dev-perl/Error
61 dev-perl/Net-SMTP-SSL
62 dev-perl/Authen-SASL
63 cgi? ( virtual/perl-CGI highlight? ( app-text/highlight ) )
64 cvs? ( >=dev-vcs/cvsps-2.1 dev-perl/DBI dev-perl/DBD-SQLite )
65 subversion? ( dev-vcs/subversion[-dso,perl] dev-perl/libwww-perl dev-perl/TermReadKey )
66 )
67 python? ( gtk?
68 (
69 >=dev-python/pygtk-2.8
70 dev-python/pygtksourceview:2
71 ) )"
72
73 # This is how info docs are created with Git:
74 # .txt/asciidoc --(asciidoc)---------> .xml/docbook
75 # .xml/docbook --(docbook2texi.pl)--> .texi
76 # .texi --(makeinfo)---------> .info
77 DEPEND="${CDEPEND}
78 app-arch/cpio
79 doc? (
80 app-text/asciidoc
81 app-text/docbook2X
82 sys-apps/texinfo
83 )
84 test? (
85 app-crypt/gnupg
86 )"
87
88 # Live ebuild builds man pages and HTML docs, additionally
89 if [[ ${PV} == *9999 ]]; then
90 DEPEND="${DEPEND}
91 app-text/asciidoc
92 app-text/xmlto"
93 fi
94
95 SITEFILE=50${PN}-gentoo.el
96 S="${WORKDIR}/${MY_P}"
97
98 REQUIRED_USE="
99 cgi? ( perl )
100 cvs? ( perl )
101 subversion? ( perl )
102 webdav? ( curl )
103 "
104
105 pkg_setup() {
106 if use subversion && has_version dev-vcs/subversion && built_with_use --missing false dev-vcs/subversion dso ; then
107 ewarn "Per Gentoo bugs #223747, #238586, when subversion is built"
108 ewarn "with USE=dso, there may be weird crashes in git-svn. You"
109 ewarn "have been warned."
110 fi
111 if use python ; then
112 python_set_active_version 2
113 python_pkg_setup
114 fi
115 }
116
117 # This is needed because for some obscure reasons future calls to make don't
118 # pick up these exports if we export them in src_unpack()
119 exportmakeopts() {
120 local myopts
121
122 if use blksha1 ; then
123 myopts="${myopts} BLK_SHA1=YesPlease"
124 elif use ppcsha1 ; then
125 myopts="${myopts} PPC_SHA1=YesPlease"
126 fi
127
128 if use curl ; then
129 use webdav || myopts="${myopts} NO_EXPAT=YesPlease"
130 else
131 myopts="${myopts} NO_CURL=YesPlease"
132 fi
133
134 # broken assumptions, because of broken build system ...
135 myopts="${myopts} NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease"
136 myopts="${myopts} INSTALL=install TAR=tar"
137 myopts="${myopts} SHELL_PATH=${EPREFIX}/bin/sh"
138 myopts="${myopts} SANE_TOOL_PATH="
139 myopts="${myopts} OLD_ICONV="
140 myopts="${myopts} NO_EXTERNAL_GREP="
141
142 # can't define this to null, since the entire makefile depends on it
143 sed -i -e '/\/usr\/local/s/BASIC_/#BASIC_/' Makefile
144
145 use iconv \
146 || myopts="${myopts} NO_ICONV=YesPlease"
147 use nls \
148 || myopts="${myopts} NO_GETTEXT=YesPlease"
149 use tk \
150 || myopts="${myopts} NO_TCLTK=YesPlease"
151 use pcre \
152 && myopts="${myopts} USE_LIBPCRE=yes"
153 use perl \
154 && myopts="${myopts} INSTALLDIRS=vendor" \
155 || myopts="${myopts} NO_PERL=YesPlease"
156 use python \
157 || myopts="${myopts} NO_PYTHON=YesPlease"
158 use subversion \
159 || myopts="${myopts} NO_SVN_TESTS=YesPlease"
160 use threads \
161 && myopts="${myopts} THREADED_DELTA_SEARCH=YesPlease"
162 use cvs \
163 || myopts="${myopts} NO_CVS=YesPlease"
164 # Disabled until ~m68k-mint can be keyworded again
165 # if [[ ${CHOST} == *-mint* ]] ; then
166 # myopts="${myopts} NO_MMAP=YesPlease"
167 # myopts="${myopts} NO_IPV6=YesPlease"
168 # myopts="${myopts} NO_STRLCPY=YesPlease"
169 # myopts="${myopts} NO_MEMMEM=YesPlease"
170 # myopts="${myopts} NO_MKDTEMP=YesPlease"
171 # myopts="${myopts} NO_MKSTEMPS=YesPlease"
172 # fi
173 if [[ ${CHOST} == ia64-*-hpux* ]]; then
174 myopts="${myopts} NO_NSEC=YesPlease"
175 fi
176 if [[ ${CHOST} == *-*-aix* ]]; then
177 myopts="${myopts} NO_FNMATCH_CASEFOLD=YesPlease"
178 fi
179 if [[ ${CHOST} == *-solaris* ]]; then
180 myopts="${myopts} NEEDS_LIBICONV=YesPlease"
181 fi
182
183 has_version '>=app-text/asciidoc-8.0' \
184 && myopts="${myopts} ASCIIDOC8=YesPlease"
185 myopts="${myopts} ASCIIDOC_NO_ROFF=YesPlease"
186
187 # Bug 290465:
188 # builtin-fetch-pack.c:816: error: 'struct stat' has no member named 'st_mtim'
189 [[ "${CHOST}" == *-uclibc* ]] && \
190 myopts="${myopts} NO_NSEC=YesPlease"
191
192 export MY_MAKEOPTS="${myopts}"
193 }
194
195 src_unpack() {
196 if [[ ${PV} != *9999 ]]; then
197 unpack ${MY_P}.tar.${SRC_URI_SUFFIX}
198 cd "${S}"
199 unpack ${PN}-manpages-${DOC_VER}.tar.${SRC_URI_SUFFIX}
200 use doc && \
201 cd "${S}"/Documentation && \
202 unpack ${PN}-htmldocs-${DOC_VER}.tar.${SRC_URI_SUFFIX}
203 cd "${S}"
204 else
205 git-2_src_unpack
206 cd "${S}"
207 #cp "${FILESDIR}"/GIT-VERSION-GEN .
208 fi
209
210 }
211
212 src_prepare() {
213 # bug #418431 - stated for upstream 1.7.13. Developed by Michael Schwern,
214 # funded as a bounty by the Gentoo Foundation.
215 epatch "${FILESDIR}"/git-1.7.12-git-svn-backport.patch
216
217 # bug #350330 - automagic CVS when we don't want it is bad.
218 epatch "${FILESDIR}"/git-1.7.12-optional-cvs.patch
219
220 sed -i \
221 -e 's:^\(CFLAGS =\).*$:\1 $(OPTCFLAGS) -Wall:' \
222 -e 's:^\(LDFLAGS =\).*$:\1 $(OPTLDFLAGS):' \
223 -e 's:^\(CC = \).*$:\1$(OPTCC):' \
224 -e 's:^\(AR = \).*$:\1$(OPTAR):' \
225 -e "s:\(PYTHON_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
226 -e "s:\(PERL_PATH = \)\(.*\)$:\1${EPREFIX}\2:" \
227 Makefile || die "sed failed"
228
229 # Never install the private copy of Error.pm (bug #296310)
230 sed -i \
231 -e '/private-Error.pm/s,^,#,' \
232 perl/Makefile.PL
233
234 # Fix docbook2texi command
235 sed -i 's/DOCBOOK2X_TEXI=docbook2x-texi/DOCBOOK2X_TEXI=docbook2texi.pl/' \
236 Documentation/Makefile || die "sed failed"
237 }
238
239 git_emake() {
240 # bug #326625: PERL_PATH, PERL_MM_OPT
241 # bug #320647: PYTHON_PATH
242 PYTHON_PATH=""
243 use python && PYTHON_PATH="$(PYTHON -a)"
244 emake ${MY_MAKEOPTS} \
245 DESTDIR="${D}" \
246 OPTCFLAGS="${CFLAGS}" \
247 OPTLDFLAGS="${LDFLAGS}" \
248 OPTCC="$(tc-getCC)" \
249 OPTAR="$(tc-getAR)" \
250 prefix="${EPREFIX}"/usr \
251 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
252 sysconfdir="${EPREFIX}"/etc \
253 PYTHON_PATH="${PYTHON_PATH}" \
254 PERL_MM_OPT="" \
255 GIT_TEST_OPTS="--no-color" \
256 "$@"
257 # This is the fix for bug #326625, but it also causes breakage, see bug
258 # #352693.
259 # PERL_PATH="${EPREFIX}/usr/bin/env perl" \
260 }
261
262 src_configure() {
263 exportmakeopts
264 }
265
266 src_compile() {
267 git_emake perl/PM.stamp || die "emake perl/PM.stamp failed"
268 git_emake perl/perl.mak || die "emake perl/perl.mak failed"
269 git_emake || die "emake failed"
270
271 if use emacs ; then
272 elisp-compile contrib/emacs/git{,-blame}.el \
273 || die "emacs modules failed"
274 fi
275
276 if use perl && use cgi ; then
277 git_emake \
278 gitweb/gitweb.cgi \
279 || die "emake gitweb/gitweb.cgi failed"
280 fi
281
282 cd "${S}"/Documentation
283 if [[ ${PV} == *9999 ]] ; then
284 git_emake man \
285 || die "emake man failed"
286 if use doc ; then
287 git_emake info html \
288 || die "emake info html failed"
289 fi
290 else
291 if use doc ; then
292 git_emake info \
293 || die "emake info html failed"
294 fi
295 fi
296 }
297
298 src_install() {
299 git_emake \
300 install || \
301 die "make install failed"
302
303 # Depending on the tarball and manual rebuild of the documentation, the
304 # manpages may exist in either OR both of these directories.
305 find man?/*.[157] >/dev/null 2>&1 && doman man?/*.[157]
306 find Documentation/*.[157] >/dev/null 2>&1 && doman Documentation/*.[157]
307
308 dodoc README Documentation/{SubmittingPatches,CodingGuidelines}
309 use doc && dodir /usr/share/doc/${PF}/html
310 for d in / /howto/ /technical/ ; do
311 docinto ${d}
312 dodoc Documentation${d}*.txt
313 use doc && dohtml -p ${d} Documentation${d}*.html
314 done
315 docinto /
316 # Upstream does not ship this pre-built :-(
317 use doc && doinfo Documentation/{git,gitman}.info
318
319 newbashcomp contrib/completion/git-completion.bash ${PN}
320
321 if use emacs ; then
322 elisp-install ${PN} contrib/emacs/git.{el,elc} || die
323 elisp-install ${PN} contrib/emacs/git-blame.{el,elc} || die
324 #elisp-install ${PN}/compat contrib/emacs/vc-git.{el,elc} || die
325 # don't add automatically to the load-path, so the sitefile
326 # can do a conditional loading
327 touch "${ED}${SITELISP}/${PN}/compat/.nosearch"
328 elisp-site-file-install "${FILESDIR}"/${SITEFILE} || die
329 fi
330
331 if use python && use gtk ; then
332 dobin "${S}"/contrib/gitview/gitview
333 python_convert_shebangs ${PYTHON_ABI} "${ED}"/usr/bin/gitview
334 dodoc "${S}"/contrib/gitview/gitview.txt
335 fi
336
337 #dobin contrib/fast-import/git-p4 # Moved upstream
338 #dodoc contrib/fast-import/git-p4.txt # Moved upstream
339 newbin contrib/fast-import/import-tars.perl import-tars
340 newbin contrib/git-resurrect.sh git-resurrect
341
342 dodir /usr/share/${PN}/contrib
343 # The following are excluded:
344 # completion - installed above
345 # emacs - installed above
346 # examples - these are stuff that is not used in Git anymore actually
347 # gitview - installed above
348 # p4import - excluded because fast-import has a better one
349 # patches - stuff the Git guys made to go upstream to other places
350 # svnimport - use git-svn
351 # thunderbird-patch-inline - fixes thunderbird
352 for i in \
353 blameview buildsystems ciabot continuous convert-objects fast-import \
354 hg-to-git hooks remotes2config.sh remotes2config.sh rerere-train.sh \
355 stats svn-fe vim workdir \
356 ; do
357 cp -rf \
358 "${S}"/contrib/${i} \
359 "${ED}"/usr/share/${PN}/contrib \
360 || die "Failed contrib ${i}"
361 done
362
363 if use perl && use cgi ; then
364 # We used to install in /usr/share/${PN}/gitweb
365 # but upstream installs in /usr/share/gitweb
366 # so we will install a symlink and use their location for compat with other
367 # distros
368 dosym /usr/share/gitweb /usr/share/${PN}/gitweb
369
370 # INSTALL discusses configuration issues, not just installation
371 docinto /
372 newdoc "${S}"/gitweb/INSTALL INSTALL.gitweb
373 newdoc "${S}"/gitweb/README README.gitweb
374
375 find "${ED}"/usr/lib64/perl5/ \
376 -name .packlist \
377 -exec rm \{\} \;
378 else
379 rm -rf "${ED}"/usr/share/gitweb
380 fi
381
382 if ! use subversion ; then
383 rm -f "${ED}"/usr/libexec/git-core/git-svn \
384 "${ED}"/usr/share/man/man1/git-svn.1*
385 fi
386
387 if use xinetd ; then
388 insinto /etc/xinetd.d
389 newins "${FILESDIR}"/git-daemon.xinetd git-daemon
390 fi
391
392 newinitd "${FILESDIR}"/git-daemon.initd git-daemon
393 newconfd "${FILESDIR}"/git-daemon.confd git-daemon
394
395 fixlocalpod
396 }
397
398 src_test() {
399 local disabled=""
400 local tests_cvs="t9200-git-cvsexportcommit.sh \
401 t9400-git-cvsserver-server.sh \
402 t9401-git-cvsserver-crlf.sh \
403 t9600-cvsimport.sh \
404 t9601-cvsimport-vendor-branch.sh \
405 t9602-cvsimport-branches-tags.sh \
406 t9603-cvsimport-patchsets.sh"
407 local tests_perl="t5502-quickfetch.sh \
408 t5512-ls-remote.sh \
409 t5520-pull.sh"
410 # Bug #225601 - t0004 is not suitable for root perm
411 # Bug #219839 - t1004 is not suitable for root perm
412 # t0001-init.sh - check for init notices EPERM* fails
413 local tests_nonroot="t0001-init.sh \
414 t0004-unwritable.sh \
415 t0070-fundamental.sh \
416 t1004-read-tree-m-u-wf.sh \
417 t3700-add.sh \
418 t7300-clean.sh"
419 # t9100 still fails with symlinks in SVN 1.7
420 local test_svn="t9100-git-svn-basic.sh"
421
422 # Unzip is used only for the testcase code, not by any normal parts of Git.
423 if ! has_version app-arch/unzip ; then
424 einfo "Disabling tar-tree tests"
425 disabled="${disabled} t5000-tar-tree.sh"
426 fi
427
428 cvs=0
429 use cvs && let cvs=$cvs+1
430 if [[ ${EUID} -eq 0 ]]; then
431 if [[ $cvs -eq 1 ]]; then
432 ewarn "Skipping CVS tests because CVS does not work as root!"
433 ewarn "You should retest with FEATURES=userpriv!"
434 disabled="${disabled} ${tests_cvs}"
435 fi
436 einfo "Skipping other tests that require being non-root"
437 disabled="${disabled} ${tests_nonroot}"
438 else
439 [[ $cvs -gt 0 ]] && \
440 has_version dev-vcs/cvs && \
441 let cvs=$cvs+1
442 [[ $cvs -gt 1 ]] && \
443 built_with_use dev-vcs/cvs server && \
444 let cvs=$cvs+1
445 if [[ $cvs -lt 3 ]]; then
446 einfo "Disabling CVS tests (needs dev-vcs/cvs[USE=server])"
447 disabled="${disabled} ${tests_cvs}"
448 fi
449 fi
450
451 if ! use perl ; then
452 einfo "Disabling tests that need Perl"
453 disabled="${disabled} ${tests_perl}"
454 fi
455
456 einfo "Disabling tests that fail with SVN 1.7"
457 disabled="${disabled} ${test_svn}"
458
459 # Reset all previously disabled tests
460 cd "${S}/t"
461 for i in *.sh.DISABLED ; do
462 [[ -f "${i}" ]] && mv -f "${i}" "${i%.DISABLED}"
463 done
464 einfo "Disabled tests:"
465 for i in ${disabled} ; do
466 [[ -f "${i}" ]] && mv -f "${i}" "${i}.DISABLED" && einfo "Disabled $i"
467 done
468
469 # Avoid the test system removing the results because we want them ourselves
470 sed -e '/^[[:space:]]*$(MAKE) clean/s,^,#,g' \
471 -i "${S}"/t/Makefile
472
473 # Clean old results first, must always run
474 cd "${S}/t"
475 nonfatal git_emake clean
476
477 # Now run the tests, keep going if we hit an error, and don't terminate on
478 # failure
479 cd "${S}"
480 einfo "Start test run"
481 #MAKEOPTS=-j1
482 nonfatal git_emake --keep-going test
483 rc=$?
484
485 # Display nice results, now print the results
486 cd "${S}/t"
487 nonfatal git_emake aggregate-results
488
489 # And bail if there was a problem
490 [ $rc -eq 0 ] || die "tests failed. Please file a bug."
491 }
492
493 showpkgdeps() {
494 local pkg=$1
495 shift
496 elog " $(printf "%-17s:" ${pkg}) ${@}"
497 }
498
499 pkg_postinst() {
500 use emacs && elisp-site-regen
501 use python && python_mod_optimize git_remote_helpers
502 einfo "Please read /usr/share/bash-completion/git for Git bash completion"
503 elog "These additional scripts need some dependencies:"
504 echo
505 showpkgdeps git-quiltimport "dev-util/quilt"
506 showpkgdeps git-instaweb \
507 "|| ( www-servers/lighttpd www-servers/apache )"
508 echo
509 }
510
511 pkg_postrm() {
512 use emacs && elisp-site-regen
513 use python && python_mod_cleanup git_remote_helpers
514 }

  ViewVC Help
Powered by ViewVC 1.1.20