blob: a1d0300be7ad8644fb88c534c5b9a3ab993f1fb6 [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 \
10 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
11
12S = "${WORKDIR}/git-${PV}"
13
14LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
15
16EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
17 --without-tcltk \
18"
19
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050020inherit autotools-brokensep perlnative bash-completion
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021
22EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
23EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
24EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
25
26do_compile_prepend () {
27 # Remove perl/perl.mak to fix the out-of-date perl.mak error
28 # during rebuild
29 rm -f perl/perl.mak
30}
31
32do_install () {
33 oe_runmake install DESTDIR="${D}" bindir=${bindir} \
34 template_dir=${datadir}/git-core/templates \
35 GIT_PYTHON_DIR=${D}${datadir}/git-core/python
36 install -d ${D}/${mandir}/man1
37 install -d ${D}/${mandir}/man5
38 install -d ${D}/${mandir}/man7
39 install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
40 install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
41 install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
42 install -d ${D}/${datadir}/bash-completion/completions/
43 install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
44}
45
46perl_native_fixup () {
47 sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
48 -e 's#${libdir}/perl-native/#${libdir}/#' \
49 ${@d.getVar("PERLTOOLS", True).replace(' /',d.getVar('D', True) + '/')}
50
51 # ${libdir} is not applicable here, perl-native files are always
52 # installed to /usr/lib on both 32/64 bits targets.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050053
54 mkdir -p ${D}${libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055 mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
56 rmdir -p ${D}${exec_prefix}/lib/perl-native || true
57}
58
59REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
60REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
61
62do_install_append_class-target () {
63 perl_native_fixup
64}
65
66do_install_append_class-native() {
67 create_wrapper ${D}${bindir}/git \
68 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
69 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
70}
71
72do_install_append_class-nativesdk() {
73 create_wrapper ${D}${bindir}/git \
74 GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
75 GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
76 perl_native_fixup
77}
78
79FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080
81PERLTOOLS = " \
82 ${libexecdir}/git-core/git-add--interactive \
83 ${libexecdir}/git-core/git-archimport \
84 ${libexecdir}/git-core/git-cvsexportcommit \
85 ${libexecdir}/git-core/git-cvsimport \
86 ${libexecdir}/git-core/git-cvsserver \
87 ${bindir}/git-cvsserver \
88 ${libexecdir}/git-core/git-difftool \
89 ${libexecdir}/git-core/git-relink \
90 ${libexecdir}/git-core/git-send-email \
91 ${libexecdir}/git-core/git-svn \
92 ${libexecdir}/git-core/git-instaweb \
93 ${libexecdir}/git-core/git-submodule \
94 ${libexecdir}/git-core/git-am \
95 ${libexecdir}/git-core/git-request-pull \
96 ${datadir}/gitweb/gitweb.cgi \
97 ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
98 ${datadir}/git-core/templates/hooks/pre-rebase.sample \
99"
100
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101# Git tools requiring perl
102PACKAGES =+ "${PN}-perltools"
103FILES_${PN}-perltools += " \
104 ${PERLTOOLS} \
105 ${libdir}/perl \
106 ${datadir}/perl \
107"
108RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
109
110PACKAGES =+ "${PN}-python"
111FILES_${PN}-python = "${libdir}/python*"
112
113
114# git-tk package with gitk and git-gui
115PACKAGES =+ "${PN}-tk"
116#RDEPENDS_${PN}-tk = "${PN} tk tcl"
117#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
118FILES_${PN}-tk = " \
119 ${bindir}/gitk \
120 ${datadir}/gitk \
121"
122
123PACKAGES =+ "gitweb"
124FILES_gitweb = "${datadir}/gitweb/"
125
126
127BBCLASSEXTEND = "native nativesdk"