blob: 146983a9181154ce290115f8e45dbd1318022c4c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Distributed version control system"
2HOMEPAGE = "http://git-scm.com"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06003DESCRIPTION = "Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency."
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004SECTION = "console/utils"
5LICENSE = "GPLv2"
6DEPENDS = "openssl curl zlib expat"
7
8PROVIDES_append_class-native = " git-replacement-native"
9
10SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060011 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \
Andrew Geissler95ac1b82021-03-31 14:34:31 -050012 file://fixsort.patch \
13"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014
15S = "${WORKDIR}/git-${PV}"
16
17LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
18
Brad Bishop96ff1982019-08-19 13:50:42 -040019CVE_PRODUCT = "git-scm:git"
20
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021PACKAGECONFIG ??= ""
22PACKAGECONFIG[cvsserver] = ""
23PACKAGECONFIG[svn] = ""
24
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
26 --without-tcltk \
Andrew Geisslerc182c622020-05-15 14:13:32 -050027 --without-iconv \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029EXTRA_OECONF_append_class-nativesdk = " --with-gitconfig=/etc/gitconfig "
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030
Patrick Williamsc0f7c042017-02-23 20:41:17 -060031# Needs brokensep as this doesn't use automake
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032inherit autotools-brokensep perlnative bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
34EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
35EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
36EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
37
38do_compile_prepend () {
39 # Remove perl/perl.mak to fix the out-of-date perl.mak error
40 # during rebuild
41 rm -f perl/perl.mak
42}
43
44do_install () {
45 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046 template_dir=${datadir}/git-core/templates
Brad Bishop64c979e2019-11-04 13:55:29 -050047
48 for section in man1 man5 man7; do
49 install -d ${D}/${mandir}/$section
50 install -t ${D}/${mandir}/$section ${WORKDIR}/$section/*
51 done
52
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 install -d ${D}/${datadir}/bash-completion/completions/
54 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
55}
56
57perl_native_fixup () {
58 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
59 -e 's#${libdir}/perl-native/#${libdir}/#' \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050060 ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061
Brad Bishop6e60e8b2018-02-01 10:27:11 -050062 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
63 # Only install the git cvsserver command if explicitly requested
64 # as it requires the DBI Perl module, which does not exist in
65 # OE-Core.
66 rm ${D}${libexecdir}/git-core/git-cvsserver \
67 ${D}${bindir}/git-cvsserver
68 fi
69
70 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
71 # Only install the git svn command and all Git::SVN Perl modules
72 # if explicitly requested as they require the SVN::Core Perl
73 # module, which does not exist in OE-Core.
74 rm -r ${D}${libexecdir}/git-core/git-svn \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080075 ${D}${datadir}/perl5/Git/SVN*
Brad Bishop6e60e8b2018-02-01 10:27:11 -050076 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077}
78
79REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
80REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
81
82do_install_append_class-target () {
83 perl_native_fixup
84}
85
86do_install_append_class-native() {
87 create_wrapper ${D}${bindir}/git \
88 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
89 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
90}
91
92do_install_append_class-nativesdk() {
93 create_wrapper ${D}${bindir}/git \
94 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
95 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
96 perl_native_fixup
97}
98
99FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500100
101PERLTOOLS = " \
Brad Bishop64c979e2019-11-04 13:55:29 -0500102 ${bindir}/git-cvsserver \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103 ${libexecdir}/git-core/git-add--interactive \
104 ${libexecdir}/git-core/git-archimport \
105 ${libexecdir}/git-core/git-cvsexportcommit \
106 ${libexecdir}/git-core/git-cvsimport \
107 ${libexecdir}/git-core/git-cvsserver \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108 ${libexecdir}/git-core/git-send-email \
109 ${libexecdir}/git-core/git-svn \
110 ${libexecdir}/git-core/git-instaweb \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111 ${datadir}/gitweb/gitweb.cgi \
112 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
113 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400114 ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500115"
116
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500117# Git tools requiring perl
118PACKAGES =+ "${PN}-perltools"
119FILES_${PN}-perltools += " \
120 ${PERLTOOLS} \
121 ${libdir}/perl \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800122 ${datadir}/perl5 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400124
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500125RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
126
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500127# git-tk package with gitk and git-gui
128PACKAGES =+ "${PN}-tk"
129#RDEPENDS_${PN}-tk = "${PN} tk tcl"
130#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
131FILES_${PN}-tk = " \
132 ${bindir}/gitk \
133 ${datadir}/gitk \
134"
135
136PACKAGES =+ "gitweb"
137FILES_gitweb = "${datadir}/gitweb/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500138RDEPENDS_gitweb = "perl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500139
140BBCLASSEXTEND = "native nativesdk"