blob: 4da4a2754f3cf699e011803dfb4b0f25146cf4ef [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Distributed version control system"
2HOMEPAGE = "http://git-scm.com"
3SECTION = "console/utils"
4LICENSE = "GPLv2"
5DEPENDS = "openssl curl zlib expat"
6
7PROVIDES_append_class-native = " git-replacement-native"
8
9SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
10 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
11
12S = "${WORKDIR}/git-${PV}"
13
14LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
15
16EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
17 --without-tcltk \
18"
19
20inherit autotools-brokensep perlnative
21
22EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
23EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
24EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
25
26do_compile_prepend () {
27 # Remove perl/perl.mak to fix the out-of-date perl.mak error
28 # during rebuild
29 rm -f perl/perl.mak
30}
31
32do_install () {
33 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
34 template_dir=${datadir}/git-core/templates \
35 GIT_PYTHON_DIR=${D}${datadir}/git-core/python
36 install -d ${D}/${mandir}/man1
37 install -d ${D}/${mandir}/man5
38 install -d ${D}/${mandir}/man7
39 install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
40 install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
41 install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
42 install -d ${D}/${datadir}/bash-completion/completions/
43 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
44}
45
46perl_native_fixup () {
47 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
48 -e 's#${libdir}/perl-native/#${libdir}/#' \
49 ${@d.getVar("PERLTOOLS", True).replace(' /',d.getVar('D', True) + '/')}
50
51 # ${libdir} is not applicable here, perl-native files are always
52 # installed to /usr/lib on both 32/64 bits targets.
53 mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
54 rmdir -p ${D}${exec_prefix}/lib/perl-native || true
55}
56
57REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
58REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
59
60do_install_append_class-target () {
61 perl_native_fixup
62}
63
64do_install_append_class-native() {
65 create_wrapper ${D}${bindir}/git \
66 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
67 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
68}
69
70do_install_append_class-nativesdk() {
71 create_wrapper ${D}${bindir}/git \
72 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
73 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
74 perl_native_fixup
75}
76
77FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
78FILES_${PN}-dbg += "${libexecdir}/git-core/.debug"
79
80PERLTOOLS = " \
81 ${libexecdir}/git-core/git-add--interactive \
82 ${libexecdir}/git-core/git-archimport \
83 ${libexecdir}/git-core/git-cvsexportcommit \
84 ${libexecdir}/git-core/git-cvsimport \
85 ${libexecdir}/git-core/git-cvsserver \
86 ${bindir}/git-cvsserver \
87 ${libexecdir}/git-core/git-difftool \
88 ${libexecdir}/git-core/git-relink \
89 ${libexecdir}/git-core/git-send-email \
90 ${libexecdir}/git-core/git-svn \
91 ${libexecdir}/git-core/git-instaweb \
92 ${libexecdir}/git-core/git-submodule \
93 ${libexecdir}/git-core/git-am \
94 ${libexecdir}/git-core/git-request-pull \
95 ${datadir}/gitweb/gitweb.cgi \
96 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
97 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
98"
99
100# Basic tab completion support
101PACKAGES =+ "${PN}-bash-completion"
102FILES_${PN}-bash-completion = "${datadir}/bash-completion/completions/*"
103
104# Git tools requiring perl
105PACKAGES =+ "${PN}-perltools"
106FILES_${PN}-perltools += " \
107 ${PERLTOOLS} \
108 ${libdir}/perl \
109 ${datadir}/perl \
110"
111RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
112
113PACKAGES =+ "${PN}-python"
114FILES_${PN}-python = "${libdir}/python*"
115
116
117# git-tk package with gitk and git-gui
118PACKAGES =+ "${PN}-tk"
119#RDEPENDS_${PN}-tk = "${PN} tk tcl"
120#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
121FILES_${PN}-tk = " \
122 ${bindir}/gitk \
123 ${datadir}/gitk \
124"
125
126PACKAGES =+ "gitweb"
127FILES_gitweb = "${datadir}/gitweb/"
128
129
130BBCLASSEXTEND = "native nativesdk"