blob: 47c22118640243ebdfc749f4f74948af05056289 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001SUMMARY = "Distributed version control system"
2HOMEPAGE = "http://git-scm.com"
3DESCRIPTION = "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."
4SECTION = "console/utils"
5LICENSE = "GPL-2.0-only"
Patrick Williams45852732022-04-02 08:58:32 -05006DEPENDS = "openssl zlib"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00007
8PROVIDES:append:class-native = " git-replacement-native"
9
10SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
11 file://fixsort.patch \
12 file://0001-config.mak.uname-do-not-force-RHEL-7-specific-build-.patch \
13 "
14
15S = "${WORKDIR}/git-${PV}"
16
17LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
18
19CVE_PRODUCT = "git-scm:git"
20
Patrick Williams45852732022-04-02 08:58:32 -050021PACKAGECONFIG ??= "expat curl"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000022PACKAGECONFIG[cvsserver] = ""
23PACKAGECONFIG[svn] = ""
24PACKAGECONFIG[manpages] = ",,asciidoc-native xmlto-native"
Patrick Williams45852732022-04-02 08:58:32 -050025PACKAGECONFIG[curl] = "--with-curl,--without-curl,curl"
26PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000027
28EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
29 --without-tcltk \
30 --without-iconv \
31"
32EXTRA_OECONF:append:class-nativesdk = " --with-gitconfig=/etc/gitconfig "
33
34# Needs brokensep as this doesn't use automake
35inherit autotools-brokensep perlnative bash-completion manpages
36
37EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
38EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
39EXTRA_OEMAKE += "COMPUTE_HEADER_DEPENDENCIES=no"
40EXTRA_OEMAKE:append:class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
41
42do_compile:prepend () {
43 # Remove perl/perl.mak to fix the out-of-date perl.mak error
44 # during rebuild
45 rm -f perl/perl.mak
46
47 if [ "${@bb.utils.filter('PACKAGECONFIG', 'manpages', d)}" ]; then
48 oe_runmake man
49 fi
50}
51
52do_install () {
53 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
54 template_dir=${datadir}/git-core/templates
55
56 install -d ${D}/${datadir}/bash-completion/completions/
57 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
58
59 if [ "${@bb.utils.filter('PACKAGECONFIG', 'manpages', d)}" ]; then
60 oe_runmake install-man DESTDIR="${D}"
61 fi
62}
63
64perl_native_fixup () {
65 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
66 -e 's#${libdir}/perl-native/#${libdir}/#' \
67 ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
68
69 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
70 # Only install the git cvsserver command if explicitly requested
71 # as it requires the DBI Perl module, which does not exist in
72 # OE-Core.
73 rm ${D}${libexecdir}/git-core/git-cvsserver \
74 ${D}${bindir}/git-cvsserver
75 fi
76
77 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
78 # Only install the git svn command and all Git::SVN Perl modules
79 # if explicitly requested as they require the SVN::Core Perl
80 # module, which does not exist in OE-Core.
81 rm -r ${D}${libexecdir}/git-core/git-svn \
82 ${D}${datadir}/perl5/Git/SVN*
83 fi
84}
85
86REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
87REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
88
89do_install:append:class-target () {
90 perl_native_fixup
91}
92
93do_install:append:class-native() {
94 create_wrapper ${D}${bindir}/git \
95 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
96 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
97}
98
99do_install:append:class-nativesdk() {
100 create_wrapper ${D}${bindir}/git \
101 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
102 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
103 perl_native_fixup
104}
105
106FILES:${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
107
108PERLTOOLS = " \
109 ${bindir}/git-cvsserver \
110 ${libexecdir}/git-core/git-add--interactive \
111 ${libexecdir}/git-core/git-archimport \
112 ${libexecdir}/git-core/git-cvsexportcommit \
113 ${libexecdir}/git-core/git-cvsimport \
114 ${libexecdir}/git-core/git-cvsserver \
115 ${libexecdir}/git-core/git-send-email \
116 ${libexecdir}/git-core/git-svn \
117 ${libexecdir}/git-core/git-instaweb \
118 ${datadir}/gitweb/gitweb.cgi \
119 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
120 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
121 ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \
122"
123
124# Git tools requiring perl
125PACKAGES =+ "${PN}-perltools"
126FILES:${PN}-perltools += " \
127 ${PERLTOOLS} \
128 ${libdir}/perl \
129 ${datadir}/perl5 \
130"
131
132RDEPENDS:${PN}-perltools = "${PN} perl perl-module-file-path findutils"
133
134# git-tk package with gitk and git-gui
135PACKAGES =+ "${PN}-tk"
136#RDEPENDS_${PN}-tk = "${PN} tk tcl"
137#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
138FILES:${PN}-tk = " \
139 ${bindir}/gitk \
140 ${datadir}/gitk \
141"
142
143PACKAGES =+ "gitweb"
144FILES:gitweb = "${datadir}/gitweb/"
145RDEPENDS:gitweb = "perl"
146
147BBCLASSEXTEND = "native nativesdk"
148
149EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \
150 ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \
151 "
152EXTRA_OEMAKE += "NO_GETTEXT=1"
153
154SRC_URI[tarball.sha256sum] = "9845a37dd01f9faaa7d8aa2078399d3aea91b43819a5efea6e2877b0af09bd43"