Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | SUMMARY = "Distributed version control system" |
| 2 | HOMEPAGE = "http://git-scm.com" |
| 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." |
| 4 | SECTION = "console/utils" |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 5 | LICENSE = "GPL-2.0-only & GPL-2.0-or-later & BSD-3-Clause & MIT & BSL-1.0 & LGPL-2.1-or-later" |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 6 | DEPENDS = "openssl zlib" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 7 | |
| 8 | PROVIDES:append:class-native = " git-replacement-native" |
| 9 | |
| 10 | SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ |
| 11 | file://fixsort.patch \ |
| 12 | file://0001-config.mak.uname-do-not-force-RHEL-7-specific-build-.patch \ |
| 13 | " |
| 14 | |
| 15 | S = "${WORKDIR}/git-${PV}" |
| 16 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 17 | LIC_FILES_CHKSUM = "\ |
| 18 | file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1 \ |
| 19 | file://reftable/LICENSE;md5=1a6424cafc4c9c88c689848e165af33b \ |
| 20 | file://sha1dc/LICENSE.txt;md5=9bbe4c990a9e98ea4b98ef5d3bcb8a7a \ |
| 21 | file://compat/nedmalloc/License.txt;md5=e4224ccaecb14d942c71d31bef20d78c \ |
| 22 | file://compat/inet_ntop.c;md5=76593c6f74e8ced5b24520175688d59b;endline=16 \ |
| 23 | file://compat/obstack.h;md5=08ad25fee5428cd879ceef451ce3a22e;endline=18 \ |
| 24 | file://compat/poll/poll.h;md5=9fc00170a53b8e3e52157c91ac688dd1;endline=19 \ |
| 25 | file://compat/regex/regex.h;md5=30cc8af0e6f0f8a25acec6d8783bb763;beginline=4;endline=22 \ |
| 26 | " |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 27 | |
| 28 | CVE_PRODUCT = "git-scm:git" |
| 29 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 30 | # This is about a manpage not mentioning --mirror may "leak" information |
| 31 | # in mirrored git repos. Most OE users wouldn't build the docs and |
| 32 | # we don't see this as a major issue for our general users/usecases. |
| 33 | CVE_CHECK_IGNORE += "CVE-2022-24975" |
| 34 | |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 35 | PACKAGECONFIG ??= "expat curl" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 36 | PACKAGECONFIG[cvsserver] = "" |
| 37 | PACKAGECONFIG[svn] = "" |
| 38 | PACKAGECONFIG[manpages] = ",,asciidoc-native xmlto-native" |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 39 | PACKAGECONFIG[curl] = "--with-curl,--without-curl,curl" |
| 40 | PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 41 | |
| 42 | EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \ |
| 43 | --without-tcltk \ |
| 44 | --without-iconv \ |
| 45 | " |
| 46 | EXTRA_OECONF:append:class-nativesdk = " --with-gitconfig=/etc/gitconfig " |
| 47 | |
| 48 | # Needs brokensep as this doesn't use automake |
| 49 | inherit autotools-brokensep perlnative bash-completion manpages |
| 50 | |
| 51 | EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" |
| 52 | EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'" |
| 53 | EXTRA_OEMAKE += "COMPUTE_HEADER_DEPENDENCIES=no" |
| 54 | EXTRA_OEMAKE:append:class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1" |
| 55 | |
| 56 | do_compile:prepend () { |
| 57 | # Remove perl/perl.mak to fix the out-of-date perl.mak error |
| 58 | # during rebuild |
| 59 | rm -f perl/perl.mak |
| 60 | |
| 61 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'manpages', d)}" ]; then |
| 62 | oe_runmake man |
| 63 | fi |
| 64 | } |
| 65 | |
| 66 | do_install () { |
| 67 | oe_runmake install DESTDIR="${D}" bindir=${bindir} \ |
| 68 | template_dir=${datadir}/git-core/templates |
| 69 | |
| 70 | install -d ${D}/${datadir}/bash-completion/completions/ |
| 71 | install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git |
| 72 | |
| 73 | if [ "${@bb.utils.filter('PACKAGECONFIG', 'manpages', d)}" ]; then |
| 74 | oe_runmake install-man DESTDIR="${D}" |
| 75 | fi |
| 76 | } |
| 77 | |
| 78 | perl_native_fixup () { |
| 79 | sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \ |
| 80 | -e 's#${libdir}/perl-native/#${libdir}/#' \ |
| 81 | ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')} |
| 82 | |
| 83 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then |
| 84 | # Only install the git cvsserver command if explicitly requested |
| 85 | # as it requires the DBI Perl module, which does not exist in |
| 86 | # OE-Core. |
| 87 | rm ${D}${libexecdir}/git-core/git-cvsserver \ |
| 88 | ${D}${bindir}/git-cvsserver |
| 89 | fi |
| 90 | |
| 91 | if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then |
| 92 | # Only install the git svn command and all Git::SVN Perl modules |
| 93 | # if explicitly requested as they require the SVN::Core Perl |
| 94 | # module, which does not exist in OE-Core. |
| 95 | rm -r ${D}${libexecdir}/git-core/git-svn \ |
| 96 | ${D}${datadir}/perl5/Git/SVN* |
| 97 | fi |
| 98 | } |
| 99 | |
| 100 | REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core" |
| 101 | REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates" |
| 102 | |
| 103 | do_install:append:class-target () { |
| 104 | perl_native_fixup |
| 105 | } |
| 106 | |
| 107 | do_install:append:class-native() { |
| 108 | create_wrapper ${D}${bindir}/git \ |
| 109 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 110 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 111 | } |
| 112 | |
| 113 | do_install:append:class-nativesdk() { |
| 114 | create_wrapper ${D}${bindir}/git \ |
| 115 | GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \ |
| 116 | GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR} |
| 117 | perl_native_fixup |
| 118 | } |
| 119 | |
| 120 | FILES:${PN} += "${datadir}/git-core ${libexecdir}/git-core/" |
| 121 | |
| 122 | PERLTOOLS = " \ |
| 123 | ${bindir}/git-cvsserver \ |
| 124 | ${libexecdir}/git-core/git-add--interactive \ |
| 125 | ${libexecdir}/git-core/git-archimport \ |
| 126 | ${libexecdir}/git-core/git-cvsexportcommit \ |
| 127 | ${libexecdir}/git-core/git-cvsimport \ |
| 128 | ${libexecdir}/git-core/git-cvsserver \ |
| 129 | ${libexecdir}/git-core/git-send-email \ |
| 130 | ${libexecdir}/git-core/git-svn \ |
| 131 | ${libexecdir}/git-core/git-instaweb \ |
| 132 | ${datadir}/gitweb/gitweb.cgi \ |
| 133 | ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \ |
| 134 | ${datadir}/git-core/templates/hooks/pre-rebase.sample \ |
| 135 | ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \ |
| 136 | " |
| 137 | |
| 138 | # Git tools requiring perl |
| 139 | PACKAGES =+ "${PN}-perltools" |
| 140 | FILES:${PN}-perltools += " \ |
| 141 | ${PERLTOOLS} \ |
| 142 | ${libdir}/perl \ |
| 143 | ${datadir}/perl5 \ |
| 144 | " |
| 145 | |
| 146 | RDEPENDS:${PN}-perltools = "${PN} perl perl-module-file-path findutils" |
| 147 | |
| 148 | # git-tk package with gitk and git-gui |
| 149 | PACKAGES =+ "${PN}-tk" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 150 | #RDEPENDS:${PN}-tk = "${PN} tk tcl" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 151 | #EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh" |
| 152 | FILES:${PN}-tk = " \ |
| 153 | ${bindir}/gitk \ |
| 154 | ${datadir}/gitk \ |
| 155 | " |
| 156 | |
| 157 | PACKAGES =+ "gitweb" |
| 158 | FILES:gitweb = "${datadir}/gitweb/" |
| 159 | RDEPENDS:gitweb = "perl" |
| 160 | |
| 161 | BBCLASSEXTEND = "native nativesdk" |
| 162 | |
| 163 | EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \ |
| 164 | ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \ |
| 165 | " |
| 166 | EXTRA_OEMAKE += "NO_GETTEXT=1" |
| 167 | |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 168 | SRC_URI[tarball.sha256sum] = "7dded96a52e7996ce90dd74a187aec175737f680dc063f3f33c8932cf5c8d809" |