blob: 4131c98977c606dce66eae4bf1c50e8d6a3ac26b [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 Bishop96ff1982019-08-19 13:50:42 -040016CVE_PRODUCT = "git-scm:git"
17
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018PACKAGECONFIG ??= ""
19PACKAGECONFIG[cvsserver] = ""
20PACKAGECONFIG[svn] = ""
21
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
23 --without-tcltk \
24"
Andrew Geissler82c905d2020-04-13 13:39:40 -050025EXTRA_OECONF_append_class-nativesdk = " --with-gitconfig=/etc/gitconfig "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027# Needs brokensep as this doesn't use automake
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028inherit autotools-brokensep perlnative bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029
30EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
31EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
32EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
33
34do_compile_prepend () {
35 # Remove perl/perl.mak to fix the out-of-date perl.mak error
36 # during rebuild
37 rm -f perl/perl.mak
38}
39
40do_install () {
41 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060042 template_dir=${datadir}/git-core/templates
Brad Bishop64c979e2019-11-04 13:55:29 -050043
44 for section in man1 man5 man7; do
45 install -d ${D}/${mandir}/$section
46 install -t ${D}/${mandir}/$section ${WORKDIR}/$section/*
47 done
48
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 install -d ${D}/${datadir}/bash-completion/completions/
50 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
51}
52
53perl_native_fixup () {
54 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
55 -e 's#${libdir}/perl-native/#${libdir}/#' \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056 ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057
Brad Bishop6e60e8b2018-02-01 10:27:11 -050058 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
59 # Only install the git cvsserver command if explicitly requested
60 # as it requires the DBI Perl module, which does not exist in
61 # OE-Core.
62 rm ${D}${libexecdir}/git-core/git-cvsserver \
63 ${D}${bindir}/git-cvsserver
64 fi
65
66 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
67 # Only install the git svn command and all Git::SVN Perl modules
68 # if explicitly requested as they require the SVN::Core Perl
69 # module, which does not exist in OE-Core.
70 rm -r ${D}${libexecdir}/git-core/git-svn \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080071 ${D}${datadir}/perl5/Git/SVN*
Brad Bishop6e60e8b2018-02-01 10:27:11 -050072 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073}
74
75REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
76REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
77
78do_install_append_class-target () {
79 perl_native_fixup
80}
81
82do_install_append_class-native() {
83 create_wrapper ${D}${bindir}/git \
84 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
85 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
86}
87
88do_install_append_class-nativesdk() {
89 create_wrapper ${D}${bindir}/git \
90 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
91 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
92 perl_native_fixup
93}
94
95FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096
97PERLTOOLS = " \
Brad Bishop64c979e2019-11-04 13:55:29 -050098 ${bindir}/git-cvsserver \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099 ${libexecdir}/git-core/git-add--interactive \
100 ${libexecdir}/git-core/git-archimport \
101 ${libexecdir}/git-core/git-cvsexportcommit \
102 ${libexecdir}/git-core/git-cvsimport \
103 ${libexecdir}/git-core/git-cvsserver \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500104 ${libexecdir}/git-core/git-send-email \
105 ${libexecdir}/git-core/git-svn \
106 ${libexecdir}/git-core/git-instaweb \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500107 ${datadir}/gitweb/gitweb.cgi \
108 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
109 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400110 ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111"
112
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113# Git tools requiring perl
114PACKAGES =+ "${PN}-perltools"
115FILES_${PN}-perltools += " \
116 ${PERLTOOLS} \
117 ${libdir}/perl \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800118 ${datadir}/perl5 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500119"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400120
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500121RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
122
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123# git-tk package with gitk and git-gui
124PACKAGES =+ "${PN}-tk"
125#RDEPENDS_${PN}-tk = "${PN} tk tcl"
126#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
127FILES_${PN}-tk = " \
128 ${bindir}/gitk \
129 ${datadir}/gitk \
130"
131
132PACKAGES =+ "gitweb"
133FILES_gitweb = "${datadir}/gitweb/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500134RDEPENDS_gitweb = "perl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500135
136BBCLASSEXTEND = "native nativesdk"