blob: bea23ec78314735490aa233fed11117beb0b1bf7 [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 \
11 file://CVE-2018-11235.patch"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012
13S = "${WORKDIR}/git-${PV}"
14
15LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
16
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017PACKAGECONFIG ??= ""
18PACKAGECONFIG[cvsserver] = ""
19PACKAGECONFIG[svn] = ""
20
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
22 --without-tcltk \
23"
24
Patrick Williamsc0f7c042017-02-23 20:41:17 -060025# Needs brokensep as this doesn't use automake
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026inherit autotools-brokensep perlnative bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027
28EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
29EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
30EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
31
32do_compile_prepend () {
33 # Remove perl/perl.mak to fix the out-of-date perl.mak error
34 # during rebuild
35 rm -f perl/perl.mak
36}
37
38do_install () {
39 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060040 template_dir=${datadir}/git-core/templates
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041 install -d ${D}/${mandir}/man1
42 install -d ${D}/${mandir}/man5
43 install -d ${D}/${mandir}/man7
44 install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
45 install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
46 install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
47 install -d ${D}/${datadir}/bash-completion/completions/
48 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
49}
50
51perl_native_fixup () {
52 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
53 -e 's#${libdir}/perl-native/#${libdir}/#' \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054 ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055
56 # ${libdir} is not applicable here, perl-native files are always
57 # installed to /usr/lib on both 32/64 bits targets.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050058
59 mkdir -p ${D}${libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060 mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
61 rmdir -p ${D}${exec_prefix}/lib/perl-native || true
Brad Bishop6e60e8b2018-02-01 10:27:11 -050062
63 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
64 # Only install the git cvsserver command if explicitly requested
65 # as it requires the DBI Perl module, which does not exist in
66 # OE-Core.
67 rm ${D}${libexecdir}/git-core/git-cvsserver \
68 ${D}${bindir}/git-cvsserver
69 fi
70
71 if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
72 # Only install the git svn command and all Git::SVN Perl modules
73 # if explicitly requested as they require the SVN::Core Perl
74 # module, which does not exist in OE-Core.
75 rm -r ${D}${libexecdir}/git-core/git-svn \
76 ${D}${libdir}/perl/site_perl/*/Git/SVN*
77 sed -i -e '/SVN/d' ${D}${libdir}/perl/site_perl/*/auto/Git/.packlist
78 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079}
80
81REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
82REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
83
84do_install_append_class-target () {
85 perl_native_fixup
86}
87
88do_install_append_class-native() {
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}
93
94do_install_append_class-nativesdk() {
95 create_wrapper ${D}${bindir}/git \
96 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
97 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
98 perl_native_fixup
99}
100
101FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102
103PERLTOOLS = " \
104 ${libexecdir}/git-core/git-add--interactive \
105 ${libexecdir}/git-core/git-archimport \
106 ${libexecdir}/git-core/git-cvsexportcommit \
107 ${libexecdir}/git-core/git-cvsimport \
108 ${libexecdir}/git-core/git-cvsserver \
109 ${bindir}/git-cvsserver \
110 ${libexecdir}/git-core/git-difftool \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111 ${libexecdir}/git-core/git-send-email \
112 ${libexecdir}/git-core/git-svn \
113 ${libexecdir}/git-core/git-instaweb \
114 ${libexecdir}/git-core/git-submodule \
115 ${libexecdir}/git-core/git-am \
116 ${libexecdir}/git-core/git-request-pull \
117 ${datadir}/gitweb/gitweb.cgi \
118 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
119 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400120 ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500121"
122
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123# Git tools requiring perl
124PACKAGES =+ "${PN}-perltools"
125FILES_${PN}-perltools += " \
126 ${PERLTOOLS} \
127 ${libdir}/perl \
128 ${datadir}/perl \
129"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400130
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500131RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
132
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500133# git-tk package with gitk and git-gui
134PACKAGES =+ "${PN}-tk"
135#RDEPENDS_${PN}-tk = "${PN} tk tcl"
136#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
137FILES_${PN}-tk = " \
138 ${bindir}/gitk \
139 ${datadir}/gitk \
140"
141
142PACKAGES =+ "gitweb"
143FILES_gitweb = "${datadir}/gitweb/"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500144RDEPENDS_gitweb = "perl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500145
146BBCLASSEXTEND = "native nativesdk"