Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Distributed version control system" |
| 2 | HOMEPAGE = "http://git-scm.com" |
| 3 | SECTION = "console/utils" |
| 4 | LICENSE = "GPLv2" |
| 5 | DEPENDS = "openssl curl zlib expat" |
| 6 | |
| 7 | PROVIDES_append_class-native = " git-replacement-native" |
| 8 | |
| 9 | SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | |
| 12 | S = "${WORKDIR}/git-${PV}" |
| 13 | |
| 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1" |
| 15 | |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 16 | CVE_PRODUCT = "git-scm:git" |
| 17 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | PACKAGECONFIG ??= "" |
| 19 | PACKAGECONFIG[cvsserver] = "" |
| 20 | PACKAGECONFIG[svn] = "" |
| 21 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 22 | EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \ |
| 23 | --without-tcltk \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 24 | --without-iconv \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 26 | EXTRA_OECONF_append_class-nativesdk = " --with-gitconfig=/etc/gitconfig " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 28 | # Needs brokensep as this doesn't use automake |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 29 | inherit autotools-brokensep perlnative bash-completion |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | |
| 31 | EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" |
| 32 | EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'" |
| 33 | EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1" |
| 34 | |
| 35 | do_compile_prepend () { |
| 36 | # Remove perl/perl.mak to fix the out-of-date perl.mak error |
| 37 | # during rebuild |
| 38 | rm -f perl/perl.mak |
| 39 | } |
| 40 | |
| 41 | do_install () { |
| 42 | oe_runmake install DESTDIR="${D}" bindir=${bindir} \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 43 | template_dir=${datadir}/git-core/templates |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 44 | |
| 45 | for section in man1 man5 man7; do |
| 46 | install -d ${D}/${mandir}/$section |
| 47 | install -t ${D}/${mandir}/$section ${WORKDIR}/$section/* |
| 48 | done |
| 49 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | install -d ${D}/${datadir}/bash-completion/completions/ |
| 51 | install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git |
| 52 | } |
| 53 | |
| 54 | perl_native_fixup () { |
| 55 | sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \ |
| 56 | -e 's#${libdir}/perl-native/#${libdir}/#' \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 57 | ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 59 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then |
| 60 | # Only install the git cvsserver command if explicitly requested |
| 61 | # as it requires the DBI Perl module, which does not exist in |
| 62 | # OE-Core. |
| 63 | rm ${D}${libexecdir}/git-core/git-cvsserver \ |
| 64 | ${D}${bindir}/git-cvsserver |
| 65 | fi |
| 66 | |
| 67 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then |
| 68 | # Only install the git svn command and all Git::SVN Perl modules |
| 69 | # if explicitly requested as they require the SVN::Core Perl |
| 70 | # module, which does not exist in OE-Core. |
| 71 | rm -r ${D}${libexecdir}/git-core/git-svn \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 72 | ${D}${datadir}/perl5/Git/SVN* |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 73 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core" |
| 77 | REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates" |
| 78 | |
| 79 | do_install_append_class-target () { |
| 80 | perl_native_fixup |
| 81 | } |
| 82 | |
| 83 | do_install_append_class-native() { |
| 84 | create_wrapper ${D}${bindir}/git \ |
| 85 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 86 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 87 | } |
| 88 | |
| 89 | do_install_append_class-nativesdk() { |
| 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 | perl_native_fixup |
| 94 | } |
| 95 | |
| 96 | FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 97 | |
| 98 | PERLTOOLS = " \ |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 99 | ${bindir}/git-cvsserver \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 100 | ${libexecdir}/git-core/git-add--interactive \ |
| 101 | ${libexecdir}/git-core/git-archimport \ |
| 102 | ${libexecdir}/git-core/git-cvsexportcommit \ |
| 103 | ${libexecdir}/git-core/git-cvsimport \ |
| 104 | ${libexecdir}/git-core/git-cvsserver \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | ${libexecdir}/git-core/git-send-email \ |
| 106 | ${libexecdir}/git-core/git-svn \ |
| 107 | ${libexecdir}/git-core/git-instaweb \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 108 | ${datadir}/gitweb/gitweb.cgi \ |
| 109 | ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \ |
| 110 | ${datadir}/git-core/templates/hooks/pre-rebase.sample \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 111 | ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 112 | " |
| 113 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 114 | # Git tools requiring perl |
| 115 | PACKAGES =+ "${PN}-perltools" |
| 116 | FILES_${PN}-perltools += " \ |
| 117 | ${PERLTOOLS} \ |
| 118 | ${libdir}/perl \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 119 | ${datadir}/perl5 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 120 | " |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 121 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 122 | RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils" |
| 123 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 124 | # git-tk package with gitk and git-gui |
| 125 | PACKAGES =+ "${PN}-tk" |
| 126 | #RDEPENDS_${PN}-tk = "${PN} tk tcl" |
| 127 | #EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh" |
| 128 | FILES_${PN}-tk = " \ |
| 129 | ${bindir}/gitk \ |
| 130 | ${datadir}/gitk \ |
| 131 | " |
| 132 | |
| 133 | PACKAGES =+ "gitweb" |
| 134 | FILES_gitweb = "${datadir}/gitweb/" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 135 | RDEPENDS_gitweb = "perl" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 136 | |
| 137 | BBCLASSEXTEND = "native nativesdk" |