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