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 \ |
| 24 | " |
| 25 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 26 | # Needs brokensep as this doesn't use automake |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | inherit autotools-brokensep perlnative bash-completion |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | |
| 29 | EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" |
| 30 | EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'" |
| 31 | EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1" |
| 32 | |
| 33 | do_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 | |
| 39 | do_install () { |
| 40 | oe_runmake install DESTDIR="${D}" bindir=${bindir} \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 41 | template_dir=${datadir}/git-core/templates |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 42 | |
| 43 | for section in man1 man5 man7; do |
| 44 | install -d ${D}/${mandir}/$section |
| 45 | install -t ${D}/${mandir}/$section ${WORKDIR}/$section/* |
| 46 | done |
| 47 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 | |
| 52 | perl_native_fixup () { |
| 53 | sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \ |
| 54 | -e 's#${libdir}/perl-native/#${libdir}/#' \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 55 | ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 57 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then |
| 58 | # Only install the git cvsserver command if explicitly requested |
| 59 | # as it requires the DBI Perl module, which does not exist in |
| 60 | # OE-Core. |
| 61 | rm ${D}${libexecdir}/git-core/git-cvsserver \ |
| 62 | ${D}${bindir}/git-cvsserver |
| 63 | fi |
| 64 | |
| 65 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then |
| 66 | # Only install the git svn command and all Git::SVN Perl modules |
| 67 | # if explicitly requested as they require the SVN::Core Perl |
| 68 | # module, which does not exist in OE-Core. |
| 69 | rm -r ${D}${libexecdir}/git-core/git-svn \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 70 | ${D}${datadir}/perl5/Git/SVN* |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 71 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core" |
| 75 | REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates" |
| 76 | |
| 77 | do_install_append_class-target () { |
| 78 | perl_native_fixup |
| 79 | } |
| 80 | |
| 81 | do_install_append_class-native() { |
| 82 | create_wrapper ${D}${bindir}/git \ |
| 83 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 84 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 85 | } |
| 86 | |
| 87 | do_install_append_class-nativesdk() { |
| 88 | create_wrapper ${D}${bindir}/git \ |
| 89 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 90 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 91 | perl_native_fixup |
| 92 | } |
| 93 | |
| 94 | FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 95 | |
| 96 | PERLTOOLS = " \ |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 97 | ${bindir}/git-cvsserver \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 98 | ${libexecdir}/git-core/git-add--interactive \ |
| 99 | ${libexecdir}/git-core/git-archimport \ |
| 100 | ${libexecdir}/git-core/git-cvsexportcommit \ |
| 101 | ${libexecdir}/git-core/git-cvsimport \ |
| 102 | ${libexecdir}/git-core/git-cvsserver \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 103 | ${libexecdir}/git-core/git-send-email \ |
| 104 | ${libexecdir}/git-core/git-svn \ |
| 105 | ${libexecdir}/git-core/git-instaweb \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 106 | ${datadir}/gitweb/gitweb.cgi \ |
| 107 | ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \ |
| 108 | ${datadir}/git-core/templates/hooks/pre-rebase.sample \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 109 | ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 110 | " |
| 111 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 112 | # Git tools requiring perl |
| 113 | PACKAGES =+ "${PN}-perltools" |
| 114 | FILES_${PN}-perltools += " \ |
| 115 | ${PERLTOOLS} \ |
| 116 | ${libdir}/perl \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 117 | ${datadir}/perl5 \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 118 | " |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 119 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 120 | RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils" |
| 121 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 122 | # git-tk package with gitk and git-gui |
| 123 | PACKAGES =+ "${PN}-tk" |
| 124 | #RDEPENDS_${PN}-tk = "${PN} tk tcl" |
| 125 | #EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh" |
| 126 | FILES_${PN}-tk = " \ |
| 127 | ${bindir}/gitk \ |
| 128 | ${datadir}/gitk \ |
| 129 | " |
| 130 | |
| 131 | PACKAGES =+ "gitweb" |
| 132 | FILES_gitweb = "${datadir}/gitweb/" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 133 | RDEPENDS_gitweb = "perl" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 134 | |
| 135 | BBCLASSEXTEND = "native nativesdk" |