blob: 26a22ac1e84dfd252ecf0dd820ebe11b3db4afd2 [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 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011
12S = "${WORKDIR}/git-${PV}"
13
14LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
15
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016PACKAGECONFIG ??= ""
17PACKAGECONFIG[cvsserver] = ""
18PACKAGECONFIG[svn] = ""
19
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
21 --without-tcltk \
22"
23
Patrick Williamsc0f7c042017-02-23 20:41:17 -060024# Needs brokensep as this doesn't use automake
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050025inherit autotools-brokensep perlnative bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
27EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
28EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
29EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
30
31do_compile_prepend () {
32 # Remove perl/perl.mak to fix the out-of-date perl.mak error
33 # during rebuild
34 rm -f perl/perl.mak
35}
36
37do_install () {
38 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060039 template_dir=${datadir}/git-core/templates
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040 install -d ${D}/${mandir}/man1
41 install -d ${D}/${mandir}/man5
42 install -d ${D}/${mandir}/man7
43 install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
44 install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
45 install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
46 install -d ${D}/${datadir}/bash-completion/completions/
47 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
48}
49
50perl_native_fixup () {
51 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
52 -e 's#${libdir}/perl-native/#${libdir}/#' \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050053 ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
56 # Only install the git cvsserver command if explicitly requested
57 # as it requires the DBI Perl module, which does not exist in
58 # OE-Core.
59 rm ${D}${libexecdir}/git-core/git-cvsserver \
60 ${D}${bindir}/git-cvsserver
61 fi
62
63 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
64 # Only install the git svn command and all Git::SVN Perl modules
65 # if explicitly requested as they require the SVN::Core Perl
66 # module, which does not exist in OE-Core.
67 rm -r ${D}${libexecdir}/git-core/git-svn \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080068 ${D}${datadir}/perl5/Git/SVN*
Brad Bishop6e60e8b2018-02-01 10:27:11 -050069 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070}
71
72REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
73REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
74
75do_install_append_class-target () {
76 perl_native_fixup
77}
78
79do_install_append_class-native() {
80 create_wrapper ${D}${bindir}/git \
81 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
82 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
83}
84
85do_install_append_class-nativesdk() {
86 create_wrapper ${D}${bindir}/git \
87 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
88 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
89 perl_native_fixup
90}
91
92FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093
94PERLTOOLS = " \
95 ${libexecdir}/git-core/git-add--interactive \
96 ${libexecdir}/git-core/git-archimport \
97 ${libexecdir}/git-core/git-cvsexportcommit \
98 ${libexecdir}/git-core/git-cvsimport \
99 ${libexecdir}/git-core/git-cvsserver \
100 ${bindir}/git-cvsserver \
101 ${libexecdir}/git-core/git-difftool \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102 ${libexecdir}/git-core/git-send-email \
103 ${libexecdir}/git-core/git-svn \
104 ${libexecdir}/git-core/git-instaweb \
105 ${libexecdir}/git-core/git-submodule \
106 ${libexecdir}/git-core/git-am \
107 ${libexecdir}/git-core/git-request-pull \
108 ${datadir}/gitweb/gitweb.cgi \
109 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
110 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400111 ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112"
113
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500114# Git tools requiring perl
115PACKAGES =+ "${PN}-perltools"
116FILES_${PN}-perltools += " \
117 ${PERLTOOLS} \
118 ${libdir}/perl \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800119 ${datadir}/perl5 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500120"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400121
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500122RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
123
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500124# git-tk package with gitk and git-gui
125PACKAGES =+ "${PN}-tk"
126#RDEPENDS_${PN}-tk = "${PN} tk tcl"
127#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
128FILES_${PN}-tk = " \
129 ${bindir}/gitk \
130 ${datadir}/gitk \
131"
132
133PACKAGES =+ "gitweb"
134FILES_gitweb = "${datadir}/gitweb/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500135RDEPENDS_gitweb = "perl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500136
137BBCLASSEXTEND = "native nativesdk"