blob: 8603c045cc90541b58159ee20eff545449ca7f7b [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 Bishop220d5532018-08-14 00:59:39 +010010 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \
Brad Bishop004d4992018-10-02 23:54:45 +020011 file://CVE-2018-11235.patch \
12 file://CVE-2018-11233.patch"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013
14S = "${WORKDIR}/git-${PV}"
15
16LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
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"
25
Patrick Williamsc0f7c042017-02-23 20:41:17 -060026# Needs brokensep as this doesn't use automake
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050027inherit autotools-brokensep perlnative bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028
29EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
30EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
31EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
32
33do_compile_prepend () {
34 # Remove perl/perl.mak to fix the out-of-date perl.mak error
35 # during rebuild
36 rm -f perl/perl.mak
37}
38
39do_install () {
40 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060041 template_dir=${datadir}/git-core/templates
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042 install -d ${D}/${mandir}/man1
43 install -d ${D}/${mandir}/man5
44 install -d ${D}/${mandir}/man7
45 install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
46 install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
47 install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
48 install -d ${D}/${datadir}/bash-completion/completions/
49 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
50}
51
52perl_native_fixup () {
53 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
54 -e 's#${libdir}/perl-native/#${libdir}/#' \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055 ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056
57 # ${libdir} is not applicable here, perl-native files are always
58 # installed to /usr/lib on both 32/64 bits targets.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050059
60 mkdir -p ${D}${libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061 mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
62 rmdir -p ${D}${exec_prefix}/lib/perl-native || true
Brad Bishop6e60e8b2018-02-01 10:27:11 -050063
64 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
65 # Only install the git cvsserver command if explicitly requested
66 # as it requires the DBI Perl module, which does not exist in
67 # OE-Core.
68 rm ${D}${libexecdir}/git-core/git-cvsserver \
69 ${D}${bindir}/git-cvsserver
70 fi
71
72 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
73 # Only install the git svn command and all Git::SVN Perl modules
74 # if explicitly requested as they require the SVN::Core Perl
75 # module, which does not exist in OE-Core.
76 rm -r ${D}${libexecdir}/git-core/git-svn \
77 ${D}${libdir}/perl/site_perl/*/Git/SVN*
78 sed -i -e '/SVN/d' ${D}${libdir}/perl/site_perl/*/auto/Git/.packlist
79 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080}
81
82REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
83REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
84
85do_install_append_class-target () {
86 perl_native_fixup
87}
88
89do_install_append_class-native() {
90 create_wrapper ${D}${bindir}/git \
91 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
92 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
93}
94
95do_install_append_class-nativesdk() {
96 create_wrapper ${D}${bindir}/git \
97 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
98 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
99 perl_native_fixup
100}
101
102FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103
104PERLTOOLS = " \
105 ${libexecdir}/git-core/git-add--interactive \
106 ${libexecdir}/git-core/git-archimport \
107 ${libexecdir}/git-core/git-cvsexportcommit \
108 ${libexecdir}/git-core/git-cvsimport \
109 ${libexecdir}/git-core/git-cvsserver \
110 ${bindir}/git-cvsserver \
111 ${libexecdir}/git-core/git-difftool \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112 ${libexecdir}/git-core/git-send-email \
113 ${libexecdir}/git-core/git-svn \
114 ${libexecdir}/git-core/git-instaweb \
115 ${libexecdir}/git-core/git-submodule \
116 ${libexecdir}/git-core/git-am \
117 ${libexecdir}/git-core/git-request-pull \
118 ${datadir}/gitweb/gitweb.cgi \
119 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
120 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400121 ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500122"
123
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500124# Git tools requiring perl
125PACKAGES =+ "${PN}-perltools"
126FILES_${PN}-perltools += " \
127 ${PERLTOOLS} \
128 ${libdir}/perl \
129 ${datadir}/perl \
130"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400131
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500132RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
133
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500134# 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/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500145RDEPENDS_gitweb = "perl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500146
147BBCLASSEXTEND = "native nativesdk"